Operating System - Linux
1754420 Members
2604 Online
108813 Solutions
New Discussion юеВ

Routing problem in RH6.0 with 2 nics

 
Craig A. Sharp
Super Advisor

Routing problem in RH6.0 with 2 nics

Hi all,

Ok here we go. I have a server with two nics. The first (eth0) is on the 192.168.2.0 network which is in a DMZ.
The second (eth1) is on the 200.1.1.0 network.

Here is the current routing table
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
200.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.2.2 0.0.0.0 UG 0 0 0 eth0

Again, eth0 is connected to the dmz, eth1 is connected to a switch on the 200.1.1.0 network.
I can see eth0 and connect to it with no problem. I cannot see eth1. I have confirmed that eth1 is up but still nothing. I do not want routed or gated on. I need to keep the two networks seperate. I do however need to be able to talk to both. In the routing table, the default gw is 192.168.2.2. eth0 and eth1 is using this gateway. The gateway for eth1 should be 200.1.1.77.
I added a network route for 200.1.1.0 to 200.1.1.77 but this does not work and does not stay when the system is rebooted. I cannot remove the 200.1.1.0 to default entry either.
How do I make this work?

Thanks,

Craig
2 REPLIES 2
harry d brown jr
Honored Contributor

Re: Routing problem in RH6.0 with 2 nics

You need to define TWO gateways. One for the 192.168.2 net and a second for the 200.1.1 network.

Check these docs out:

http://www.yolinux.com/TUTORIALS/LinuxTutorialNetworking.html#ADDNIC

http://www.infocom.cqu.edu.au/Units/aut99/85321/Resources/Print_Resources/Textbook/chap15/

live free or die
harry
Live Free or Die
Bernie Vande Griend
Respected Contributor

Re: Routing problem in RH6.0 with 2 nics

You will need to define the gateway for the second NIC. To do it so it goes into effect with reboot, modify the GATEWAY in:
/etc/sysconfig/network-scripts/ifcfg-eth1

To do this "on the fly":
route add -net 200.1.1.0 netmask 255.255.255.0 gw 200.1.1.77 dev eth1

You should be able to ping 200.1.1.77 from your linux box even before you set up this gateway, if you cannot, then check the rest of the setting on your NIC and the connection itself. Good Luck!
Ye who thinks he has a lot to say, probably shouldn't.