GNU/Linux xterm-256color bash 1206 views

sudo cp /etc/network/interfaces /etc/network/interfaces.bak
sudo vim /etc/network/interfaces

Before

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto ens33
allow-hotplug ens33
iface ens33 inet dhcp

After

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto ens33
allow-hotplug ens33
iface ens33 inet static
     address 172.17.13.167/24
     gateway 172.17.13.254
     # do not set netmask!!!!

Multiple Static IP(iproute2)

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto ens33
allow-hotplug ens33
iface ens33 inet static
     address 172.17.13.167/24
     gateway 172.17.13.254

iface ens33 inet static
     address 172.17.13.168/24

iface ens33 inet static
     address 172.17.13.169/24