[NTLUG:Discuss] Default gateway -where set
Leroy Tennison
leroy_tennison at prodigy.net
Sun Aug 28 03:08:05 CDT 2005
Bryan J. Smith wrote:
>On Sat, 2005-08-27 at 06:00 -0500, Leroy Tennison wrote:
>
>
>>Where is the default gateway set on Linux (Red Hat or SuSE)? I found
>>references to /etc/sysconfig/network (Red Hat) but the gateway paramater
>>in it is commented out yet I have a defautl gateway set for eth1 (dhcp
>>for my dsl).
>>
>>
>
>Depends on whether or not you want to add a system-wide default gateway
>(aka route), or if you want each interface to have their own default
>routes. In your case, you probably want the latter because you are
>using DHCP on one interface.
>
>In Red Hat, you set the system-wide default route
>in /etc/sysconfig/network. You set interface-specific default routes
>in /etc/sysconfig/network-scripts/ifcfg-(if) for each (where (if) could
>be eth0, eth1, wlan0, ppp0, etc...).
>
>If you configure one interface with DHCP, and the DHCP provides a
>default route as an option, then in the absence of any system-wide or
>other interface default route, it will often work as the default for the
>entire system. It really depends on the application, subnet involved,
>etc...
>
>With that said, are you running into issues?
>Or just asking?
>
>
>
>
Trouble or just asking? Well, a little of both. I initially had
trouble when I first got DSL. I fooled with it until I got it working
but didn't put it in any files to make it persistent. Then one day I
when booted up, it worked "auto-magically" and the settings were
different. This whole experience got my interest up. In "real life" I
do networking for a living (Microsoft, Novell, interoperability between
WinTel and mainframe/UNIX environments, even some Macintosh a good while
back). It dawned on me that I knew exactly how to set up networking in
the WinTel world but had very little knowledge when it came to Linux. I
had discovered some things but couldn't seem to easily find
documentation on others which is why I asked (and am asking).
Is what you said concerning Red Hat also true for SuSE only the scripts
are in /etc/sysconfig/network instead of /etc/sysconfig/network-scripts?
I've also been discovering how the firewall is implemented during
startup. It seems that, for Red Hat, it's simply
/etc/sysconfig/iptables which is an iptables-save/iptables-restore
script (found that format on the Web). For SuSE I ***think*** it's
/etc/sysconfig/SuSEfirewall2 which is used by /sbin/SuSEfirewall2 which
in turn is run by the startup scripts for the run levels. Can anyone
confirm this?
Based on all this, is what I'm suspecting (at least about networking)
true?: All distributions use pretty much the same executables to
accomplish their tasks, it's just where and how they decide to script
them which is different.
More information about the Discuss
mailing list