2

I need to configure 3 networks on my Ubuntu machine (OpenStack Network node)

The /etc/network/interfaces I have is:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# OpenStack management interface
auto eth1
iface eth1 inet static
  address 192.168.1.13
  netmask 255.255.255.0
  gateway 192.168.1.1
  broadcast 192.168.1.255
  dns-nameservers 8.8.8.8

# OpenStack instance tunnels interface
auto eth1:0
iface eth1:0 inet static
  address 192.168.3.1
  netmask 255.255.255.0

# OpenStack The external network interface
auto eth2
iface eth2 inet manual
  up ip link set dev $IFACE up
  down ip link set dev $IFACE down

eth1 and eth1:0 are working fine. Also, when I issue ifconfig, only eth1 and eth1:1 appear in the list. but no eth2.

I also tested to defined the 3rd interface on eth1:1 (3 networks on the same eth1 interface) with:

auto eth1:1
iface eth1:1 inet manual
  up ip link set dev $IFACE up
  down ip link set dev $IFACE down

or on eth0, but in both cases this 3rd interfaces does not appear with ifconfig, how could this be possible ?

The machine has 2 NICs:

lspci | grep Ethernet
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

How can I know the name of the interfaces linked to them ? It seems eth1 is working but how can I make sure eth0 is working ?

** UPDATE **

Using eth2 was a stupid thing. Instead of trying to use one single interface to map the 3 networks, I have used eth0 and plugged the NIC correctly.

auto eth0
iface eth0 inet manual
  up ip link set dev $IFACE up
  down ip link set dev $IFACE down
030
  • 5,901
  • 13
  • 68
  • 110
Luc
  • 518
  • 3
  • 5
  • 21
  • I wrote a simple script to configure any number of network interface for ubuntu. You can download the setstaticip.sh script form the below link. ./setstaticip.sh will do the magic. https://github.com/ArunkumarGoge/basic-functions – Arunkumar Goge May 29 '15 at 12:21
  • Did you find any workaround? – vahid kargar Dec 05 '18 at 11:46

1 Answers1

2

We normally do it like this:

auto eth1
iface eth1 inet static
   address   243.124.38.195
   broadcast 243.124.38.207
   gateway   243.124.38.193
   netmask   255.255.255.240
   dns-nameservers 127.0.0.1
   dns-search sample.xyz
## virtual ip4 interfaces
   up   ip addr add 192.168.1.1/28     dev $IFACE
   down ip addr del 192.168.1.1/28     dev $IFACE || true
   up   ip addr add 243.124.38.196/28 dev $IFACE
   down ip addr del 243.124.38.196/28 dev $IFACE || true
   up   ip addr add 243.124.38.206/28 dev $IFACE
   down ip addr add 243.124.38.206/28 dev $IFACE || true
## virtual ip6 interfaces
   up   ip -6 addr add 2001:120:402d::c3/64 dev $IFACE 
   down ip -6 addr del 2001:120:402d::c3/64 dev $IFACE || true
   up   ip -6 addr add 2001:120:402d::c4/64 dev $IFACE
   down ip -6 addr del 2001:120:402d::c4/64 dev $IFACE  || true

The advantage of this aproach is that the system always uses 243.124.38.195 for outgoing ip4 connections unless the software actively binds to a different interface.

Also I would recommend to use

ip addr show

to see your network configuration.

Tobi Oetiker
  • 1,842
  • 13
  • 12