network.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <sect1 id="ch07-network">
  2. <title>Configuring the network script</title>
  3. <?dbhtml filename="network.html" dir="chapter07"?>
  4. <para>This section only applies if you're going to configure a network
  5. card.</para>
  6. <para>If you don't have any network cards, you are most likely not going to
  7. create any configuration files relating to network cards. If that is the
  8. case, you must remove the <filename>network</filename> symlinks from all the
  9. runlevel directories
  10. (<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>
  11. <sect2>
  12. <title>Configuring default gateway</title>
  13. <para>If you're on a network you may need to set up the default gateway for
  14. this machine. This is done by adding the proper values to the
  15. /etc/sysconfig/network file by running the following:</para>
  16. <para><screen><userinput>cat &gt;&gt; /etc/sysconfig/network &lt;&lt; "EOF"</userinput>
  17. GATEWAY=192.168.1.2
  18. GATEWAY_IF=eth0
  19. <userinput>EOF</userinput></screen></para>
  20. <para>The values for GATEWAY and GATEWAY_IF need to be changed to match
  21. your network setup. GATEWAY contains the IP address of the default
  22. gateway, and GATEWAY_IF contains the network interface through which the
  23. default gateway can be reached.</para>
  24. </sect2>
  25. <sect2>
  26. <title>Creating network interface configuration files</title>
  27. <para>Which interfaces are brought up and down by the network script depends on
  28. the files in the /etc/sysconfig/network-devices directory. This
  29. directory should contain files in the form of ifconfig.xyz, where xyz is a
  30. network interface name (such as eth0 or eth0:1)</para>
  31. <para>If you decide to rename or move this /etc/sysconfig/network-devices
  32. directory, make sure you update the /etc/sysconfig/rc file as well and
  33. update the network_devices by providing it with the new path.</para>
  34. <para>Now, new files are created in that directory containing the following.
  35. The following command creates a sample ifconfig.eth0 file:</para>
  36. <para><screen><userinput>cat &gt; /etc/sysconfig/network-devices/ifconfig.eth0 &lt;&lt; "EOF"</userinput>
  37. ONBOOT=yes
  38. IP=192.168.1.1
  39. NETMASK=255.255.255.0
  40. BROADCAST=192.168.1.255
  41. <userinput>EOF</userinput></screen></para>
  42. <para>Of course, the values of those variables have to be changed
  43. in every file to match the proper setup. If the ONBOOT variable is set
  44. to yes, the network script will bring it up during boot up of the system.
  45. If set to anything else but yes it will be ignored by the network script
  46. and thus not brought up.</para>
  47. </sect2>
  48. </sect1>