Bug 237660

Summary: Networking bridge config with vlan bug?
Product: Base System Reporter: peos42 <peo_s>
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: New ---    
Severity: Affects Only Me CC: rgrimes
Priority: ---    
Version: 12.0-RELEASE   
Hardware: arm64   
OS: Any   

Description peos42 2019-04-29 20:38:19 UTC
Hi

I have a firewall where I have named vlan interfaces and the IP:s directly on the vlan interfaces. All good there...

Now... To use bhyve with vlans in bridge setups I think I have found a bug (This is just a lab as I usually use SR-IOV...)

Now I have struggled a bit, but now know what is wrong.... This is FreeBSD 12.0p3 relese


#### This is my switch port. 
interface 1/g8
description 'MISC TRUNK - LABORATION'
switchport mode trunk
switchport trunk native vlan 2008
switchport trunk allowed vlan 2-4,21,899,2008
vlan participation exclude 1,999
exit


Setting an IP directly on the vlan interface and it works OK
Setting an IP directly on a bridge not connected to a vlan and it works OK (but of course the switch port must be reconfigured for that first to an access port)
But... if I try to set the IP on the bridge that has a named vlan interface attached, it simply did not work to communicate.

I have used this vlan config scheme below a-lot before, but not with bridges. It looks 100% ok with ifconfig.  But it does not work.

#### *NOT* WORKING ####
ifconfig_re0="up"
cloned_interfaces="bridge2 "
vlans_re0="vlan2"
create_args_vlan2="vlan 2"
ifconfig_vlan2_descr="Local LAN network interface (vlan 2)"
ifconfig_bridge2_name="LAN_BRIDGE"
ifconfig_LAN_BRIDGE="inet 192.168.0.35/24 addm vlan2 up"
ifconfig_vlan2="up"



Now... I had to try something... :) so I rewrote the config in a different way. This also looks ok with ifconfig. Bu THIS, THIS WORKS.

#### WORKING ####
ifconfig_re0="up"
cloned_interfaces="bridge2"
vlans_re0="2"
ifconfig_re0_2_descr="Local LAN network interface (vlan 2)"
ifconfig_bridge2="inet 192.168.0.35/24 addm re0.2 up"
ifconfig_re0_2="up"



I think there maybe is a bug. Otherwise, please enlighten me of my stupidity :)