Static IP

Debian Static

sudo vi /etc/network/interfaces

file:

auto eth0

auto eth0:0

auto eth0:1

iface eth0 inet static

address 192.168.1.1

netmask 255.255.255.248

gateway 192.168.1.254

iface eth0:0 inet static

address 192.168.1.2

netmask 255.255.255.248

gateway 192.168.1.254

iface eth0:1 inet static

address 192.168.1.3

netmask 255.255.255.248

gateway 192.168.1.254

# add rest of alias / binds below

+++++ default static setup from debian ++++++

iface eth0 inet static

address 192.168.1.100

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

gateway 192.168.1.1

# dns-* options are implemented by the resolvconf package, if installed

dns-nameservers 192.168.1.254

dns-search domain.com

Ubuntu Static

Edit yaml file that will be located in this directory: /etc/netplan

with an example name such as 01-network-manager-all.yaml

The file should look like this:

/etc/netplan/01-network-manager-all.yaml

network: version: 2 renderer: networkd ethernets: enp3s0: addresses: - 10.10.10.2/24 gateway4: 10.10.10.1 nameservers: search: [mydomain, otherdomain] addresses: [10.10.10.1, 1.1.1.1]

Save file and then apply changes

sudo netplan apply

https://netplan.io/examples/