[lug] linux network
Kevin Fenzi
kevin at scrye.com
Mon Oct 2 14:56:39 MDT 2000
>>>>> "Kyle" == Kyle Moore <kmoore at trustamerica.com> writes:
Kyle> ***WARNING*** Detailed post below Basically I've got things
Kyle> working but don't understand why. I also don't know how to do it
Kyle> without rebooting. Thankfully, both times I have needed to do
Kyle> this have been perfect timing and I've been able to reboot the
Kyle> box.
Kyle> I have one network card in this Redhat 6.2 box. That card has
Kyle> three different IP's.
Kyle> eth0 => 10.0.0.1 eth0:0 => 172.168.0.1 eth0:1 => 192.168.1.1
Kyle> I configured these like this:
Kyle> /sbin/ifconfig eth0:0 172.168.0.1 /sbin/ifconfig eth0:1
Kyle> 192.168.1.1
Kyle> I'm not sure what routes to add. When I add them how I think
Kyle> they should be it gives me a syntax error. What I ended up doing
Kyle> was adding them to /etc/sysconfig/network-scripts/ and
Kyle> rebooting. I end up with routes like this:
yeah, adding them to /etc/sysconfig/network-scripts/ifcfg-eth0:0 and
/etc/sysconfig/network-scripts/ifcfg-eth0:1 should work fine.
Kyle> ...snip...
Kyle> On HP-UX I would set these up differently. Each different
Kyle> network or host would have a gateway listed next to it rather
Kyle> than 0.0.0.0. How does a packet going to 172.168.1.1 know to go
Kyle> to the 172.168.1.254 gateway rather than 10.0.0.254? They way I
Kyle> have it works but I had to reboot to get it this way. I guess
Kyle> the main thing I'm having trouble with is how the route command
Kyle> works with Linux and how the routes are supposed to look.
Well, these are all "Host" routes. They say that to get to that host,
you use that interface...
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
these are all "network" routes. They say to get to anything on that
network, you use that interface and gateway. A gateway of 0.0.0.0 is
"I am the gateway"
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
These are default routes...as far as I know it will always use the
first one. So all your traffic that isn't matched by one of the routes
above is going out via 10.0.0.254. You can't have more than one
default route.
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 0eth0
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0eth0
To get rid of the network and default routes for your aliases, make
sure your ifcfg-eth0:0 and ifcfg-eth0:1 files don't have a "NETWORK="
line in them and you are only listing your 10.0.0.254 gateway in
/etc/sysconfig/network.
Kyle> Any good books you can recommend? --
not off hand, but I am sure there are some good oryliey ones. ;)
Kyle> ---- Kyle Moore
kevin
More information about the LUG
mailing list