Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The IPv6 link local address generated by default is from random MAC in place of interface / device MAC (EUI-64). #21440

Open
nmoray opened this issue Jan 15, 2025 · 4 comments
Labels
Triaged this issue has been triaged

Comments

@nmoray
Copy link
Contributor

nmoray commented Jan 15, 2025

Issue: On wistron ES1227 platform, by default all the interfaces (irrespective of L2 or L3) are getting Ipv6 link local ips and these IPs are getting generated from random MAC. That means, it is not following the EUI-64 standard. But if those interfaces are getting the correct EUI-64 based IPv6 LL ip if we flap them.

Reference logs:

root@sonic:~# show ipv6 int
Interface    Master    IPv6 address/mask                        Admin/Oper    BGP Neighbor    Neighbor IP
-----------  --------  ---------------------------------------  ------------  --------------  -------------
Bridge                 fe80::dc44:16ff:fe47:8255%Bridge/64      up/down       N/A             N/A
Ethernet0    Bridge    fe80::20b5:b9ff:fed8:bd08%Ethernet0/64   up/down       N/A             N/A
Ethernet1    Bridge    fe80::143e:d1ff:fedb:52b2%Ethernet1/64   up/down       N/A             N/A
Ethernet2    Bridge    fe80::b812:9eff:fee5:f2c6%Ethernet2/64   up/down       N/A             N/A
Ethernet3    Bridge    fe80::ecf6:6bff:fe48:3cc7%Ethernet3/64   up/down       N/A             N/A
Ethernet4    Bridge    fe80::5828:27ff:fe12:d2a4%Ethernet4/64   up/down       N/A             N/A
Ethernet5    Bridge    fe80::cc91:e9ff:fe74:4c39%Ethernet5/64   up/down       N/A             N/A
Ethernet6    Bridge    fe80::80a5:fff:fe91:ee07%Ethernet6/64    up/down       N/A             N/A
Ethernet7    Bridge    fe80::2c09:26ff:fe8d:c40f%Ethernet7/64   up/down       N/A             N/A
Ethernet8    Bridge    fe80::a4fb:22ff:fe90:8cd7%Ethernet8/64   up/down       N/A             N/A
Ethernet9    Bridge    fe80::ac89:94ff:fe3e:28f3%Ethernet9/64   up/down       N/A             N/A
Ethernet10   Bridge    fe80::e445:32ff:fe8e:76e9%Ethernet10/64  up/down       N/A             N/A
Ethernet11   Bridge    fe80::581e:37ff:fe17:97a4%Ethernet11/64  up/down       N/A             N/A
Ethernet12   Bridge    fe80::ecfb:9bff:fe0f:5de1%Ethernet12/64  up/down       N/A             N/A
Ethernet13   Bridge    fe80::866:54ff:feaf:6a1e%Ethernet13/64   up/down       N/A             N/A
Ethernet14   Bridge    fe80::8ce:8aff:fef9:b35d%Ethernet14/64   up/down       N/A             N/A
Ethernet15   Bridge    fe80::842a:eaff:fe6b:40bf%Ethernet15/64  up/down       N/A             N/A
Ethernet16   Bridge    fe80::b830:9fff:fe1a:a1a0%Ethernet16/64  up/down       N/A             N/A
Ethernet17   Bridge    fe80::f02a:16ff:feaf:cd2d%Ethernet17/64  up/down       N/A             N/A
Ethernet18   Bridge    fe80::4c1a:bfff:fe06:811%Ethernet18/64   up/down       N/A             N/A
Ethernet19   Bridge    fe80::7009:f5ff:fe28:4d1e%Ethernet19/64  up/down       N/A             N/A
Ethernet20   Bridge    fe80::c0b8:a0ff:fe15:8474%Ethernet20/64  up/down       N/A             N/A
Ethernet21   Bridge    fe80::f01f:14ff:fe73:c0a4%Ethernet21/64  up/down       N/A             N/A
Ethernet22   Bridge    fe80::f0dd:15ff:fe81:6b92%Ethernet22/64  up/down       N/A             N/A
Ethernet23   Bridge    fe80::75:3fff:fee8:487f%Ethernet23/64    up/down       N/A             N/A
Ethernet24   Bridge    fe80::44ca:57ff:fe6d:77f0%Ethernet24/64  up/down       N/A             N/A
Ethernet25   Bridge    fe80::9099:69ff:fe95:5ae5%Ethernet25/64  up/down       N/A             N/A
Ethernet26   Bridge    fe80::50e1:75ff:fe75:32d2%Ethernet26/64  up/down       N/A             N/A
Ethernet27   Bridge    fe80::a8a9:5eff:fe85:2132%Ethernet27/64  up/down       N/A             N/A
Ethernet28   Bridge    fe80::80c9:13ff:fea8:2162%Ethernet28/64  up/down       N/A             N/A
Ethernet29   Bridge    fe80::fc4e:57ff:fe25:3433%Ethernet29/64  up/down       N/A             N/A
Ethernet30   Bridge    fe80::748d:ebff:fe1c:dade%Ethernet30/64  up/down       N/A             N/A
Ethernet31   Bridge    fe80::dc79:f3ff:fe1c:24ad%Ethernet31/64  up/down       N/A             N/A
Ethernet32   Bridge    fe80::68aa:aaff:fe2c:b383%Ethernet32/64  up/down       N/A             N/A
Ethernet33   Bridge    fe80::8448:a7ff:fe83:2c7c%Ethernet33/64  up/down       N/A             N/A
Ethernet34   Bridge    fe80::7057:85ff:fef9:76b4%Ethernet34/64  up/down       N/A             N/A
Ethernet35   Bridge    fe80::949d:79ff:fe9d:f7ac%Ethernet35/64  up/down       N/A             N/A
Ethernet36   Bridge    fe80::9445:8dff:fe2e:b7eb%Ethernet36/64  up/down       N/A             N/A
Ethernet37   Bridge    fe80::6424:ecff:fe9c:14ce%Ethernet37/64  up/down       N/A             N/A
Ethernet38   Bridge    fe80::c04a:56ff:fe43:375f%Ethernet38/64  up/down       N/A             N/A
Ethernet39   Bridge    fe80::9c5b:f7ff:fe89:b4ec%Ethernet39/64  up/down       N/A             N/A
Ethernet40   Bridge    fe80::ccc3:77ff:fe16:50d%Ethernet40/64   up/down       N/A             N/A
Ethernet41   Bridge    fe80::94bd:8cff:fe6f:6cf0%Ethernet41/64  up/down       N/A             N/A
Ethernet42   Bridge    fe80::3879:c7ff:fe65:9a65%Ethernet42/64  up/down       N/A             N/A
Ethernet43   Bridge    fe80::bc6b:fcff:fecc:3a69%Ethernet43/64  up/down       N/A             N/A
Ethernet44   Bridge    fe80::4894:feff:fe1f:8626%Ethernet44/64  up/down       N/A             N/A
Ethernet45   Bridge    fe80::64a4:a4ff:feb8:f4f6%Ethernet45/64  up/down       N/A             N/A
Ethernet46   Bridge    fe80::3867:94ff:fead:315%Ethernet46/64   up/down       N/A             N/A
Ethernet47   Bridge    fe80::90d4:f7ff:fe72:64e3%Ethernet47/64  up/down       N/A             N/A
Ethernet48             fe80::f089:7fff:fe72:4ba9%Ethernet48/64  up/up         N/A             N/A
Ethernet49             fe80::3031:35ff:fec7:a319%Ethernet49/64  up/down       N/A             N/A
Ethernet50             fe80::c8a9:4bff:febe:a832%Ethernet50/64  up/down       N/A             N/A
Ethernet51             fe80::5c07:69ff:fef8:3a03%Ethernet51/64  up/down       N/A             N/A
Ethernet52             fe80::e8b4:36ff:fe1b:389b%Ethernet52/64  up/down       N/A             N/A
Ethernet53             fe80::3446:8ff:fe7d:25c8%Ethernet53/64   up/down       N/A             N/A
Loopback0              fd0a:201::412/128                        up/up         N/A             N/A
                       fe80::80de:75ff:fef1:7494%Loopback0/64                 N/A             N/A
Vlan2                  fd5b:201::381/122                        up/down       N/A             N/A
                       fe80::5eff:35ff:fee7:3f8%Vlan2/64                      N/A             N/A
docker0                fd00::1/80                               up/down       N/A             N/A
                       fe80::1%docker0/64                                     N/A             N/A
eth0         mgmt      fe80::5eff:35ff:fee7:3f8%eth0/64         up/up         N/A             N/A
lo                     ::1/128                                  up/up         N/A             N/A
lo-m         mgmt      fe80::7a:95ff:fe6e:66ab%lo-m/64          up/up         N/A             N/A
root@labaz03-sb01181:~# 
root@labaz03-sb01181:~# show run al | grep mac
        "macsec": {
            "mac": "5c:ff:35:e7:03:f8",
        "macsec": {
        "macsec": {
root@sonic:~# 

root@sonic:~# show vlan br
+-----------+-------------------+------------+----------------+-------------+-----------------------+
|   VLAN ID | IP Address        | Ports      | Port Tagging   | Proxy ARP   | DHCP Helper Address   |
+===========+===================+============+================+=============+=======================+
|         2 | 172.29.48.129/26  | Ethernet0  | untagged       | disabled    | 10.76.183.11          |
|           | fd5b:201::381/122 | Ethernet1  | untagged       |             |                       |
|           |                   | Ethernet2  | untagged       |             |                       |
|           |                   | Ethernet3  | untagged       |             |                       |
|           |                   | Ethernet4  | untagged       |             |                       |
|           |                   | Ethernet5  | untagged       |             |                       |
|           |                   | Ethernet6  | untagged       |             |                       |
|           |                   | Ethernet7  | untagged       |             |                       |
|           |                   | Ethernet8  | untagged       |             |                       |
|           |                   | Ethernet9  | untagged       |             |                       |
|           |                   | Ethernet10 | untagged       |             |                       |
|           |                   | Ethernet11 | untagged       |             |                       |
|           |                   | Ethernet12 | untagged       |             |                       |
|           |                   | Ethernet13 | untagged       |             |                       |
|           |                   | Ethernet14 | untagged       |             |                       |
|           |                   | Ethernet15 | untagged       |             |                       |
|           |                   | Ethernet16 | untagged       |             |                       |
|           |                   | Ethernet17 | untagged       |             |                       |
|           |                   | Ethernet18 | untagged       |             |                       |
|           |                   | Ethernet19 | untagged       |             |                       |
|           |                   | Ethernet20 | untagged       |             |                       |
|           |                   | Ethernet21 | untagged       |             |                       |
|           |                   | Ethernet22 | untagged       |             |                       |
|           |                   | Ethernet23 | untagged       |             |                       |
|           |                   | Ethernet24 | untagged       |             |                       |
|           |                   | Ethernet25 | untagged       |             |                       |
|           |                   | Ethernet26 | untagged       |             |                       |
|           |                   | Ethernet27 | untagged       |             |                       |
|           |                   | Ethernet28 | untagged       |             |                       |
|           |                   | Ethernet29 | untagged       |             |                       |
|           |                   | Ethernet30 | untagged       |             |                       |
|           |                   | Ethernet31 | untagged       |             |                       |
|           |                   | Ethernet32 | untagged       |             |                       |
|           |                   | Ethernet33 | untagged       |             |                       |
|           |                   | Ethernet34 | untagged       |             |                       |
|           |                   | Ethernet35 | untagged       |             |                       |
|           |                   | Ethernet36 | untagged       |             |                       |
|           |                   | Ethernet37 | untagged       |             |                       |
|           |                   | Ethernet38 | untagged       |             |                       |
|           |                   | Ethernet39 | untagged       |             |                       |
|           |                   | Ethernet40 | untagged       |             |                       |
|           |                   | Ethernet41 | untagged       |             |                       |
|           |                   | Ethernet42 | untagged       |             |                       |
|           |                   | Ethernet43 | untagged       |             |                       |
|           |                   | Ethernet44 | untagged       |             |                       |
|           |                   | Ethernet45 | untagged       |             |                       |
|           |                   | Ethernet46 | untagged       |             |                       |
|           |                   | Ethernet47 | untagged       |             |                       |
+-----------+-------------------+------------+----------------+-------------+-----------------------+

root@sonic:~# less /etc/sonic/config_db.json | jq .INTERFACE
{
  "Ethernet48": {
    "ipv6_use_link_local_only": "enable"
  }
}

getting correct ip after a flap >>>>>>>>>>>>>>>>>
root@sonic:~# config interface shut Ethernet48
^[[Aroot@sonic:~# config interface start Ethernet48
[134804.010616] IPv6: ADDRCONF(NETDEV_CHANGE): Ethernet48: link becomes ready
root@sonic:~# show ipv6 int | grep Ethernet48
Ethernet48             fe80::5eff:35ff:fee7:3f8%Ethernet48/64   up/up         N/A             N/A 
root@sonic:~# 

I tried setting following kernel parameters but no luck.
net.ipv6.conf.default.addr_gen_mode=0 - generates random addresses for each interface
net.ipv6.conf.default.addr_gen_mode=1 - doesn't generate any v6 addresses
net.ipv6.conf.default.addr_gen_mode=2 - doesn't generate any v6 addresses
net.ipv6.conf.default.addr_gen_mode=3 - generates random addresses for each interface

Expected result:
All the interface must be having e80::5eff:35ff:fee7:3f8 Ipv6 LL IP, not the random ones.
Additionally, the interfaces which are part of bridge should not receive the IPv6 LL ip.

Version:
Platform: arm64-wistron_es1227_54ts-r0
HwSKU: wistron_es1227_54ts
ASIC: marvell
ASIC Count: 1
Serial Number: 68104P01001040300002M0SA
Model Number: ES-1227-54TS-O
Hardware Revision: 0

SONIC version: 202211

@nmoray
Copy link
Contributor Author

nmoray commented Jan 15, 2025

@madhupalu @zhangyanzhao can you please help assigning the right reviewers.

@prsunny
Copy link
Contributor

prsunny commented Jan 15, 2025

Is this a platform specific issue or are you seeing on all platforms?

@nmoray
Copy link
Contributor Author

nmoray commented Jan 16, 2025

Is this a platform specific issue or are you seeing on all platforms?

Presently, I am seeing it on ES1227 platform only. But need to understand who is responsible for generating ipv6 LL addresses, is it kernel or SAI?

@vdahiya12 vdahiya12 added the Triaged this issue has been triaged label Jan 29, 2025
@vdahiya12
Copy link
Contributor

@nmoray to check if mac_address is correct on the kernel interface, and does it get changed before and after ipv6 link local setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged this issue has been triaged
Projects
None yet
Development

No branches or pull requests

3 participants