{"id":537,"date":"2009-02-08T14:02:00","date_gmt":"2009-02-08T18:02:00","guid":{"rendered":"http:\/\/www.databook.bz\/?page_id=537"},"modified":"2009-07-28T15:24:16","modified_gmt":"2009-07-28T19:24:16","slug":"network-manager","status":"publish","type":"page","link":"http:\/\/www.linux-databook.info\/?page_id=537","title":{"rendered":"Network Manager"},"content":{"rendered":"<p>Red Hat introduced the <a title=\"Wikipedia - Network Manager\" href=\"http:\/\/en.wikipedia.org\/wiki\/NetworkManager\" target=\"_blank\">Network Manager<\/a> in 2004 as a way to simplify and automate network configuration and connections.<\/p>\n<p>Although it would seem to make network management better and easier for non-technical users, it requires some adjustment by the Linux administrator because many of the configuration functions we have been familiar with are now handled by a new layer of configuration files and scripts. This means that the standard configuration files that we modify in order to manually manage networking are subject to being overwritten by the Network Manager every time the network is restarted, including every reboot.<\/p>\n<p>Fedora 10, and perhaps Fedora 9 as I did not use it, have some interesting changes to how networking is configured and its relationship with <a title=\"Wikipedia - D-Bus\" href=\"http:\/\/en.wikipedia.org\/wiki\/D-Bus\" target=\"_blank\">D-Bus<\/a>, <a title=\"Wikipedia - HAL (Hardware Abstraction Layer)\" href=\"http:\/\/en.wikipedia.org\/wiki\/HAL_(software)\" target=\"_blank\">HAL<\/a> and <a title=\"Wikipedia - udev\" href=\"http:\/\/en.wikipedia.org\/wiki\/Udev\" target=\"_blank\">udev<\/a>. The udev daemon is a relatively new kernel device manager which allegedly provides consistent and persistent device naming for all devices including removable mass storage devices. It is also used to match network device names, i.e., eth0, to the <a title=\"Wikipedia - MAC address\" href=\"http:\/\/en.wikipedia.org\/wiki\/MAC_address\" target=\"_blank\">MAC address<\/a> on the NIC.<\/p>\n<h2>How it Works &#8211; Sort of<\/h2>\n<p>The udev device manager determines when a new device has been added to the system and creates a rules entry for it in the \/etc\/udev\/rules.d directory. It thus creates a relationship between the physical NIC based on the hardware MAC address and the logical name &#8220;eth0.&#8221; That relationship used to be defined solely by the \/etc\/sysconfig\/network-scripts\/ifcfg-eth0 file.<\/p>\n<p>The udev daemon creates and entry for each NIC installed in the system in\u00a0 the \/etc\/udev\/rules.d\/70-persistent-net.rules file. The Network Manager uses these entries, along with information in the ifcfg-ethX files in\u00a0 the \/etc\/sysconfig\/network-scripts\/ directory to initialize each NIC.<\/p>\n<h2>Name Resolution<\/h2>\n<p>The Network Manager also rewrites \/etc\/resolv.conf each time the network is restarted, whether by a reboot or by using the <strong><span style=\"font-family: courier new,courier;\">service network restart<\/span><\/strong> command. This can facilitate obtaining new DNS server IP addresses if the computer is moved between networks frequently, so it is very useful for laptops. It can cause issues for desktop computers that are more or less tethered to the same network at all times.<\/p>\n<p>Apparently, the network manager expects the name server information to be provided by a DHCP server and for static IP addresses and networks it rewrites the \/etc\/resolv.conf file with the following contents:<\/p>\n<blockquote><p><span style=\"font-family: courier new,courier;\"># Generated by NetworkManager<br \/>\nsearch both.org<br \/>\n# No nameservers found; try putting DNS servers into your<br \/>\n# ifcfg files in \/etc\/sysconfig\/network-scripts like so:<br \/>\n#<br \/>\n# DNS1=xxx.xxx.xxx.xxx<br \/>\n# DNS2=xxx.xxx.xxx.xxx<br \/>\n# DOMAIN=lab.foo.com bar.foo.com<\/span><\/p><\/blockquote>\n<p>At least that message tells you what you need to do to resolve the problem. To ensure that the correct entries are always added to the now dynamic resolv.conf file, be sure to add them to the ifcfg-ethX files as shown below.<\/p>\n<blockquote><p><span style=\"font-family: courier new,courier;\"># Intel Corporation 82566DC-2 Gigabit Network Connection<br \/>\nDEVICE=eth0<br \/>\nHWADDR=00:16:76:02:BA:DB<br \/>\nONBOOT=yes<br \/>\nIPADDR=192.168.0.10<br \/>\nBROADCAST=192.168.0.255<br \/>\nNETMASK=255.255.255.0<br \/>\nNETWORK=192.168.0.0<br \/>\nSEARCH=&#8221;both.org&#8221;<br \/>\nBOOTPROTO=none<br \/>\nGATEWAY=192.168.0.254<br \/>\n<strong>DNS1=192.168.0.254<br \/>\nDNS2=192.168.0.253<\/strong><br \/>\nTYPE=Ethernet<br \/>\nUSERCTL=no<br \/>\nIPV6INIT=no<\/span><\/p><\/blockquote>\n<p>This could be very handy if you have multiple NICs used for failover in a computer connected to multiple networks with different name servers. All you would need to do to recover from an outage on one network would be to take that NIC down and bring up the NIC in the backup network.<\/p>\n<p>The Network Manager can be turned off. Refer to the page <a title=\"Disable Network Manager\" href=\"http:\/\/www.linux-databook.info\/?page_id=749\">Disable Network Manager<\/a> for details.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Red Hat introduced the Network Manager in 2004 as a way to simplify and automate network configuration and connections. Although it would seem to make network management better and easier for non-technical users, it requires some adjustment by the Linux&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/www.linux-databook.info\/?page_id=537\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":247,"menu_order":7,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-537","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/pages\/537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=537"}],"version-history":[{"count":20,"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/pages\/537\/revisions"}],"predecessor-version":[{"id":1291,"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/pages\/537\/revisions\/1291"}],"up":[{"embeddable":true,"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=\/wp\/v2\/pages\/247"}],"wp:attachment":[{"href":"http:\/\/www.linux-databook.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}