Debian OS: Network Setup

The Linux-based Debian operating system is one of the most specific systems. The fact is that for the average user it creates many problems, and the main reason for this is the need for manual configuration of many components. This article will discuss how to configure a network in Debian 8 GNOME. But immediately it is worth making a remark, saying that the instruction will be equally suitable for other versions of this distribution. As for the graphical shell, there will be discrepancies only in those parts of the text where the graphical interface is involved, and everything is done the same through the console.

Foreword

First, it is worth highlighting some aspects. Firstly, there are different protocols that network providers work with. Of these, the most wired connection, PPPOE and DIAL-UP can be distinguished, by the way, the article will focus only on the wired connection, since it is the most common. Secondly, in Debian there are two ways to configure it - using the graphical interface and using the "Terminal". It will be told about two, so everyone will be able to choose the right one for themselves.

Nor can we ignore the fact that many factors influence the correct network setup in Debian. Therefore, if at the end of all the instructions you did not achieve the desired result, then the problem is something else. By the way, if you are just going to switch to Debian and use Windows for now, you are advised to try to configure the Debian network in VirtualBox.

Wired Setup

If you use a wired connection, then the good news is for you, firstly, it is easier to set it up an order of magnitude than the others, and secondly, there are three ways to do this, and it will be discussed now.

Method 1: Through the "Terminal"

debian network setup

First you need to say that we will configure the Debian network from the console, that is, the β€œTerminal”, the fact is that it is more convenient, and more universal, if we take into account the fact that the interface is different in different graphical shells. First, consider the situation when you have a dynamic IP address.

Dynamic IP Setup

So, to start, open the "Terminal". You can do this by clicking the "Browse" button and searching the system with the query of the same name. Then open the "interfaces" configuration file. To do this, run the following command:

sudo nano /etc/network/interfaces

In the text editor that opens, write two lines:

  1. auto < >
  2. iface < > inet dhcp
You can find out the name of the adapter by executing the command β€œ ip address ” (without quotes) in the β€œTerminal”.
debian 8 network setup

Also pay attention to whether your DNS server is automatically registered for you, if not, then write it to this file in the following format:

nameserver <>

Now you need to save all the adjustments. Do this by pressing Ctrl + O, and then close the editor by pressing Ctrl + X.

The network setup in Debian with dynamic IP is over, now let's move on to static.

Static IP Setting

Setting up a static IP address is a little different, the main difference is that you need to enter more variables into the "interfaces" file. So let's get started. First, open the configuration file, as described above. Enter the lines shown in the image below.

virtualbox debian network setup

At this stage, it is worth explaining that:

  • The third line is the ethernet port address.
  • The fourth line is the subnet mask.
  • The fifth line is the gateway address.
  • The sixth line is the DNS server.

Having specified all the necessary parameters, save the document and close the text editor. It is also recommended that you restart the computer network, you can do this using the following command:

sudo systemctl restart networking

Now you know how to configure a network with a static IP in Debian 8, but in the meantime we’ll move on to the second method of setting up a wired network.

Method 2: Network Manager

debian 7 network setup

This method is different in that a program with a graphical interface will be used to configure the network in Debian - this will greatly facilitate the life of inexperienced users. Before proceeding to the analysis of this method, it is worth explaining how to start Neywork Manager in Debian, and for this you need to open a special window that is called by pressing Alt + F2 and execute the command " nm-connection-editor ".

Dynamic IP Setup

So, having opened the application window, you first of all need to create a new connection. For this:

  1. Click the Add button, then select the Ethernet connection type from the list and click Create.
  2. After that, open the "Ethernet" tab and select the name of your adapter in the "Device" field. It is also recommended that you select "Ignore" from the "Link negotation" list.
  3. Click the IPv4 Settings tab.
  4. On it, with dynamic IP, you must select the item "Automatic" from the first list.
  5. However, it would be possible to finish the configuration by saving all the changes, but it is worth paying attention to the fact that if your DNS servers are not registered automatically, you need to enter them manually in the input field of the same name.

This is how the network setup is done in Debian 8.3 with dynamic IP. By the way, you can also go to the "General" tab and check "Connect automatically" so that when the computer starts, the system automatically establishes a connection to the Internet.

Static IP Setting

Connection with static IP is configured a little differently. In the beginning, you also need to run Network Manager and create an Ethernet connection. On the same name tab, you just need to select a network adapter, but on the IPv4 Settings tab, the instructions will differ. So, let's go directly to it:

  1. From the first drop-down list, select "Manual".
  2. Click the Add button, which is located in the Addresses area.
  3. The table of the same name will become active. In it you need to register the address of your adapter, subnet mask, and also the gateway. After that, press Enter.
  4. A static IP DNS server is not automatically set, so specify them in the corresponding line below.
  5. After entering all the necessary parameters, click the "Save" button.
debian 8 3 network setup

After that, restart the computer to make the Internet connection work properly.

Note: you can find out all the necessary data, such as a subnet mask or a gateway from the service provider - contact the provider's office for help.

Method 3: Network Utility

debian network setup from the console

By default, the "Network" utility is installed in Debian - it is she who is responsible for setting up the network in Debian 7 and 8. Now we will give instructions on how to use it, but first we will start the "Network".

  1. Click on the network indicator, which is located in the upper right part of the desktop.
  2. From the menu that appears, select "Wired Settings."
  3. In the "All settings" window that opens, in the "Equipment" category, select the "Network" element.

The utility is running and you can go directly to the connection setup.

Dynamic IP Setup

As in previous times, setting up a dynamic IP is quite simple, you need:

  1. Turn the network activation switch to the on position. It is located in the upper right part and to enable it, just click once with the left mouse button.
  2. Click on the button with the image of the gear located in the lower right corner of the window.
  3. In the window that appears, go to the "Identification" section, enter the name of the new connection (arbitrary) and select any MAC address.
  4. Go to the "IPv4" section, enable this network mode by clicking on the switch of the same name, and select "Automatic" from the "Addresses" list.
  5. You can also manually set the DNS by disabling its automatic receipt and entering the server code in the corresponding field.
  6. Click "Apply"

After that, the settings window can be closed - the network must be installed. If this does not happen, then most likely you need to restart the computer.

Static IP Setting

To configure an Internet connection with a static IP, you need to complete the first three points of the previous list, and then do the following:

  1. Go to the IPv4 section.
  2. Enable this mode.
  3. Select "Manually" from the "Addresses" list.
  4. Fill in the appropriate form by entering the network interface address, network mask and gateway.
  5. Specify the DNS server in the corresponding field.
  6. Click the "Apply" button.
debian 8 gnome network setup

This is how simple it is to set up a Debian network in the Network utility. As a result, you may need to restart your computer for all changes to take effect.

Conclusion

You learned about three ways to configure a wired connection in the Debian operating system. Each method is good in its own way, for example, using the first method, you can make more flexible settings for all network parameters, and the other two methods will make it easier for you to achieve your goal, since working in the graphical interface is much easier than in the "Terminal".

Source: https://habr.com/ru/post/K8312/


All Articles