[CentOS] route question

Corey A Johnson cjohnson at cniweb.net
Fri May 14 19:06:59 UTC 2010


>> 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?
>
> Jerry
>
>
>   
Traffic will already route out the appropriate interface for a directly 
connected network.  So packets to an IP on the 74.223.8.176/28 subnet 
should route out eth1 and packets to the 24.123.23.168/29 network will 
route out eth2.

Are you trying to route other subnets within the 74.X.X.X out eth1?

Cj



More information about the CentOS mailing list