*nix Thread, virtual interfaces & vlans in Technical; Hi there,
I have an Ubuntu Server 12.04 machine with one physical NIC connected to a trunk port on a ...
-
17th February 2013, 04:15 PM #1
- Rep Power
- 8
virtual interfaces & vlans
Hi there,
I have an Ubuntu Server 12.04 machine with one physical NIC connected to a trunk port on a Cisco switch. I've installed the vlan package and configured /etc/network/interfaces to use 5 virtual interfaces with static IPs with vlan tagging, each on a different vlan.
The problem I've run into is that only one of the virtual interfaces seems to be "active" at a time, meaning only one of the IP addresses can be pinged. Sometimes, with a restart, which interface this works on will change. I had read that I should only configure the gateway on one of the interfaces, so I did, but that's not even the interface that always works!
Any ideas?
Thanks.
-
-
IDG Tech News
-
17th February 2013, 04:42 PM #2 Have you got the 8021q kernel module loaded?
-
-
17th February 2013, 05:12 PM #3
- Rep Power
- 8

Originally Posted by
morganw
Have you got the 8021q kernel module loaded?
Yes, I do.
-
-
17th February 2013, 05:26 PM #4 Can you post the interfaces file and the NIC model?
Also, are you pinging from a device that you are putting onto the relevant VLAN first?
-
Thanks to morganw from:
MarsRed (17th February 2013)
-
17th February 2013, 06:13 PM #5
- Rep Power
- 8

Originally Posted by
morganw
Can you post the interfaces file and the NIC model?
Also, are you pinging from a device that you are putting onto the relevant VLAN first?
Here's the interfaces file:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0.1
iface eth0.1 inet static
address 10.1.9.1
netmask 255.255.0.0
network 10.1.0.0
broadcast 10.1.255.255
gateway 10.1.0.1
vlan_raw_device eth0
auto eth0.2
iface eth0.2 inet static
address 10.2.9.1
netmask 255.255.0.0
gateway 10.2.0.1
vlan_raw_device eth0
auto eth0.3
iface eth0.3 inet static
address 10.3.9.1
netmask 255.255.0.0
gateway 10.3.0.1
vlan_raw_device eth0
auto eth0.4
iface eth0.4 inet static
address 10.4.9.1
netmask 255.255.0.0
gateway 10.4.0.1
vlan_raw_device eth0
NIC is Broadcom Corporation NetXtreme BCM5755 Gigabit Ethernet PCI Express.
I think your question about which vlan I'm pinging from might lead to an answer! I was only trying to ping from one vlan which can get to all other vlans. But now I realize (and just confirmed) that, when I'm on a given vlan, I am able to ping the interface of the machine that is on that vlan. i.e. from vlan1 I can ping the interface on vlan1, on vlan2 on I can ping the interface on vlan2, etc. Why might this be the case?
-
-
17th February 2013, 06:16 PM #6 Have you got IP forwarding enabled?
Code:
cat /proc/sys/net/ipv4/ip_forward
-
-
17th February 2013, 06:19 PM #7
- Rep Power
- 8
Doesn't look like it. Should I?
-
-
17th February 2013, 06:30 PM #8 You'll need that turned on to route between interfaces, otherwise the behaviour you've described is normal. Edit /etc/sysctl.conf and change net.ipv4.ip_forward from 0 to 1, reboot and re-test. Depending on what you are doing you might want to use a firewall on the server to restrict what is forwarded.
-
Thanks to morganw from:
MarsRed (17th February 2013)
-
17th February 2013, 06:46 PM #9
- Rep Power
- 8
Okay, I just did this and can no longer contact the machine. I'll have to wait until I'm back in the office to look at the machine in person.
Now I don't really want to use this machine as a router, so does enabling IP forwarding have any implications?
-
-
17th February 2013, 07:00 PM #10 Enabling it turns it into a router, otherwise what you have is multi-homed server that can offer services to each VLAN individually. As long as you are aware that without a firewall all traffic can be be forwarded onto another VLAN, that should be the only implication - how good or bad this is depends on your use case.
-
-
17th February 2013, 07:11 PM #11
- Rep Power
- 8
I'm using the machine to route mDNS between vlans, but it doesn't use traditional IP routing. The Avahi software just "reflects" mDNS traffic among the different interfaces/vlans without any routes required. Now that I understand that the behavior I was experiencing is normal without routing enabled, I'm okay with it.
But I wonder if this has anything to do with another issue I was having? I am also using Avahi to advertise cups print queues via mDNS (emulating Apple's AirPrint) so that iPads can print to non-AirPrint printers. The queues function normally when I print a test page from the cups web interface and the queues are successfully advertised by Avahi to the iPads, but printing is unsuccessful from the iPads. The iPads and printers are on separate vlans. Would this have anything to do with my interfaces issue?
-
-
17th February 2013, 07:18 PM #12 I guess the advertisement of printers is making it to the iPad as Avahi is working on all interfaces, but when the iPad tries to print, the print server is running on a different VLAN and so there is no route to it.
-
-
17th February 2013, 07:38 PM #13
- Rep Power
- 8
That's what I was thinking. But the print server is on the same vlan since it's that same machine that's on all of the vlans via the virtual interfaces. Maybe that's part of the problem?
Thanks for all of your help.
-
-
17th February 2013, 07:43 PM #14 You would probably have to check if your print server is listening on all interfaces, or just specific interfaces you've told it about. You could run tcpdump on the VLAN interface while trying to print to see what the iPad is doing.
-
-
17th February 2013, 07:45 PM #15 Also it would depend on the gateway that is set on yout iPad.
-
SHARE: 
Similar Threads
-
By reggiep in forum O/S Deployment
Replies: 4
Last Post: 31st July 2011, 11:35 AM
-
By ticker in forum Thin Client and Virtual Machines
Replies: 1
Last Post: 22nd January 2010, 12:02 PM
-
By MrDylan in forum Hardware
Replies: 6
Last Post: 9th March 2006, 03:13 PM
-
By alexknight in forum Hardware
Replies: 8
Last Post: 22nd December 2005, 06:36 PM
-
By altecsole in forum How do you do....it?
Replies: 9
Last Post: 12th December 2005, 09:40 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules