Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Rep:
Accessing a local server with a public IP
I have a simple home network - an alcatel pro ADSL modem which is a router+NAT and is connected to 2 boxes - a webserver at 10.0.0.3 and a linuxbox at 10.0.0.4. For the guy on the linuxbox to access the webserver, he has to access it through 10.0.0.3. When the guy is outside the LAN he accesses the webserver through some public ip, say 222.222.222.222. Is there a way to access the server on the LAN by using the public ip? I was wondering whether there can exist a file which can map 222.222.222.222 to 10.0.0.3 in a simple way such that when the user on the LAN types http://222.222.222.222, he is directed to http://10.0.0.3 (I am making a fuss to reach it with the public ip since i need to test vertain programs on the LAN with a public ip for the server)
I think I follow you... You have a router that both your machines connect to, and the router has the public ip address, you want to be able to access 10.0.0.3 via the routers public ip. Correct?
You just need to configure your router to route whatever ports you want to the local machine. so if you want access to the webserver on 10.0.0.3 then you can tell your router that all requests on port 80 should go to 10.0.0.3 so the guy out side would go to http://222.222.222.222/ and transparently he would be forwarded to 10.0.0.3 inside your lan.
I dont know how to achieve this on your router though, time to RTM unless someone else here has some alcatel router experience...
Distribution: RH 7.3/8.0/9.0, Debian Stable 3.0, FreeBSD 5.2, Solaris 8/9/10,HP-UX
Posts: 340
Original Poster
Rep:
yes i have already configured that through NAT (guys can actually connect to me using the public IP). The problem is that me, myself, can only access my webserver on the same leg of the LAN through the private IP. Seems that the router does NAT for users trying to access the LAN from outside, but not for me who is on the inside.
oh! Your trying to access your webserver via the external interface from within the LAN? I dont know of a pratical way that can do that for you. Why do you want to do that? Surely access to the box is access to the box, no?
your router has two interfaces, an internal and an external, perhaps you can configure the internal interface to direct traffic detined for 222.222.222.222 to always translate to 10.0.0.3 - a sort of pseudo external connection.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.