LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 08-01-2011, 04:21 PM   #1
pgb205
Member
 
Registered: Nov 2007
Posts: 109

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 GATEWAY=xxx.xxx.xxx.xxx 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?

thanks
 
Old 08-01-2011, 04:42 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,790

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
@ 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 192.168.1.10 and you have set up the gateway to be 192.168.1.1. That means this ethernet device will use 192.168.1.1 to be the gateway. And the second NIC is configured with IP 172.16.1.10 and you have set up the gateway 172.16.1.1 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
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 876

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.
 
  


Reply

Tags
gateway


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


All times are GMT -5. The time now is 06:51 PM.

Main Menu
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