Here's the logic which chooses the mac address based on configuration or on
fallbacks (eth0 or first non loopback interface, using ifconfig):

https://github.com/openwisp/openwisp-config/blob/master/openwisp-config/files/openwisp.agent#L281-L284

Try playing with this code via shell and see what you can find out, try
changing the mac_interface option if needed.

Fed

On Fri, 31 Mar 2023 at 14:38, Deepesh Singh <singdee...@gmail.com> wrote:

> This
>
> root@Freshwave:~# ip link | awk '{print $2}'
> lo:
> 00:00:00:00:00:00
> eth0:
> f6:e3:04:99:bd:64
> lan1@eth0:
> f6:e3:04:99:bd:64
> lan2@eth0:
> f6:e3:04:99:bd:64
> lan3@eth0:
> f6:e3:04:99:bd:64
> lan4@eth0:
> f6:e3:04:99:bd:64
> wan@eth0:
> f6:e3:04:99:bd:64
> wwan0:
>
> br-lan:
> f6:e3:04:99:bd:64
> wlan0:
> f8:5e:3c:40:fe:fe
> wlan1:
> f8:5e:3c:40:fe:ff
> tun0:
>
> On Thursday, 30 March 2023 at 19:14:13 UTC+1 Deepesh Singh wrote:
>
>> Unit registered with 4E:AF:F9:A7:4E:28 but I am unable to find them on
>> interface MAC.
>>
>>
>> OpenWRT
>> -
>> OK
>> applied
>> 4E:AF:F9:A7:4E:28
>> 10.50.0.150
>> 22 Mar 2023, 11:42 p.m.
>> 30 Mar 2023, 12:47 p.m.
>>
>>
>>
>> root:~# ip a
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
>> default qlen 1000
>>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>>     inet 127.0.0.1/8 scope host lo
>>        valid_lft forever preferred_lft forever
>>     inet6 ::1/128 scope host
>>        valid_lft forever preferred_lft forever
>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc fq_codel state
>> UP group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>>     inet6 fe80::1c29:cdff:fee5:dbff/64 scope link
>>        valid_lft forever preferred_lft forever
>> 3: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> master br-lan state UP group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>> 4: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
>> master br-lan state LOWERLAYERDOWN group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>> 5: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
>> master br-lan state LOWERLAYERDOWN group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>> 6: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
>> master br-lan state LOWERLAYERDOWN group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>> 7: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue
>> state LOWERLAYERDOWN group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>> 10: wwan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc
>> fq_codel state UNKNOWN group default qlen 1000
>>     link/none
>>     inet 10.141.213.173/30 brd 10.141.213.175 scope global wwan0
>>        valid_lft forever preferred_lft forever
>>     inet6 fe80::19a5:4571:174c:6274/64 scope link stable-privacy
>>        valid_lft forever preferred_lft forever
>> 14: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> state UP group default qlen 1000
>>     link/ether 1e:29:cd:e5:db:ff brd ff:ff:ff:ff:ff:ff
>>     inet 192.168.2.1/24 brd 192.168.2.255 scope global br-lan
>>        valid_lft forever preferred_lft forever
>>     inet6 fd2b:293b:f6eb::1/60 scope global noprefixroute
>>        valid_lft forever preferred_lft forever
>>     inet6 fe80::1c29:cdff:fee5:dbff/64 scope link
>>        valid_lft forever preferred_lft forever
>> 17: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> master br-lan state UP group default qlen 1000
>>     link/ether f8:5e:3c:40:fe:ff brd ff:ff:ff:ff:ff:ff
>>     inet6 fe80::fa5e:3cff:fe40:feff/64 scope link
>>        valid_lft forever preferred_lft forever
>> 18: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue
>> master br-lan state UP group default qlen 1000
>>     link/ether f8:5e:3c:40:fe:fe brd ff:ff:ff:ff:ff:ff
>>     inet6 fe80::fa5e:3cff:fe40:fefe/64 scope link
>>        valid_lft forever preferred_lft forever
>> 19: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc
>> fq_codel state UNKNOWN group default qlen 500
>>     link/none
>>     inet 10.50.0.150/24 scope global tun0
>>        valid_lft forever preferred_lft forever
>>     inet6 fe80::62c:8aa3:d6eb:3f02/64 scope link stable-privacy
>>        valid_lft forever preferred_lft forever
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenWISP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to openwisp+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/openwisp/dec84b76-8b42-4452-a4b2-55638c36e77dn%40googlegroups.com
> <https://groups.google.com/d/msgid/openwisp/dec84b76-8b42-4452-a4b2-55638c36e77dn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenWISP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to openwisp+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/openwisp/CAAGgX6KBFwD2oxn3523pvWYZXmZiGEvbEAdTXihjKH_GmJWZgA%40mail.gmail.com.

Reply via email to