LinuxQuestions.org
Visit Jeremy's Blog.
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 12-01-2005, 09:39 PM   #1
joshfields
LQ Newbie
 
Registered: May 2004
Posts: 16

Rep: Reputation: 0
gateway setting ./network-scripts/ifcfg-eth1 and ./network


What is the deal with having multiple places to change the gateway?

Please explain the difference in putting Gateway in the interface scripts and in the network file!

What happens if the network file GATEWAY is different than the scripts GATEWAY???



/etc/sysconfig/network-scripts/ifcfg-eth0
GATEWAY=aaa.aaa.aaa.aaa

/etc/sysconfig/network-scripts/ifcfg-eth1
GATEWAY=bbb.bbb.bbb.bbb

/etc/sysconfig/network
GATEWAY=ccc.ccc.ccc.ccc
 
Old 04-29-2012, 04:27 AM   #2
Soji Antony
Member
 
Registered: Jul 2010
Posts: 54

Rep: Reputation: 1
'/etc/sysconfig/network' file contains general information for all interfaces on your system. Like

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

However this file can be also used as a configuration file for eth0 [instead of ifcfg-eth0 when there is only one interface [NIC] on your system. For example you can remove the 'IPADDR' , 'NETMASK' & 'GATEWAY' entries from ifcfg-eth0 and add it to 'network' file

# cat /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
IPADDR=192.168.1.1
NETMASK=255.255.255.0
GATEWAY=192.168.1.20

After restarting the network, the above IP, netmask & gateway will be assigned to eth0.

But when you have more than one interface card, the individual interface card information's will be recorded in the file ifcfg-ethX in directory '/etc/sysconfig/network-scripts' instead. So if you have more than one NIC, then information for each NIC's will appear in separate files in the directory '/etc/sysconfig/network-scripts' with names of the form 'ifcfg-eth0' for eth0 'ifcfg-eth1' for eth1... etc
 
  


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 03:25 PM
what is "/etc/sysconfig/network-scripts/ifcfg-eth0" its counterpart in slackware b0nd Slackware 2 10-06-2005 12:50 AM
How to change /etc/sysconfig/network-scripts/ifcfg-eth0 ariana Linux - Networking 1 05-01-2005 01:37 PM
can anyone post their /etc/sysconfig/network-scripts/ifcfg-wlan0? Dooberdoink Linux - Wireless Networking 1 03-27-2005 09:49 AM
/etc/sysconfig/network-scripts/ifcfg-ra0 Not working anymore NssOne Linux - Wireless Networking 1 02-13-2004 09:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:45 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
Open Source Consulting | Domain Registration