>I have 3 nics all on diff networks on a linux box. Its redhat 6.2 no >updates (yet as I wanted to test, then patch OS/Kernel). Here is the >route command I am trying to implement: > >route add -net 175.23.0.0 netmask 255.255.0.0 eth1 >route add -net 24.231.45.0 netmask 255.255.255.0 eth2
Assuming you have something like this listed in your /etc/hosts file:
127.0.0.1 localhost 175.23.0.1 ifcooh ifcooh.yourdomain.com 24.231.45.1 ifcone ifcone.yourdomain.com 24.231.45.2 gwmain gwmain.yourdomain.com
Where ifcooh and ifctwo are the two NICs, and gwmain is a gateway host accessable on the ethernet connected to ifcone.
And this in your /etc/networks file:
127.0.0.0 loopback 175.23.0.0 netooh 24.231.45.0 netone
You can use the ifconfig command like this
/sbin/ifconfig lo localhost broadcast 127.0.0.255 /sbin/ifconfig eth0 ifcooh broadcast 175.23.0.255 /sbin/ifconfig eth1 ifcone broadcast 24.231.45.255
Then you can use the route command, like this
/sbin/route add -net loopback netmask 255.0.0.0 dev lo /sbin/route add -net netooh netmask 255.255.255.0 dev eth0 /sbin/route add -net netone netmask 255.255.255.0 dev eth1
You can also add routing for individual hosts:
/sbin/route add gwmain dev eth1
And you can use that as a default gateway,
/sbin/route add default gw gwmain dev eth1
Or, you can just default everything to that interface, and hope that something on that ethernet will route it:
/sbin/route add default dev eth1
Floyd L. Davidson