Today we will talk about howconfiguring the Ubuntu network. This operating system has several graphical tools for similar work. Particular attention should also be given to managing the network using the command line.
Ethernet Interfaces
First of all, the configuration of the Ubuntu network concernswork with this technology. The Ethernet interfaces in the system are designated as ethX. In this case, X is a certain number. Typically, the first Ethernet interface is denoted eth0. The number of all subsequent ones increases by one. To quickly identify all available network interfaces, you can use the ifconfig command.
There is also an alternative. Another application that can help identify the available network interfaces is the lshw command. In Ubuntu, configuring the network from the console with this solution allows you to find the connection number, bus information, driver information, and a list of supported features. The logical names of the required interfaces can be specified in the net.rules file.
We proceed to the next stage. If you need to know which of the interfaces will receive a logical name, we find the string that corresponds to the physical MAC address of this element. Change the value of NAME = ethX. Specify the required logical name. We overload the system to apply the changes. There is a special program Ethtool, which changes and displays the settings of the network card, among which the function Wake-on-LAN, duplex mode, port speed and auto-negotiation. This tool is not installed initially, but it is available in repositories. Changes made with the Ethtool command are temporary. They will be canceled after the system is rebooted. In case you need to save these settings, add the appropriate Ethtool command, adding it to the pre-up file of the interfaces file. The described solution works not only with static interfaces, but also with other options, for example, DHCP.
IP addressing
The next step is to configure the Ubuntu network directlyis associated with the parameters of the IP-computer, as well as the gateway. This step is necessary for organizing a local connection, as well as accessing the Internet. To make temporary setup of the network, we use the standard commands: route, ifconfig and ip. These solutions will change the parameters with their instant application. However, the settings in this case will be canceled after the reboot. If you need DNS values for the temporary configuration, add the server's IP addresses to the resolv.conf file. Usually, editing this material is not recommended, but this is acceptable in case of a temporary configuration. If the parameters are no longer needed, cancel all interface settings using the ip command with the flush extension. Resetting the configuration using the described method does not clean the contents of resolv.conf. To achieve this, we delete or manually modify the corresponding records. You can also reboot, thus resolv.conf will be overwritten.
DHCP Client
Next, we have to configure the Ubuntu Server network. In order to configure the server to work with DHCP and provide dynamic address assignment, add the appropriate method to the inet address section for the necessary interface in the interfaces element. Next, use the ifup command. It will enable the interface manually and activate DHCP via dhclient. We proceed to the next stage. If at some point the Ubuntu Server network configuration requires you to manually disable the interface, use the ifdown command. It will start the process of stopping the item and releasing DHCP.
Permanent appointment
Now we'll discuss how to configure the networkUbuntu in the case of a static IP address. We add the static method to the inet section for a specific interface in the interfaces element. You can also use the ifup command. It allows you to enable the interface manually. To deactivate it, you can use the ifdown command. A special loopback interface is defined by the system as lo. By default, it sets the following address value 127.0.0.1. It can be displayed with the ifconfig command. Initially, there are two lines in the interfaces element that are responsible for setting the loopback in automatic mode. We leave these parameters in the original form, until there are specific reasons for their correction. The next step is to determine the IP address based on the host name. Thus, you can simplify the identification of the resource.
So we figured out how to configure the network in Ubuntu 14. 04. This manual is also suitable for other versions of the specified operating system.
</ p>