[CentOS] route question

Sat May 15 11:13:00 UTC 2010
Dominik Zyla <gavroche at gavroche.pl>

On Fri, May 14, 2010 at 03:02:04PM -0400, Jerry Geis wrote:
> >
> > GATEWAY=74.223.8.177 on /etc/sysconfig/network file ?
> >   
> Actually I have that in the ifcfg-eth1 and ifcfg-eth2. And this is hte 
> route I get.
> 
> DEVICE=eth1
> ONBOOT=YES
> BOOTPROTO=static
> IPADDR=74.223.8.179
> NETMASK=255.255.255.240
> GATEWAY=74.223.8.177
> 
> 
> DEVICE=eth2
> ONBOOT=Yes
> BOOTPROTO=static
> IPADDR=24.123.23.170
> NETMASK=255.255.255.248
> GATEWAY=24.123.23.169
> 
>  route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use 
> Iface
> 24.123.23.168   0.0.0.0         255.255.255.248 U     0      0        0 eth2
> 74.223.8.176    0.0.0.0         255.255.255.240 U     0      0        0 eth1
> 192.168.1.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 eth2
> 0.0.0.0         24.123.23.169   0.0.0.0         UG    0      0        0 eth2
> 
> 
> I dont want 74.X traffic going out 24.X network. I want it going back 
> out the 74.X network.
> How do I setup the ifcfg-eth files so the GW above will route back out 
> the correct gw?

It won't work. You can't have two default gateways. Init scripts first
set your gateway via eth1, then parse ifcfg-eth2 (alphabetical) and
overwrites previous settings.

-- 
Dominik Zyla

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20100515/20c450d5/attachment-0005.sig>