I am completely new to network administration, and so am finding things a bit tough. I have a machine, whose 1 interface I have to set to the subnet 10.0.20.0/24, another to 10.1.0.0/24 and a third to 10.128.0.0/24. My eth0 is already running, and the ifconfig command shows the result:
eth0 Link encap:Ethernet HWaddr fa:16:3e:31:bc:c9
inet addr:10.0.20.3 Bcast:10.0.20.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe31:bcc9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1454 Metric:1
RX packets:8941 errors:0 dropped:0 overruns:0 frame:0
TX packets:5324 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5662823 (5.6 MB) TX bytes:616960 (616.9 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:672 (672.0 B) TX bytes:672 (672.0 B)
Looking at this and elsewhere, I configured my /etc/network/interfaces thus:
auto eth0
iface eth0 inet static
address 10.0.20.3
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 10.1.0.1
netmask 255.255.255.0
auto eth2
iface eth2 inet static
address 10.128.0.1
netmask 255.255.255.0
I did not do anything to eth0 as it is already running. I tried "sudo ifdown eth1". I am getting:
ifdown: interface eth1 not configured
I looked in these forums, and people are talking about a gateway, but I am not sure what to set this gateway to, and for which interface. Could someone please help me?
When running "sudo ifup eth1", I got the result:
Cannot find device "eth1"
Failed to bring up eth1.
OK, here is what I did - instead of using eth1 and eth2, I replaced them with eth0:1 and eth0:2 respectively, as given below:
auto eth0:1
iface eth0:1 inet static
address 10.1.0.1
netmask 255.255.255.0
auto eth0:2
iface eth0:2 inet static
address 10.128.0.1
netmask 255.255.255.0
Now, when I am doing "sudo ifup eth0:1" and "sudo ifup eth0:2", the the interface correctly starts. So the output of "ifconfig -a" is:
eth0 Link encap:Ethernet HWaddr fa:16:3e:31:bc:c9
inet addr:10.0.20.3 Bcast:10.0.20.255 Mask:255.255.255.0
inet6 addr: fe80::f816:3eff:fe31:bcc9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1454 Metric:1
RX packets:1498 errors:0 dropped:0 overruns:0 frame:0
TX packets:1220 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:149182 (149.1 KB) TX bytes:148374 (148.3 KB)
eth0:1 Link encap:Ethernet HWaddr fa:16:3e:31:bc:c9
inet addr:10.1.0.1 Bcast:10.1.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1454 Metric:1
eth0:2 Link encap:Ethernet HWaddr fa:16:3e:31:bc:c9
inet addr:10.128.0.1 Bcast:10.128.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1454 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1184 (1.1 KB) TX bytes:1184 (1.1 KB)
But, I am still confused. I am supposed to do the same with the devices eth1 and eth2. If these interfaces are not present, how do I add them?
OK, I finally got it. When I created my OpenStack instance, I did so using only one network interface. Thus only eth0 was created. I deleted the instance and created a new one specifying the additional interfaces. eth1 and eth2 were successfully configured!
ifdown
? The interface is already down. To get it up, you should useifup
.