Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm wondering what is the purpose of the GATEWAY entries in the ifcfg-xxx files as they don't seem to be used to add any gateway or route either after a network restart or a reboot.(using REDHAT ES4)
I have added GATEWAY entries to ifcfg-bond0, ifconfig-bond0:0 etc... but these entries don't seem to be used, as per netstat -rn output. In order to apply a persistent gateway I added a static route to the rc.local and a default gateway to the /etc/sysconfig/network file.
1) rc.local requires a reboot
2) whereas the network file addition just requires a network service restart.
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700
Rep:
I would post the info pretaining to the eth0 bond0 bond0:0 items and anything else in there related to ifcfg-xxxx. Now not sure on gateway on the bond stuff. gateway unless routing commands are enabled it is best to have only one file use the gateway option. Like in masquerading I set the Internet nic with gateway and for the lan nic I only set IP and subnet. Setting gateway on the lan interfaces causes problems. IP masquerading handles this routing for you this way.
Thanks for the reply but I'm not sure I understand the answer to the GATEWAY issue.
If I add "GATEWAY=192.62.108.1"
then restart network service or even reboot, there is no gateway listed in netstat -rn output.
So I'm wondering what is missing, or why put the GATEWAY parameter in the file at all. Surely I must be missing some configuration or script that reads/loads the gateway form the ifcfg-eth0 file.
PS. I remedy this by adding a default gateway to the /etc/sysconfig/network file or a static route. But I'm puzzled over the purpose of the gateway setting in the ifcfg... file.
Actually my question is more general as I HAVE ALREADY added a gateway and static route via the 'network' file and the 'rc.local' file, but I don't know what script should NORMALLY pick up the GATEWAY from the ifconfig-eth0 file. (in general). This setting seems to have no purpose on systems I have looked at. I think there must be a script somewhere that SHOULD read the GATEWAY FOR THE interface and call a 'route add' command in a shell.
I too have noticed that, but I am aware that it DOES make a difference. No GATEWAY = packets don't know where there next hop is. They really should implement a feature that allows you to change your gateway via the command line like just about every other interface option...
Hi edclancy7715, I'm not talking about the PURPOSE of a gateway per se, actually I am talking about whether or not the line 'GATEWAY=' is read/used by any script.
If I add this line GATEWAY=XX.XX.XX.XX in any of the installations I have access to then restart network/or reboot!!, calling 'netstat -rn' there is NO GATEWAY for any routes, so the setting is NOT USED to configure the interface!
Maybe it is just my installations, but if anyone can please confirm on their own installation. If they add the line:
GATEWAY=XX.XX.XX.XX to their ifconfig-eth0 file, restart network, is there a gateway listed in their 'netstat -rn' output.
there is certainly no *point* in putting that line in there, as it's the /etc/sysconfig/network file that holds the system wide gateway. it's the /sbin/ifup scripts which processes this, and it suggests it is going to use that if there is no other one in a better location. just read that scritp and answer your own question i guess.
Chris,
you said: "there is certainly no *point* in putting that line in there, as it's the /etc/sysconfig/network file that holds the system wide gateway."
1) well actually there is a *point* as I said and IN FACT you said yourself(I AM defining a default gateway!!)
which is what you say in your next sentence..
2) well my question is NOT about this network file...AT ALL
... my question is WHAT reads the GATEWAY line from the ifconfig-eth0 file.. because if I define a gateway in this file, NOTHING seems to read it... as per output of netstat -rn. (and others have told me similar things)
thankyou to yourself and others for your comments. But I've tried to explain and re-explain the question.. it seems no-one understands what I'm asking...that's ok.... I guess I'll work it out
There are 3 of us reading this post and we all thought that with "'in there' and 'it'" you were saying it is no point to put the GATEWAY in (there) = ""../network file'.""
My question doesn't relate to 'convention' but I think it's best just to drop the issue, because we seem to be getting confused here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.