[lug] linux network

Kyle Moore kmoore at trustamerica.com
Mon Oct 2 14:32:49 MDT 2000


***WARNING*** Detailed post below

Basically I've got things working but don't understand why. I also don't
know how to do it without rebooting. Thankfully, both times I have
needed to do this have been perfect timing and I've been able to reboot
the box.

I have one network card in this Redhat 6.2 box. That card has three
different IP's. 

eth0   => 10.0.0.1
eth0:0 => 172.168.0.1
eth0:1 => 192.168.1.1

I configured these like this:

/sbin/ifconfig eth0:0 172.168.0.1
/sbin/ifconfig eth0:1 192.168.1.1

I'm not sure what routes to add. When I add them how I think they should
be it gives me a syntax error. What I ended up doing was adding them to
/etc/sysconfig/network-scripts/ and rebooting. I end up with routes like
this:

# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
10.0.0.1	0.0.0.0         255.255.255.255 UH        0 0          0 eth0
172.168.1.1	0.0.0.0         255.255.255.255 UH        0 0          0
eth0
192.168.1.1     0.0.0.0         255.255.255.255 UH        0 0          0
eth0
10.0.0.0	0.0.0.0         255.255.255.0   U         0 0          0 eth0
172.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0
eth0
192.168.1.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         10.0.0.254	0.0.0.0         UG        0 0          0 eth0
0.0.0.0         172.168.1.254   0.0.0.0         UG        0 0          0
eth0
0.0.0.0         192.168.1.254   0.0.0.0         UG        0 0          0
eth0


On HP-UX I would set these up differently. Each different network or
host would have a gateway listed next to it rather than 0.0.0.0. How
does a packet going to 172.168.1.1 know to go to the 172.168.1.254
gateway rather than 10.0.0.254? They way I have it works but I had to
reboot to get it this way. I guess the main thing I'm having trouble
with is how the route command works with Linux and how the routes are
supposed to look. 

Any good books you can recommend?
-- 

----
Kyle Moore




More information about the LUG mailing list