[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:04:21 EST 2016


Am 24.01.2016 um 22:00 schrieb Andre Valentin:
> 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.

By the way, you should always make sure that you use a unicast mac. There are several generators
on the web which do not take care if this. It took me some time to remember this fact yesterday..

Kind regards,

André
_______________________________________________
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