IP alias lost when changing main IP
- by rmflow
my /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 192.168.3.75
netmask 255.255.255.0
gateway 192.168.3.0
Situation 1:
After linux booted I set an IP alias: ifconfig eth0:0 192.168.3.111
Now ifconfig reports two IP addresses 192.168.3.75 at eth0 and 192.168.3.111 at eth0:0
When I change main IP to another network: ifconfig eth0 192.168.1.111 the alias eth0:0 is lost!
Situation 2:
After linux booted I set an IP alias: ifconfig eth0:0 192.168.4.111
Now ifconfig reports two IP addresses 192.168.3.75 at eth0 and 192.168.4.111 at eth0:0
When I change main IP to another network: ifconfig eth0 192.168.1.111 the alias eth0:0 stays!
How do I properly change main IP, so all my aliases are not lost?