Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.

share|improve this answer

Did you actually start the virtual interfaces?

I see in your interfaces file that you start eth0 automatically, but not the vlan10 device.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.