Posts categorized under: sysadmin

ifconfig to make an alias on the fly

Create the new alias and change the default route:

$ sudo ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0
$ sudo route del default
$ sudo route add default gw 192.168.1.1

Remove the alias and the default route :

$ sudo route del default
$ sudo ifconfig eth0:0 ...