Ubuntu

Ubuntu is a popular, user-friendly, and open-source Linux distribution based on Debian, known for its ease of use, strong community support, and frequent updates.

Update the OS

To update the installed OS and packages in one command

sudo apt-get update && sudo apt-get- upgrade -y

Recommened software and tools

The net-tools package is a collection of essential, legacy networking utilities for Linux operating systems, such as ‘ifconfig’, ‘route’, ’netstat’, and ‘arp’, which were traditionally used for network configuration, management, and troubleshooting tasks.

sudo apt-get install net-tools

User management

A user called root exists and is the God of the server. It is bad practice to logon and use the root account by default as it can do anything and poses a security risk for daily use. It is better practice to create a user account for you which can when needed elevate to become as powerful as root which is known as super-user and can be called by your account by prepending sudo to your commands.

Set a static IP address

If you want a static IP assigned to the NIC rather you can set it in a configuration file. You’ll need to know details about your network envrionment.

First get some details about the current setup by running ifconfig. Make a note of the network card you want to configure. In the exampke below I’ll be working with the wired NIC which is eth0.

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.224  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::3579:e133:cb31:e483  prefixlen 64  scopeid 0x20<link>
        ether e4:5f:01:52:10:ff  txqueuelen 1000  (Ethernet)
        RX packets 31369  bytes 40149347 (38.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13214  bytes 1057661 (1.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 10  bytes 1606 (1.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10  bytes 1606 (1.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.252  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::3eea:c071:d813:a5f5  prefixlen 64  scopeid 0x20<link>
        ether e4:5f:01:52:11:00  txqueuelen 1000  (Ethernet)
        RX packets 2482  bytes 459834 (449.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 3746 (3.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In modern releases of Ubuntu (17.10 >) a new system called NetPlan is used to configure network settings. Netplan is a modern, declarative, and YAML-based network configuration tool in Ubuntu that simplifies the management of network interfaces and settings, replacing the traditional ifupdown and net-tools utilities.

Go to the netplan directory located at /etc/netplan.

cd /etc/netplan
Last modified July 21, 2024: update (e2ae86c)