On the eth0 interface, the ip row is raised. Suppose the file / etc / network / interfaces:
auto eth0 iface eth0 inet static address 100.100.100.100 netmask 255.255.255.0 auto eth0:1 iface eth0:1 inet static address 100.100.100.101 netmask 255.255.255.0 auto eth0:2 iface eth0:2 inet static address 100.100.100.102 netmask 255.255.255.0
If you look at the routing table, we see the following entries.
$ ip route show default via 100.100.100.1 dev eth0 100.100.100.0/24 dev eth0 proto kernel scope link src 100.100.100.102
The task is always to ensure that the src 100.100.100.102 value is the ip that I specify (and was constant). I can do this manually, via the ip
command, but this will only be until the first reboot of the server or the service networking reload
command
How to do it correctly, given that the number of ip can be more than 100 on one interface?
And if you create a routing table, again through the ip
command, then it also exists only until the first reboot.