LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-14-2015, 08:24 AM   #1
hnasr2001
Member
 
Registered: Nov 2012
Posts: 98

Rep: Reputation: Disabled
ifcfg-eth0


do I have to have a file name ifcfg-eth0 in the /etc/sysconfig/network-scripts directory to configure the eth0 port? or the file name can be anything as long as the content refers to eth0?

Last edited by hnasr2001; 12-14-2015 at 08:27 AM.
 
Old 12-14-2015, 09:47 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
RHEL 7 documentation says that it should be called ifcfg-eth0, but I would say it depends on the distro and the release. Try it out.
 
Old 12-14-2015, 11:16 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
If you are still running CentOS 6. then yes as stated it has to be called ifcfg-eth0. The scripts that actually configure the network device search for file names ifcfg-* where * is the ethernet device i.e. eth0 etc.
 
Old 12-14-2015, 04:10 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
We'd have to have the exact distro and version. Things are changing a bit towards the BSD style naming so you may have to watch out for changes.

From Red Hat 7 docs.

"
Static Network Settings
To configure an interface with static network settings using ifcfg files, for an interface with the name eth0, create a file with name ifcfg-eth0 in the /etc/sysconfig/network-scripts/ directory as follows:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
PREFIX=24
IPADDR=10.0.1.27

Optionally specify the hardware or MAC address using the HWADDR directive. Note that this may influence the device naming procedure as explained in Chapter 8, Consistent Network Device Naming. You do not need to specify the network or broadcast address as this is calculated automatically by ipcalc.
 
  


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
[SOLVED] ifcfg eth0 is not up sachin.davra Linux - Newbie 2 08-04-2014 04:55 AM
I deleted the Eth0 configuration information from vim ifcfg eth0. How to retrieve it? godwin.a Linux - Newbie 1 02-08-2014 02:58 AM
[SOLVED] Network eth0 activated upon boot in ifcfg-eth0; but no network connection after login TomRaaijmakers Linux - Networking 1 06-17-2010 08:29 AM
fedora/redhat: ifcfg-eth0 and ifcfg-eth1 Shaun2222 Linux - Networking 9 01-23-2008 03:25 PM
eth0 not coming up at bootup even when configured in ifcfg-eth0 djcham Linux - Networking 1 12-04-2006 08:09 PM

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

All times are GMT -5. The time now is 02:15 PM.

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