ifconfig nightmare

bscott at ntisys.com bscott at ntisys.com
Fri Mar 7 08:55:30 EST 2003


On Fri, 7 Mar 2003, at 6:18am, hafnium at metrocast.net wrote:
>> By "virtual", do you mean "aliased"?  That is, a single Ethernet
>> interface with multiple IP addresses?  Or do you mean 802.1Q VLAN
>> interfaces?
> 
> I have an eth0, eth0:1, eth0:2 ... eth0:8

  Okay, those are "aliased" interfaces.  "Virtual" interfaces typically
means VLAN stuff, so you might want to watch your terminology.  It will
avoid confusing people who deal with both technologies.  :)

> Redhat 7.3 stock kernel version.

  Thanks -- it really helps to know what distribution a person is using,
since different distributions use different configuration automation
mechanisms.

> ... This particular machine hasn't been rebooted since the virtuals were
> defined.  (60+ days ago) ...When I initally set it up, I manually entered
> the ifconfig commands to bring them up.

  Yeah.  While testing with manual commands is very useful, I recommend
testing your final, permanent configuration after, for this very reason.  
Sometimes subtle differences between the manual commands you entered and the
automatic configuration you defined can get you.

  In this case, using the command

	service network restart

would have shutdown and then restarted all network interfaces.  Assuming the
momentary network disruption did not hurt you, that would be a good test.

> I defined a default gateway for each (oooh that might be it?)

  That would be it, yes.  If you define multiple default gateways, you will
have multiple default gateways.  ;-)

  What you should do is remove default gateway entries from all of those
ifcfg-eth* files.  Then place a single default gateway definition in the
"ifcfg-eth0" file.  The statements would be

	GATEWAY=a.b.c.d
	GATEWAYDEV=eth0

> plus, a S99local script to route del -net <network> and route add -net
> <network> dev eth0

  If you are using Red Hat or a derivative, I recommend using the

	/etc/sysconfig/static-routes

file to define static, non-default routes, rather than manual commands in
the rc.local script.  See the file

	/usr/share/doc/initscripts-*/sysconfig.txt

for more information on Red Hat's configuration automation.

-- 
Ben Scott <bscott at ntisys.com>
| The opinions expressed in this message are those of the author and do  |
| not represent the views or policy of any other person or organization. |
| All information is provided without warranty of any kind.              |






More information about the gnhlug-discuss mailing list