VLAN interfaces causing networking to fail

This is quite a stupid issue for me to be having, but I seem to be completely incapable of solving this.

I'm using a fresh install of Ubuntu 16.04, patched to current as of today.

To paint a picture, I've got the following:

eno1 - 1GbE to mgmt switch
eno2 - 1GbE not connected
enp4s0f0 - 10GbE to primary switch
enp4s0f1 - 10GbE not connected

On enp4s0f0, I'm trying to create a vlan virtual interface for tag 232.

my interfaces file looks like this:

auto enp4s0f0
iface enp4s0f0 inet static
    address 10.2.4.10
    netmask 255.255.255.0
    network 10.2.4.0
    broadcast 10.2.4.255
    gateway 10.2.4.1
    pre-up sleep 2

auto eno1
iface eno1 inet static
    address 10.2.8.10
    netmask 255.255.255.0
    network 10.2.8.0
    broadcast 10.2.8.255
    gateway  10.2.8.1
    pre-up sleep 2

auto enp4s0f0.232
iface enp4s0f0.232
    address 10.2.32.10
    netmask 255.255.255.0
    pre-up sleep 2

Now, I've tried adding vlan-raw-device enp4s0f0 to the vlan interface to no avail.

When I try to start the networking service, I get the following:

/sbin/ifup: waiting for lock on /run/network/ifstate enp4s0f0
RTNETLINK answers: File exists
Unknown interface enp4s0f0.232
Failed to bring up enp4s0f0

When I remove the vlan 232 config, networking works just fine... :confused:

What's odd is this exact configuration was working on 14.04 yesterday. Since it's Friday, I'm probably missing something simple... Any thoughts?

Dumb question but have you installed the vlan package?

1 Like

It was installed by default on 16.04, one of the first things I checked.

I _think_ you should remove this line. This is for physical interfaces, not subinterfaces or vlans.
[quote="sgtawesomesauce, post:1, topic:115168"]
`auto enp4s0f0.232`
[/quote]

No, that's wrong. Is 8021q module loaded?

inet static?

Sure is.

Yep!

mkay. Can you show your current ifconfig or ip link show output?
What happens when you run ip link add link enp4s0f0 name enp4s0f0.232 type vlan id 232?

I menat that inet static is missing for iface enp4s0f0.232.

Ah, I must have forgotten to copy that over. I'm working over ipmi, so I can't copy-paste. Just double checked and it definitely had inet static on there.

@dmj Output of commands as follows. Going to screenshot the IPMI client, since it's quite a bit of text and I've got no SSH connection at the moment.

That's before running the ip link add command. The following is after.

Thanks for taking the time to work through this with me.

Better use ip link show - ifconfig only shows interfaces which are up. Judging by the fact that ip link add didn't throw any errors, vlan interface was added successfully, and if you continue with ifup enp4s0f0.232 or ip link set dev enp4s0f0.232 up, it should work.
Not sure why it doesn't work during service restart. Maybe try
ip link delete dev enp4s0f0.232 type vlan
to remove the vlan interface again and then
ifquery -v enp4s0f0.232
ifup -v enp4s0f0.232

1 Like

Here's the output of ip link show (I'm so used to ifconfig, old habits die hard I guess). Nothing has changed between last post and this screenshot.

after running ip link up.

After successfully removing the vlan device, we have the same issue.

ifquery -lv output?
This is very weird.

I'm happy I wasn't just missing something obvious. I was feeling quite stupid when posting this. I've got a bit of experience with networking, but wouldn't say I'm an expert.

output of ifquery -lv:

There seems to be some inconsistency between the results of ip link show and ifquery

I wonder if this is something for the Ubuntu mailing list...

Nah, they just show different things. ifquery parses config, ip link shows existing interfaces.
I wonder if network manager isn't screwing with you, if it's installed.

Network Manager isn't installed. That was one of the first things I checked, I don't think that's installed unless you opt for a graphical install on Ubuntu.

Well, I have no idea.
...so I'll just add recommendations which have nothing to do with your problem.

  1. gateways. I don't see you setting different metric for different interfaces there, so there's no real point in several 0/0 routes, and that's all gateway is (or does).
  2. sleeps. Is it a workaround for something?

as a workaround for your actual problem, you may try adding
post-up ip link add link enp4s0f0 name enp4s0f0.232 type vlan id 232
pre-down ip link delete enp4s0f0.232 type vlan

to your enp4s0f0 configuration, but that's bullshit, it's stupid and it shouldn't be needed.

or maybe add hwaddress? Again, kinda stupid.

1 Like

gateways. I don't see you using different metric for different interfaces there, so there's no poitn in several 0/0 routes.

True. I haven't fully configured everything yet, and that was something that I was going to sort out after I got the vlan's in. That's part of the problem.

sleeps. Is it a workaround for something?

It was on 14.04, but I can't remember exactly what it was for. It's been a few years since I set it up. I figured I'd add it in to see if it would fix it.

I'll give this stuff a try to see what happens.

Thanks for giving it a go. I appreciate your time!

You could try making the vlan interface as a bridge, I don't know if that would make any difference or not but that's how I have mine set up (for VMs).

auto br232 # some name for the bridge interface
iface br232 inet static
bridge_ports enp4s0f0.232
bridge_ports off
bridge_fd 0.0

You'll need to make sure you have the bridge or bridge-utils or whatever it's called package installed. Not sure if it will help or not but it might be worth a try.

So, I found a solution:

enp4s0f0 is the raw interface. vlan232 is the vlan interface, and you define vlan-raw-device within the vlan232 config to get it working. For some reason enp4s0f0.232 is not working with my hardware. Using Intel 10G X540-AT2 adapter, for future reference.

Thanks for the help everyone!

1 Like

Well, I'll be damned. Thanks for posting the solution.
Live and learn...