IP zamiast IFCONFIG

ip a add 192.168.100.10/24 dev eno1
ip addr del 10.22.30.44/16 dev eth0
ip addr flush dev eth0
for i in $(ls /sys/class/net/) ; do
    /usr/sbin/ip addr flush $i &
done
root@mariusz:/home/lisu# ip a 
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    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 
       valid_lft forever preferred_lft forever
2: eno1:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether d4:be:d9:96:c4:92 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.8/24 brd 192.168.0.255 scope global dynamic eno1
       valid_lft 70768sec preferred_lft 70768sec
    inet 192.168.100.10/24 scope global eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::d6be:d9ff:fe96:c492/64 scope link 
       valid_lft forever preferred_lft forever
root@mariusz:/home/lisu# 

Skrypty i routing w pliku konfiguracyjnym

root@mailrelay1:/home/lisu# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
allow-hotplug ens18
iface ens18 inet static
    address 82.177.196.220/27
    gateway 82.177.196.193
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 82.177.196.221 82.177.196.222 8.8.8.8 8.8.4.4
    dns-search autosan.pl
# The secondary network interface
allow-hotplug ens19
iface ens19 inet static
    address 192.168.11.11/24
    post-up ip route add 192.168.0.0/16 via 192.168.11.254 dev ens19 ; /usr/local/sbin/firewall start

Więcej opis linku

IFACE OPTIONS
The following "command" options are available for every family and method. Each of these options can be given multiple times in a single stanza, in which case the commands are executed in the order in which they appear in the stanza. (You can ensure a command never fails by suffixing them with "|| true".)
pre-up command
Run command before bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured, prints an error message, and exits with status 0. This behavior may change in the future.
up command
post-up command
Run command after bringing the interface up. If this command fails then ifup aborts, refraining from marking the interface as configured (even though it has really been configured), prints an error message, and exits with status 0. This behavior may change in the future.
down command
pre-down command
Run command before taking the interface down. If this command fails then ifdown aborts, marks the interface as deconfigured (even though it has not really been deconfigured), and exits with status 0. This behavior may change in the future.
post-down command
Run command after taking the interface down. If this command fails then ifdown aborts, marks the interface as deconfigured, and exits with status 0. This behavior may change in the future.