Override MAC address for interface?

Rafał Miłecki zajec5 at gmail.com
Fri Feb 24 00:14:55 PST 2023


On 23.02.2023 13:49, Peter Naulls wrote:
> On 2/23/23 01:43, Rafał Miłecki wrote:
>> On 22.02.2023 21:02, Peter Naulls wrote:
>>>
>>
>>> config device
>>>          option 'lan1'
>>
>> This line is clearly wrong. See how you specify device name in above section.
> 
> Perhaps it is "clear" but there's much in OpenWrt that isn't obvious up front,
> until you know, and then it is. But thanks for the correction.
> 
> However, what I really want to do is this:
> 
> 
> config interface 'wan'
>          option auto '0'
>          option proto 'dhcp'
>          #option device 'wan'
>          option name 'wan'
>          option metric '0'
> 
> config device 'wan'
>          option name 'wan'
>          option macaddr '34:BA:9A:CC:DD:BB'
> 
> But uci doesn't allow this. I guess I'll have to rename the wan device in the DTS to wan0 or something.

It's true uci doesn't allow duplicated section names BUT there is no
need to name your "config device" section. Drop its "wan" name and
just leave the:
option name 'wan'
which will handle the matching.



More information about the openwrt-devel mailing list