Document Scope
This guide covers some basic steps for managing your network in older/legacy (pre 18.04) versions of Ubuntu. Managing network interfaces is an essential step in keeping your server accessible to the Internet for remote access, updates, etc. These are just some of the basic steps for network management and for a deeper dive you can refer to the Ubuntu wiki for Command Line Network Configuration.
Prerequisites
Please note this guide only applies to Ubuntu systems using the older method of managing network, via /etc/network/interfaces. By default now Ubuntu uses Netplan. Systems using Netplan can not manage the network via GUI but instead rely on YAML files. This document will cover the older method.
Step 1: List Available Network Interfaces
Run “ip link show” without quotes to display a list of network interfaces, including Ethernet ports. You can identify Ethernet ports like eth0, eth1, etc.)
exx@exx:~$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 08:00:27:f0:60:92 brd ff:ff:ff:ff:ff:ff
exx@exx:~$
Step 2: Edit the interfaces file
Using your preferred editor, edit the file /etc/network/interfaces and add network port names to interfaces file. An basic file using DHCP would look something like this:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary ethernet interace
auto enps03
ifaceenps030 inet dhcp
Or for a static IP configuration:
auto enp0s3
iface enp0s3 inet
static address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
Step 3: Restart computer or the network service
Run the command "sudo systemctl restart networking" and you should be all set! Alternately, you can reboot the system completely.
Comments
0 comments
Please sign in to leave a comment.