Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Router setup

Status
Not open for further replies.

bkesting

IS-IT--Management
Apr 14, 2003
180
US
Hello,

I am trying to setup a linux box to act as a router for two different networks. I have two NICs in the machine and have enabled IP forwarding for the purpose of routing.

I have eth0 setup as 192.168.2.30/24 with a gateway of 192.168.2.1 to reach the Internet. On my second NIC (eth1), I have it configured as 192.168.10.1/24. I would like for the 192.168.10.0 network to be able to reach the Internet via the 192.168.2.0 network.

What do I need to set the gateway to for eth1? Also here are the entries in my routing table:

Dest. GW Netmask Iface
192.168.2.0 * 255.255.255.0 eth0
192.168.10.0 * 255.255.255.0 eth1
192.168.2.0 192.168.2.30 255.255.255.0 eth0
192.168.10.0 192.168.10.1 255.255.255.0 eth1
default 192.168.2.1 0.0.0.0 eth0

I have a laptop connected to eth1 and I have assigned it IP address of 192.168.10.10. I can ping 192.168.10.1 and 192.168.2.30 but nothing else. From the router I can ping 192.168.10.1 but not the laptop. Where are my problems?

Thanks.
 
The first thing that you have to do is tell your Internet router where 192.168.10.0 is. You need a static route that uses 192.168.2.30 as the gateway. That static route will need to exist on all of the machines that need to access that network, so putting in the DHCP configuration is the best way to go.

But I don't know if your Internet router will automatically NAT for a network that it doesn't provide (if not you may have to set up NAT for your linux router). You can do that using IPTables.


pansophic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top