ComputersNetworks

How to configure the Ubuntu network

Today we will talk about how to configure 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, setting up the Ubuntu network is about working with this technology. The Ethernet interfaces in the system are referred to 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.

Proceed to the next stage. If it is necessary to find out which of the interfaces receives a logical name, we find a 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 Wake-on-LAN function, 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 corresponding 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

At the next stage, the configuration of the Ubuntu network is directly related to 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 want 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 permissible in case of a temporary configuration. If the parameters are no longer required, 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, we add the appropriate method to the inet address section for the required interface in the interfaces element. Next, use the ifup command. It will enable the interface manually and activate DHCP via dhclient. 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 will discuss how to configure the Ubuntu network 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, 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.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.birmiss.com. Theme powered by WordPress.