Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-01-2011, 04:21 PM   #1
Registered: Nov 2007
Posts: 123

Rep: Reputation: 15
Duplicate GATEWAY statements, OK?

I've been looking through ifcfg-ethX files on some of the servers and see that for a few I have statement in a few of them. I don't believe that's normal as upon reboot I will end up with duplicate GATEWAYS. Is this a correct statement that there should be only single GATEWAY= across all ifcfg-ethX files?

Old 08-01-2011, 04:42 PM   #2
Senior Member
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

Are you trying to say that you have different GATEWAY set different ifcfg-ethX files. If that is the case then it could be normal if you have different IPs set on those NICs and you want them to use different gateway to communicate. Example:

If you have two NICs and ifcfg-eth0 configured with IP and you have set up the gateway to be That means this ethernet device will use to be the gateway. And the second NIC is configured with IP and you have set up the gateway then it is quite normal in case you have different gateway configured for them. If you are using forwarding/NATing and you have single gateway the above configuration will become false. Then you have to set the same gateway for both of them.

If you are trying to say that you have same GATEWAY set for different ifcfg-ethX files then also it can be true. Just vice-versa of above example.
Old 08-02-2011, 02:08 PM   #3
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 877

Rep: Reputation: 184Reputation: 184
You can have multiple GATEWAYS. A gateway is an IP router that provides access to remote networks. You can have a route to network 1 via GATEWAY1 and a route to network 2 via GATEWAY2. Not a problem.

A DEFAULT-GATEWAY is what it says, the last ditch attempt to get rid of packets for which there is no other route table match. Therefore you only get one. You can configure multiple DEFAULT-GATEWAYS but your system will typically use a set of criteria to pick one of them and stick with it.

So make sure you know which one you are referring to.



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
does tar or bzip2 squash duplicate or near-duplicate files? garydale Linux - Software 6 11-19-2009 04:43 PM
if else statements 0.o Programming 7 09-27-2005 02:59 PM
if statements and case statements not working in bourne shell script mparkhurs Programming 3 06-12-2004 02:41 AM
if statements thesnaggle Linux - Software 1 02-16-2004 09:52 AM
if then statements vapor Programming 4 07-16-2003 06:44 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:02 AM.

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