I have two servers in my network: A: 192.168.0.1, B: 192.168.0.1
Now I want to run HTTPD on server B, but access it using 192.168.0.1, which means, make HTTPD bind to 192.168.0.1:80 on server B. Is that possible? How to make it?
I have considered iptables and SSH tunnel, but I don’t know how to do it.
Note: Things like reverse proxy or sniproxy are not considered, as they do not fit my situation.
Thank you for your help.
41 Answer
You cannot have a server on one IP address bind to a port on another IP address owned by another host, no.
If what you're asking is that host A is your router/gateway, and host B is the actual hardware where you want to run a server, you will need to configure host A to forward connection requests on port 80 to port 80 at the IP for host B. The configuration for this depends on what host A is, and what software is running on it.