LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 11-01-2007, 07:04 AM   #1
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
GATEWAY in ifcfg-eth0, does it have a purpose?


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.

any comments would be welcome
 
Old 11-01-2007, 07:10 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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: Reputation: 61
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.

Brian
 
Old 11-02-2007, 03:02 PM   #3
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Question

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.

Steve.
 
Old 11-03-2007, 11:23 AM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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: Reputation: 61
Need to see those related files contents to try to make sense as to what you have setup already.

Brian
 
Old 11-04-2007, 03:04 PM   #5
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for the reply,

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.

An example ifconfig-eth0 file is below.

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETWORK=10.0.1.0
NETMASK=255.255.255.0
IPADDR=10.0.1.27
GATEWAY=10.0.1.1
USERCTL=no
 
Old 11-04-2007, 04:51 PM   #6
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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: Reputation: 61
bond inteface may not even use any thing but a few lines like described here for channel bonding on the same network class.
http://www.redhat.com/docs/manuals/e...NTERFACES-CHAN

Brian
 
Old 11-04-2007, 05:38 PM   #7
edclancy7715
LQ Newbie
 
Registered: Nov 2007
Location: Murder mitten
Posts: 13

Rep: Reputation: 0
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...
 
Old 11-04-2007, 05:57 PM   #8
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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: Reputation: 61
Out of ideas.

brian
 
Old 11-04-2007, 10:55 PM   #9
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Brian, thanks for the link.. I'll take a look

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!
 
Old 11-04-2007, 11:01 PM   #10
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
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.

For me, the settings is not picked up.
 
Old 11-05-2007, 04:21 AM   #11
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
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.
 
Old 11-05-2007, 11:02 AM   #12
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
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
 
Old 11-05-2007, 11:05 AM   #13
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
cutoff.... But as you suggest.... and look at the ifup script.. and maybe I will be able to post my own answer.
 
Old 11-05-2007, 01:33 PM   #14
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
1) no there is no point as the more conventional place it the /etc/sysconfig/network script as i already said.

2) the ifup script reads it, as i also already said.
 
Old 11-05-2007, 02:14 PM   #15
darwinianlo
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Chris,

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.

thanks anyway.
have a nice day.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fedora/redhat: ifcfg-eth0 and ifcfg-eth1 Shaun2222 Linux - Networking 9 01-23-2008 04:25 PM
Questions about ifcfg-eth0 file veeruk101 Linux - Networking 2 07-23-2007 08:08 PM
ifcfg-eth0 and link problem shipon_97 Linux - Newbie 1 05-26-2007 08:28 AM
eth0 not coming up at bootup even when configured in ifcfg-eth0 djcham Linux - Networking 1 12-04-2006 09:09 PM
editing ifcfg-eth0 nkeever Linux - Newbie 4 05-05-2005 03:46 PM


All times are GMT -5. The time now is 03:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration