Skip to content

ip neigh doesn't output the lladdr address #68

Closed

Description

@san3Xian

iproute2mac/src/ip.py

Lines 628 to 634 in 3611afd

for nb in neighs:
print(
nb["dst"] +
("", " dev " + nb["dev"], "")[dev is None] +
("", " router")[nb["router"]] +
" %s" % (nb["status"][0])
)

Why does the ip neighbour show command in iproute2mac not output the lladdr address? Is there any specific concern or reason behind this?

In Linux, when using the ip n command with iproute2, it outputs the lladdr address.

root@ubu22-dns-v2:~# ip -4 n
192.168.140.1 dev eth0 lladdr aa:aa:aa:aa:aa:aa REACHABLE
root@ubu22-dns-v2:~#

Maybe we can implement it using the following method?

        print(
            nb["dst"] +
            ("", " dev " + nb["dev"], "")[dev is None] +
            ("", " router")[nb["router"]] +
            (" lladdr " + (nb.get("lladdr") or ""), "")[nb.get("lladdr") is None] + 
            " %s" % (nb["status"][0])
            
        )

Activity

  1. changed the title [-]hope the `ip neigh` command can output the lladdr address.[/-] [+]hope the `ip neigh` command can output the lladdr address[/+] on Apr 30, 2025
  2. changed the title [-]hope the `ip neigh` command can output the lladdr address[/-] [+]hope the `ip neigh` command can output the `lladdr` address[/+] on Apr 30, 2025
  3. brona commented on Jul 31, 2025

    @brona
    Owner

    Fixed in 0f8bea2, will be released within a week or so.

  4. changed the title [-]hope the `ip neigh` command can output the `lladdr` address[/-] [+]`ip neigh` doesn't output the `lladdr` address[/+] on Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions