Operating System - Linux
1829158 Members
2324 Online
109986 Solutions
New Discussion

Default Gateway precedence

 
Peter Heinemann
Frequent Advisor

Default Gateway precedence

Just wanted to confirm an impression, based on reading other posts and replies, that a gateway setting in an ifcfg-ethX file will, if present, supercede a gateway setting in sysconfig/network.

So a "default" gateway depends on where you defined it....and if all the ifcfg-ethX scripts have gateways defined, there's no purpose in placing one in sysconfig/network.

thanks...
3 REPLIES 3
Peeyush
Regular Advisor

Re: Default Gateway precedence

lemme confuse u more

there r four way in linux to change ur network setting(IP address):
1. /etc/sysconfig/network-scripts/ifcfg-eth[n]
2. /etc/sysconfig/networking/devices/ifcfg-eth[n]]
3. /etc/sysconfig/networking/profiles/default/ifcfg-eth0
4. GUI redhat-network (redhat-config-network, redhat-config-network-cmd, redhat-config-network-druid, redhat-config-network-gui, redhat-config-network-tui,redhat-control-network)

and which ifcfg-ethX file r u pointing in ur question

regards
peeyush
http://geocities.com/peeyush_maurya/
any suggestion for my site.. http://geocities.com/peeyush_maurya/
Mark Grant
Honored Contributor

Re: Default Gateway precedence

In addition to the above ways which don't work on most linux boxes there is the correct way. And all the above ways are merely wrappers around this command.

"ifconfig"

Stick a few of those in your start up scripts and not only will you never be confused about which one to use again but you'll know that the way you have learnt will not only work on all Linux boxes but also 99% of unix boxes too.
Never preceed any demonstration with anything more predictive than "watch this"
Martin P.J. Zinser
Honored Contributor

Re: Default Gateway precedence

Hi,

I might not put is quite as harsh as Mark, but the information you've got in before certainly has been Redhat centric. From what I can see, I think /etc/sysconfig/network will be a good more general starting point to look for the network scripts in the various Linux distros.

And yes, familiarity with ifconfig is certainly usefull in general terms (also to check what settings your systems actually does use as opposed to what you think it should use ;-)

Greetings, Martin