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 Linux distributions in that it replaces a graphical user interface with a character-based interface for installation. This can be customized by the user. The system supports many different platforms, such as Microsoft Hyper-V and VMware ESX Server. To configure the network on Ubuntu servers, first make sure you have the necessary software installed. You can find this software on the Ubuntu server installation media or you can download it from the Ubuntu website. Once you have the software installed, open a terminal and type: netstat -a

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

iptables -A INPUT -i eth0 -j ACCEPT iptables -A INPUT -i eth1 -j ACCEPT

Network configuration using the GUI

Step 2: In the Network tab, you will see a list of interfaces. If you click on the interface’s name, it will open a window with more information about that interface. You can also right-click on an interface and select Properties to get more information about that interface.

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 configure the IP address on a computer, you can use one of the following methods:

  1. Edit /etc/network/interfaces and set the IP address using the dhcpcd command.
  2. Use the ifconfig command to view and change the network interface’s configuration. ..

netstat -a | grep eth0 Step 2: To add the eth0 interface to the network type the following command in the terminal. ifconfig eth0 up

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 eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet dhcp auto wlp2s0 iface wlp2s0 inet dhcp eth0: address 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.2 eth1: address 192.168.2.1 netmask 255.255.255.0 gateway 192.168.2.3

  1. Close any open programs that are using the network.
  2. Click on the “Start” button and select “Run”.
  3. Type “cmd” (without the quotes) and press Enter.
  4. At the command prompt, type “net stop netstat” (without the quotes).
  5. Type “net start netstat” (without the quotes). ..

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.

sudo nano /etc/hostname Step 2: Change the current hostname to “localhost” by typing the following command: sudo nano /etc/hostname Step 3: Press Ctrl + X to exit and Y to save the file. ..

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

Editing the /etc/hosts file

The Hosts file localizes the hostname to the IP address. For example, if you have a server on your local network, you can map its IP address to a name in the /etc/hosts file. This will allow you to access the machine with a name instead of the IP.

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.1 server1 192.168.2.1 server2 ..

To save the file and restart the system, follow these steps:

  1. Open File Explorer and navigate to the location where you want to save the file.
  2. Right-click on the file and select “Save As.”
  3. In the Save As dialog box, type a name for the file and click Save.
  4. Restart your computer to 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.