How to do it...

In this section, we will see how we can manually configure the network settings using the command line:

  1. Before starting with the manual configuration, first, let's check our current IP address, which has been assigned to the system automatically by DHCP. We can check the details graphically by right-clicking on the networking icon on the top-right panel and then selecting Connection Information, as shown in the following screenshot:

We can see that the current IP address of our system is 192.168.1.101.

  1. Next, we check the same information using the command line by typing in the ifconfig command:

  1. If we want to just check the available Ethernet devices on the system, we can run the following command:

The preceding command will list a one-line description of all the available Ethernet devices on the system.

  1. If we want to get more detailed information about the network interface, we can use a tool called lshw, like so:

This command also gives detailed information about other capabilities of the hardware.

  1. Now, we will disable the Network Manager and then set the IP address details manually. To disable the Network Manager, edit the /etc/NetworkManager/NetworkManager.conf file, like so:

Change the line managed=false to managed=true and save the file.

  1. Now, open the /etc/network/interfaces file in any editor of your choice. We can see that, by default, there is no information regarding the eth0 interface:

  1. Edit the file and add the information shown in the following screenshot. Make sure to add the IP details according to your network settings:

When done, save the file and then reboot the computer to disengage the Network Manager.

  1. If you wish to create a virtual network adapter, you can add the following lines in the /etc/network/interfaces file, as follows:

By doing this, we have added two IP address to the single Ethernet card. We can do this to create multiple instances of the network card.

  1. Once you have completed editing, restart the networking service by using the following command:
    service network-manager restart

You can also use this command:

    /etc/init.d/networking restart
  1. Next, we can look at how to configure the appropriate nameserver to be used if the IP address is being configured manually.

To make changes, edit the /etc/resolv.conf file in any editor, and add the lines shown in the following screenshot:

Following the preceding steps, we will be able to configure the IP details successfully.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.219.166