I faced a small problem when assigning multiple IPv4 addresses to the interface. I added 2 IPv4 addresses by following these steps :
first, I added the 2 IPv4 addresses using these command-lines:
#sudo ip address add 10.0.0.21/24 dev eth1 #sudo ip address add 10.0.1.21/24 dev eth1
To check the result I typed the following command-line :
#ip address show eth0.
Second, to make these configurations permanent, I edited the
/etc/network/interfaces
file by adding specific configurations and now it looks like this:auto eth1 iface eth1 inet static address 10.0.0.21 netmask 255.255.255.0 gateway 10.0.0.1 auto eth1 iface eth1 inet static address 10.0.1.21 netmask 255.255.255.0 gateway 10.0.1.1
Finally, to activate these settings without a reboot , I used the
ifdown/ifup
by typing:#sudo ifdown eth1 && sudo ifup eth1.
The first problem is when I used the ifdown/ifup command , I got this notifications:
ifdown: interface eth1 not configured
RTNETLINK answers: File exists
Failed to bring up eth1.
whereas I updated the /etc/network/interfaces
so, normally it may to recognize the interface.
The second problem is when I rebooted my machine all the setting were lost. thank you
eth1
properties twice? – jijinp Jul 22 '15 at 11:29