LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Accessing a local server with a public IP (https://www.linuxquestions.org/questions/linux-networking-3/accessing-a-local-server-with-a-public-ip-129497/)

ganninu 12-28-2003 08:43 AM

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)

thanks a lot,
ganninu

fatgod 12-28-2003 09:49 AM

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...

ganninu 12-28-2003 10:04 AM

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.

fatgod 12-29-2003 03:31 AM

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?

ganninu 12-29-2003 03:38 AM

sometimes you need to test the access using the public IP :) But anyways, I thought it was only my network which was strange not to be accessed that way.

fatgod 12-29-2003 04:07 AM

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.


All times are GMT -5. The time now is 03:14 PM.