Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

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

share|improve this answer
    
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 '12 at 2:36
    
@xczzhh just create one, no idea why it's missing –  warl0ck Oct 26 '12 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. –  Lars Rohrbach Oct 26 '12 at 5:57
add comment

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?

share|improve this answer
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 '12 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 '12 at 17:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.