The contents are similar, why the need for two files?


The file /etc/sysconfig/network typically contains general information about networking on the system. Should interfaces even be activated? Which ones? What is the primary interface? What is this system's name and identity?

The other file you mention, /etc/sysconfig/network-scripts/ifcfg-eth0 is specific to the first ethernet interface, known in the linux world as eth0, and has details about whether to use DHCP or assign an IP address, whether THAT interface should be activated on boot, and so on. You will find one of these files for each interface on the system. Laptops for example often have wlan0 as a wireless ethernet devices, and many systems with multiple network cards will keep going with eth1, eth2 etc.

  • How does linux know which network device to use? – yum Apr 15 '11 at 11:10
  • That's what routes are about. Routes define what interfaces to use to contact which addresses. You can see your route table by typing ip route on most unix systems. The interface that get's the default route is probably defined by your network config file mentioned above with an options such as GATEWAYDEV. Most other routes are built off of the ip and subnet data in the individual interface config files also mentioned above. Special routes can be added by hand or by other init files. – Caleb Apr 15 '11 at 11:14
  • How to udnerstand the output of ip route above? – yum Apr 15 '11 at 11:16
  • Your questions are wandering past the scope of a Question and Answer site for system and network administrators. If you have a specific questions, ask them as new questions. Otherwise I suggest you review some tutorials on linux networking such as tldp.org/LDP/nag2/index.html. – Caleb Apr 15 '11 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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