Static IP

  • List Network Interfaces with ip a
$> ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute
       valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:bb:c1:60:e1:89 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.64/24 brd 192.168.1.255 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::dabb:c1ff:fe60:e189/64 scope link
       valid_lft forever preferred_lft forever
  • Interfaces:

    • 1: lo: Loopback address (localhost / 127.0.0.1)
    • 2: enp3s0: Server Ethernet Port (Can also be something like eth0)
  • Open interfaces file to set static IP

sudo nano /etc/network/interfaces
  • Add / Edit Entry for the Ethernet Port (using name enp3s0)
allow-hotplug enp3s0
iface enp3s0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 1.1.1.1 1.1.0.1
  • Restart Networking Service
sudo systemctl restart networking
  • Check Interface IP Address (using name enp3s0)
ip addr show enp3s0
On this page
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9