5

I am using RHEL6, but I could not find the Ethernet interface configuration file ifcfg-eth0 under /etc/sysconfig/network-scripts. Issuing ifconfig -a shows that eth0 does exist. Could it be that the configuration file is hidden or saved in some other directory? If not, could I create such a file in the default directory(i.e., /etc/sysconfig/network-scripts) so that it would serve as the default configuration file?

3 Answers 3

4

You could find an example in /usr/share/doc*/initscript*, can't remember the exact name, but I'll provide a comprehensive example here:

All fields are fairly easy to understand

DEVICE=eth0 
BOOTPROTO=none 
ONBOOT=yes 
NETWORK=10.0.1.0 
NETMASK=255.255.255.0 
IPADDR=10.0.1.27 

Docs here

3
  • Sorry, but do you mean that I can create that ifcfg-eth0 file myself? Do you know why the default file is missing? Thank you.
    – xczzhh
    Oct 26, 2012 at 2:36
  • @xczzhh just create one, no idea why it's missing
    – daisy
    Oct 26, 2012 at 2:45
  • Agreeing that you could just create the file. On two CentOS 6 machines I checked (which should be similar enough to RHEL6 where it counts), both already have /etc/sysconfig/network-scripts/ifcfg-eth0, just like previous RHEL5/CentOS5. Oct 26, 2012 at 5:57
0

Corresponding directory to /etc/sysconfig/network-scripts in Ubuntu is /usr/share/initramfs-tools/scripts/ The details of the configuration procedures can be seen in the procedure configure_networking() script inside /usr/share/initramfs-tools/scripts/functions

-4

I haven't managed a RHEL6 machine before, but usually on Linux, network interfaces are configured in the interfaces file. I'm speaking from experience on Debian and Ubuntu boxes, where man interfaces explains the syntax and mentions a default file location of /etc/network/interfaces. Is this the same as on Red Hat?

2
  • 4
    The configuration file of network interfaces for redhat linux is not the same as that for Ubuntu, and there is no such a directory as /etc/network/interfaces in RHEL6. Thank you anyways :)
    – xczzhh
    Oct 25, 2012 at 15:06
  • 1
    The /etc/network/interfaces file is used by ifupdown, which is specific to Debian and derivatives of Debian.
    – jordanm
    Oct 25, 2012 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .