LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Private LAN accessing the Internet - Using route, how do I use it? (https://www.linuxquestions.org/questions/linux-networking-3/private-lan-accessing-the-internet-using-route-how-do-i-use-it-555201/)

sbabcock23 05-19-2007 01:53 PM

Private LAN accessing the Internet - Using route, how do I use it?
 
Hi,

I have 2 Ethernet cards. 1 is public (215.254.188.140 with a gateway of 215.254.188.137) and a private card with (192.168.23.1). I want to route traffic from computers on the private LAN to the internet. How do I do this?

So I have a computer say 192.168.23.240 connected to the network. I can ping the server 192.168.23.1 but I can ping outside to the Internet. Can you provide steps on how I can achieve this?

Thanks

btmiller 05-19-2007 02:54 PM

Assuming the gateway is set up to forward packets from the local net to the Internet, then on the private network machines you just need to do:

route add default gw 192.168.23.1

(puyt it in your network setup scripts so you don't have to rerun it aty every reboot).

If the gateway is not set to forward packets look for a Linux IP masquerading / NAT howto. It's pretty simple to set up.

jschiwal 05-19-2007 03:21 PM

Enter in "route" with no arguments to get a list of the routes. There should be one for each network ( 215.254.188.0 and 192.168.23.0 ) as well as the default route.

If the gateway device isn't a NAT router, then you need to configure masquerading and enable ip forwarding.

Your distro's gui configuration program may be able to set this up for you. It may be called internet sharing in the config.

You may need to also modprobe the tcp_conntrack module before ip forwarding will work.


All times are GMT -5. The time now is 11:47 PM.