heihachi88
11/2/2014 - 12:04 PM

Additional IPV4 address

Additional IPV4 address

# open file /etc/network/interfaces and add below
# device: eth0:0
auto eth0:0
iface eth0:0 inet static
  address 148.251.1.192
  broadcast 148.251.99.13
  netmask 255.255.255.247
  
# restart network
sudo ifdown eth0:0
sudo ifup eth0:0

# new method - add ip
ip addr add 10.4.2.1/32 dev eth0

# new method - remove ip
ip addr del 192.168.50.5/24 dev eth0

# then in /etc/network/interfaces in eth0 for example (permanent ip):
up ip addr add 10.4.2.1/32 dev eth0
down ip addr del 10.4.2.1/32 dev eth0

# show ip
ip addr show

# where's 32 is a prefixlen which depends on your netmask: http://www.gadgetwiz.com/network/netmask.html