Have I misconfigured the VLANs on Ubuntu Server 14.04

ubuntu-14.04vmware-vsphere

I have a problem with VLANs on my network.
I have server Dell Poweredge R210 II on which I have installed VMware vSphere Hypervisor 5.5.
Next, I created a virtual machine with Ubuntu Server 14.04.
The network plan is a connection from the ISP to the Ubuntu Server (first NIC) then to Cisco SG200-26P as trunk port to G25.
The first seven ports on the switch are configured as VLAN port G1-vlan 10, G2-vlan 20… G7-vlan 70, as untagged with access mode.

Ubuntu server configuration:

  • apt-get install vlan
  • /etc/network/interfaces like that (the rest of the VLANs look the same)

auto eth1
iface eth1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1

iface vlan10 inet static
address 192.168.10.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.10.55
vlan_raw_device eth1

  • enable IP forwarding: edit /etc/sysctl.conf file:i change net.ipv4.ip_forward from 0 to 1

  • modprobe 8021q

  • enabled /proc/sys/net/ipv4/ip_forward

  • /proc/net/vlan

When I connect my laptop with static IP address 192.168.10.10 netmask 255.255.255.0 gateway 192.168.10.1 to G1 port (vlan10) I can’t ping my gateway. I have a DHCP configuration file

example vlan10

#vlan10   
subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.2 192.168.10.100;
option routers 192.168.10.1;
option domain-name "eth1_vlan10";

My laptop can’t even get that IP address from DHCP.

I installed the same configuration on the second computer <ubuntu server with 2 NIC card> and it behaved the same. What should I do?

Best Answer

I see you ran modprobe 8021q; verify that the 8021q module is loaded: lsmod | grep 8021q

And using information from the Ubuntu VLAN Wiki and the manpage for the interfaces file seems to indicate your vlan config should be:

auto eth1.10
iface eth1.10 inet static
  address 192.168.10.1
  netmask 255.255.255.0
  network 192.168.10.0
  broadcast 192.168.10.255
  vlan-raw-device eth1

And lastly, you don't mention how your virtual switches are configured. It sounds like you should have one virtual switch connected to the ISP NIC, and one connected to the inside NIC. The first virtual switch probably shouldn't specify any VLANs, but the second one will need the VLAN numbers configured (except for the 192.168.1.0/24 network, which I'll assume is VLAN 1?). I believe this document should provide the detail you need.

Related Topic