Ubuntu Server is a special addition, slightly different from Ubuntu Desktop, to make it easier to install on servers. Ubuntu tools are alternatives to many types of licensed products. The word “Ubuntu” comes from a South African term for coming together and sharing.

Ubuntu Server differs from other servers in that it uses a character-based interface for installation. This allows for more customization by the user, as well as support for different platforms such as Microsoft Hyper-V and VMware ESX Server. To configure the network on Ubuntu servers, follow these steps: ..

Steps to Configure Networking on Ubuntu Servers

Set/change an IP address

Network configuration from the command line

To set your IP address on Ubuntu, you can use the following terminal commands:

  1. open a new terminal window and type “ip addr”
  2. The output will show you your current IP address.
  3. To change your IP address, type “ip addr -a” and press enter.

netstat -I Step 2: use the grep command to find the port number. grep -i “^5$” /etc/services

sudo ip route add default via 192.168.1.1 dev eth0 sudo ip route add default via 192.168.2.1 dev eth0 ..

Network configuration using the GUI

Step 2: In the Open Definitions window, type in the following command and press Enter: sudo ifconfig eth0 192.168.1.1 Step 3: You should now be able to access the internet through your Ubuntu computer by typing in the following address into a web browser: http://192.168.1.1 ..

In the IPv4 tab, you can select the radio Automatic (DHCP) button to allow the system to dynamically obtain the IP address.

If you want to set a static IP address, click on the radio Manual button. Enter the IP address, subnet mask and a default gateway. Then click Apply to save the current changes.

Configure the network by editing the /etc/interfaces file

To dynamically set the IP address, you need to edit /etc/network/interfaces. The basic interface configuration is stored in /etc/network/interfaces.

sudo nano /etc/network/interfaces Step 2: In the file, uncomment the line that reads “iface eth0 inet dhcp” and delete the “;” at the end of the line. #iface eth0 inet dhcp Step 3: Save and close the file. To edit /etc/network/interfaces typing the following command in terminal. sudo nano /etc/network/interfaces In this file you will need to uncomment one line and delete a semicolon at the end of it. After you have done this your network interface will be set to DHCP. If you would like to keep your current settings then simply leave this line uncommented. #iface eth0 inet dhcp Save and close the file after making your changes. ..

After the step 2, you will need to do the following:

  1. Add a new line at the end of your file.
  2. Change the text to reflect what you have just done.

netstat -an | grep “inet” Step 4: Check the status of the inet service using the command below. netstat -an | grep “inet” If the inet service is not running, then it can be restarted by using the following command.

Edit /etc/network/interfaces and add the following line to it: auto eth0 iface eth0 inet static address 10.0.1.1 netmask 255.255.255.0 This will set your static IP address to 10.0.1.1, which is the same as your network’s primary IP address (10.0.1).

auto lo iface lo inet loopback auto eth0 iface eth0 inet static auto wlan0 iface wlan0 inet static Add the following lines to /etc/network/interfaces to enable the wireless network: auto lo iface lo inet loopback auto eth0 iface eth0 inet static auto wlan0 iface wlan0 inet static ..

Save the file and restart network services.

Context up/Change hostname

Ubuntu is a Linux operating system that uses the hostname “ubuntu” to identify itself. This file is located in the /etc/hosts file and contains the hostname of the Ubuntu computer.

hostname Step 2: For editing /etc/issue, type the command below: edit /etc/issue

This file contains only the host name of the file, change the name and save it.

Editing the /etc/hosts file

The Hosts file is a text file that maps hostnames to IP addresses. For example, if you have a server on your local network, you can map its IP address to a name in the Hosts file. This will allow you to access the machine with a name instead of the IP address. ..

sudo nano /etc/hosts Step 2: In the file, add the following lines: 127.0.0.1 localhost localhost www.example.com www.example.com www2 Step 3: Save the file and close it by typing:

192.168.1.10 192.168.1.11

To save the file and restart the system, you can use the following steps:

  1. Open a command prompt and type “cmd” followed by “save”.
  2. The cmd prompt will open and you will be able to type “restart” to start the system and apply the changes.

Final Words

To Configure Networking on Ubuntu Servers, we recommend reading our guide on Ethernet interfaces, IP addressing, bridging, and name resolution.