[OpenWrt-Devel] [PATCH] vlandev: Add support for setting a unique MAC on a VLAN interface

Andre Valentin avalentin at marcant.net
Sun Jan 24 16:00:47 EST 2016


Am 24.01.2016 um 21:34 schrieb Gio:
> On Sunday 24 January 2016 20:47:26 André Valentin wrote:
>> There are cases where you need a different MAC on a VLAN interface, i.e. if
>> if have move than one connection to a switch. A later change of the MAC
>> is not possible on VLAN interfaces, so it has to be done on creation.
>> The new macaddr option allows to set a unique MAC for a VLAN interface.
> 
> I am the author of vlandev stuff are you sure that this doesn't break 
> assumptions made by linux kernel networking stack?
> 
> Some time ago i have done some testing (not enough probably) about changing 
> mac address on a vlan and the vlan interface stopped receiving packets, I 
> think that linux kernel was assuming the vlan and the untagged interface have 
> the same mac address my setup was like this
> 
> <br-lan{eth0, bat0, wlan0}>
> <eth0.10>
> 
> My experience was that if eth0 and eth0.10 had differents mac, eth0.10 didn't 
> receiving packets, this may be caused by eth0 being in a bridge
> 
> To overcome this i tried multiple permutations with macvlan in the middle but 
> none of them worked :(
> 
> one of the permutation was this
> <br-lan{eth0, bat0, wlan0}>
> <macvlan0(eth0)>
> <macvlan0.10>
> if i remember well i could not create the macvlan0 interface since eth0 was in 
> the bridge :(
The upper setup was exact that what I not wanted ;-)

I know that there are problems if you create a bridge on the untagged VLAN and
also on tagged ones depending on the kernel version. Personally I do not use such
setup because of its instability.
But with the documented setup below I have no problems, it's verified with several
ar71xx devices.

Kind regards,

Andre


> 
> Cheers!
> 
>> Example:
>> config device 'testvl'
>>         option type '8021ad'
>>         option name 'testvl'
>>         option ifname 'eth0'
>>         option vid '106'
>>         option macaddr 'f2:48:00:89:45:4c'
>>
>> config interface 'testif'
>>         option ifname 'testvl'
>>         option proto 'none'
>>         option auto '1'
>>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list