Monday, December 19, 2016

Configuring Network II

Installing the Ethernet Board


Obviously, the first thing you need to do when configuring an Ethernet
interface is to install the NIC hardware in the system. To do this,
complete the following:


1. Power off your system.

2. Install your Ethernet board in an available expansion slot.

3. Connect the Ethernet board to your network switch or hub with the
appropriate drop  cable.

4. Power your system back on. If you installed a modern Ethernet
board, your Linux operating system will probably detect it as it boots
and automatically load the required kernel modules. If not, you may
have to download the appropriate module from the board manufacturer’s
website and load it manually.




After the system has booted, you should check your module
configuration file and verify that the appropriate kernel module has
been loaded and that an alias has been created for the new board. The
file to check depends on your distribution. Some distributions use the


/etc/modprobe.conf or /etc/modules.conf 

file, whereas others use a configuration file in /etc/modprobe.d. For example,
my openSUSE system (which is installed in a VMware virtual machine) uses the /etc/
modprobe.d/50-vmnics.conf file, as shown in Figure 15-9.




The alias used for your network interface will depend on your
distribution. Older distributions that use init will assign the
Ethernet adapters in your Linux system the following aliases:


eth0  The first Ethernet adapter in your system

eth1  The second Ethernet adapter in your system

eth2  The third Ethernet adapter in your system, and so on...





Newer distributions that use systemd no longer use these aliases. They
worked great, unless you happened to have multiple network adapters in
the system. Occasionally, we saw situations where interface aliases
got swapped between network adapters. For example, a given interface
could be eth0 on one boot, but end up being assigned eth1 on the next
boot. As you can imagine, this situation could really mess up your
network services, routing tables, and firewall rules.


To address this issue, systemd uses predictable network interface
names. One of the key benefits of doing this is the fact that specific
aliases can be permanently assigned to specific network interfaces.
Predictable network interface device names are assigned based on one
of the following parameters. The preferred order is as follows:




For an onboard network adapter, the index number provided by the
system firmware (or BIOS) is used to construct the alias. A commonly
assigned alias created using this parameter is eno1. The elements of
this name are as follows:


   • en Ethernet interface

   • o1 Onboard device index number (in this case, device number 1)




• If the network adapter is plugged into a PCI-E hot-plug slot instead
of being integrated into the motherboard, then systemd will use the
index number of the slot itself, as provided by the firmware (or
BIOS), to construct the alias. A commonly assigned alias created using
this parameter is ens1. The elements of this name are as follows:


  • en Ethernet interface
  • s1 Hot-plug slot index number (in this case, slot number 1)




If the preceding options are not applicable, then systemd will try
to construct an alias using the name of the physical connector the
interface is connected to, such as a USB connector. A commonly
assigned alias created using this parameter is enp2s0. The elements of
this name are as follows:


  • en Ethernet interface
  • p2 Bus number (in this case, USB bus number 2)
  • s0 Slot number on the bus (in this case, slot number 0)





If all else fails, then systemd will try to use the interface’s MAC
address to construct an alias. The format is enx followed by the MAC
address.





Notice in the preceding list that every sample interface name started
with en. That’s because we’re assuming you are working with standard
Ethernet interfaces. Other types of interfaces use different naming
conventions:


en  Used for Ethernet adapters
sl  Used for serial line IP interfaces
wl  Used for WLAN interfaces




At this point, your network interface is loaded and active. However,
before you can use it, you have to configure it with the IP protocol.
Let’s discuss how this is done next.







LX0-104 Exam Objectives (S)





No comments:

Post a Comment