I have three Ubuntu servers (each having only one NIC) for my Openstack cluster configuration following this guide.
I also have a Cisco 3750 24 port ethernet switch which I am using as a L3 device in between the Ubuntu servers and another Windows (having 2 NIC) machine as an Internet gateway.
According to the guide, 2 sub-interfaces are created in the single physical NIC of the Ubuntu servers to separate traffics intended for different openstack purpose.
for example: I have the following vlans in the network
vlan10 — to communicate between the physical ubuntu servers (needs to be routable towards the internet g/w) – already configured and working OK (switchports were configured as 'access' ports)
vlan101 — internal data network for the virtual machines (only L2 inter-connectivity is reqiured)
vlan102 — public network for the virtual machines (needs to be routable towards the internet g/w)
My question is: is it possible to configure the switchport as a trunk interface and allow all the vlans in the individual switch ports so that they can also communicate with each other properly.
Note that, I only have a cisco 3750 switch. No other option.
Thanks a lot …
Here are configurations:
================================================================================
01. controller1-01 (Ubuntu Server) /etc/network/interfaces (OpenStack Controller Node)
—————————————
auto lo
iface lo inet loopback
—————————————
auto eth0
iface eth0 inet static
address 192.168.0.29
netmask 255.255.255.224
network 192.168.0.0
broadcast 192.168.0.31
gateway 192.168.0.30
—————————————
auto eth0.101
iface eth0.101 inet static
vlan-raw-device eth0
address 10.0.0.253
netmask 255.255.255.0
—————————————
auto eth0.102
iface eth0.2 inet static
vlan-raw-device eth0
address 192.168.0.157
netmask 255.255.255.224
up route add -net 10.10.10.0/24 gw 192.168.0.131
================================================================================
02. ns1-01 (Ubuntu Server) /etc/network/interfaces (Quantum Network Node)
—————————————
auto lo
iface lo inet loopback
—————————————
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.224
network 192.168.0.0
broadcast 192.168.0.31
gateway 192.168.0.30
—————————————
auto eth0.101
iface eth0.101 inet static
vlan-raw-device eth0
address 10.0.0.1
netmask 255.255.255.0
—————————————
auto eth0.102
iface eth0.102 inet manual
vlan-raw-device eth0
up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ifconfig $IFACE down
================================================================================
03. ns1-02 (Ubuntu Server) /etc/network/interfaces (OpenStack Compute Node)
—————————————
auto lo
iface lo inet loopback
—————————————
auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.224
network 192.168.0.0
broadcast 192.168.0.31
gateway 192.168.0.30
—————————————
auto eth0.101
iface eth0.101 inet static
vlan-raw-device eth0
address 10.0.0.2
netmask 255.255.255.0
================================================================================
04. LS1-01 (Ubuntu Server) /etc/network/interfaces (OpenStack Compute Node)
—————————————
interface GigabitEthernet1/0/1
description //Connected to ns1-01 (Region One Network Node)
switchport trunk encapsulation dot1q
switchport trunk native vlan 10
switchport trunk allowed vlan 10,101,102
switchport mode trunk
—————————————
interface GigabitEthernet1/0/2
description //Connected to ns1-02 (Region One Compute Node)
switchport trunk encapsulation dot1q
switchport trunk native vlan 10
switchport trunk allowed vlan 10,101,102
switchport mode trunk
—————————————
interface GigabitEthernet1/0/11
description //Connected to controller1-01 (Region One Controller Node)
switchport trunk encapsulation dot1q
switchport trunk native vlan 10
switchport trunk allowed vlan 10,101,102
switchport mode trunk
—————————————
interface GigabitEthernet1/0/12
description //Connected to Internet
no switchport
ip address 192.168.0.65 255.255.255.252
—————————————
interface Vlan10
description //Management network for Physical Machines under Region One
ip address 192.168.0.30 255.255.255.224
—————————————
interface Vlan101
description //Internal data network for VM instances under Region One
ip address 10.0.0.254 255.255.255.0
—————————————
interface Vlan102
description //Public/API network for VM instances under Region One
ip address 192.168.0.158 255.255.255.224
—————————————
ip route 0.0.0.0 0.0.0.0 192.168.0.66 # Towards Internet G/W
Best Answer
Absolutely you can. You're looking for 802.1q tagging, which is the underpinning of multiple VLANs on a switch.
Configure your server-facing ports like this...
On your Ubuntu server you'll need to configure the subinterfaces to be associated to each appropriate VLAN. This can be done manually like this ...
Now you can associate the correct IP address to new interface eth0.221, along with the appropriate default gateway and subnet mask.
If this doesn't work for you, please include a pastebin link to your switch config as well as the output of "ip -d link show" on your Ubuntu server.
Hope this helps!