Operating System - Linux
1830044 Members
3090 Online
109998 Solutions
New Discussion

How to Configure Two Gateways

 
Jeeshan
Honored Contributor

How to Configure Two Gateways

My OS is Red Hat Enterprise Linux ES release 4 (Nahant Update 5).

I have two NIC and two different network IP is used there.My routing table is

Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.16.111.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.16.110.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 172.16.111.253 0.0.0.0 UG 0 0 0 eth1

and in /etc/sysconfig/network-scripts i hav created two routing files

route-eth0 is

ADDRESS0="172.16.110.50"
NETMASK0="255.255.255.0"
GATEWAY0="172.16.110.253"

route-eth1 is

ADDRESS1="172.16.111.50"
NETMASK1="255.255.255.0"
GATEWAY1="172.16.111.253"

but it is not working. Is the syntax ok? or any other permission or workaround should be there.

Please advice me.
a warrior never quits
3 REPLIES 3
Ivan Ferreira
Honored Contributor

Re: How to Configure Two Gateways

¿What are you trying to do? In your configuration files, you are trying to add a "gateway" for hosts that can be reached directly by the host. As the host has network interfaces on each network, you don't need a gateway to reach 172.16.110.50 or 172.16.111.50.

Also, besides is wrong your route configuration, you are having several problems in your config files. In both, should be ADDRESS0, NETMASK0 and GATEWAY0 as is the first route for each interface. You should not specify a network mask /24 for a host route.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jeeshan
Honored Contributor

Re: How to Configure Two Gateways

actually the problem is i have 8 Linux servers and all of them consists of two NIC card and assigned two different network.

Whenever i ping to one NIC it comes so speedily and whenever i ping the other NIC it comes after a while.

both NIC are connected in a cisco switch which has default STP protocol enabled.
a warrior never quits
Jeeshan
Honored Contributor

Re: How to Configure Two Gateways

thanks all guyz. i have solved it using a sample bash script in concept of multihomed linux.
a warrior never quits