Homepage Forums IPv6 Learning Lounge Configure Basic IPv6 Configure, Verify and Troubleshoot IPv6 on Linux

  • Marek

    Member
    January 8, 2025 at 2:33 pm
    5 HPs
    0 QPs
    411 XPs

    Mhh, ifconfig is obsolete on Linux and has been replaced by ip. The IPv4 and IPv6 neighbors can also be displayed with ip neighbor and ip -6 neighbor respectively. For the routing table, the classic way is to use ip route or ip -6 route. netplan has only limited capabilities if you want to configure an interface specifically – furthermore, in my experience it is also more of an Ubuntu thing. On user computers, NetworkManager is often used instead.

    Translated with DeepL.com (free version)

  • Ayobola Ashogbon

    Member
    November 5, 2025 at 1:08 pm
    40 HPs
    0 QPs
    1918 XPs

    Ipv6 on Linux CLI is very similar to Mac CLI

    • Vincent Onyango

      Member
      April 29, 2026 at 8:54 pm
      190 HPs
      0 QPs
      1908 XPs

      true

  • Ayobola Ashogbon

    Member
    November 5, 2025 at 1:10 pm
    40 HPs
    0 QPs
    1918 XPs

    Also, a few of the commands on Linux CLI needs to be updated from what is on the program

  • Jaco Kroon

    Member
    November 5, 2025 at 11:08 pm
    5 HPs
    0 QPs
    2182 XPs

    For those looking to use iproute2 package (replacement for ifconfig etc … tool used underlying by various configuration methods):

    To add an ipv6 address to an interface, eg eth0:

    ip ad ad 2001:db8::dead:beef/64 dev eth0

    To list the addresses:

    ip [-6] li sh dev eth0 (with -6 will limit to ipv6 addresses, without will list all, including link-layer addresses).

    To add/remove routes:

    ip -6 ro {ad|del} default via fe80::???? dev eth0

    It’s also possible to add via global addressing, but typically LL is used, for example:

    ip -6 ro ad default via 2001:db8::1 metric 20000

    Routing table can be shows with:

    ip -6 ro sh

    Here -6 is important because by default ip ro sh will show the v4 routing table. If you’re using routing rules, the rules can be shown with:

    ip -6 rule show

    And specific referenced routing tables can be shown with:

    ip -6 ro sh table xyz

    ip -6 neigh show

    Will show the neighbour cache, ip neigh can also be used for ipv4, not only to show, but also manipulate the in-kernel neighbour caches.

    One other neat feature when SLAAC is in effect is that you can set a “token” that will be used to populate the host portion of the address, in server environments this can for example be used to sync with the static ipv4 address whilst obtaining the prefix from SLAAC, it should be noted that this is an unusual syntax for IPv6, but valid:

    ip token add ::192.168.0.1 dev eth0

    ip token list will throw this back at you:

    plastiekpoot [20:59:59] ~ # ip token list

    token :: dev wlp2s0
    token ::192.168.0.1 dev eth0

    This looks odd, but keep in mind the special IPv4 mapped v6 addresses are of the form:

    ::ffff:a.b.c.d

    Where a.b.c.d is quite literally an IPv4 address (32 bits) mapped into the last 32 bits of an IPv6 address. This same syntax is perfectly valid elsewhere on at least Linux, and the *assumption* for IP tokens (all documentation I find is Linux, and one article referencing Windows, but Mikrotik has a similar concept at least, I’m unable to locate an RFC on the matter).

    What I mean with valid elsewhere is that you could embed IPv4 addresses into global unicast addresses too:

    # ip ad ad 2001:db8::192.168.0.1/64 dev eth0
    # ip ad sh dev eth0 scope global
    870: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 34:48:ed:8d:d4:61 brd ff:ff:ff:ff:ff:ff
    altname enp58s0u1u2
    inet6 2001:db8::c0a8:1/64 scope global tentative
    valid_lft forever preferred_lft forever

    Note that 192 converted to hex is c0, 168 => a8, and 0.1 is 0001 or simply 1 by compression.

    • samson Mawisire

      Member
      November 26, 2025 at 12:44 am
      200 HPs
      6 QPs
      2719 XPs

      Thank you for great the explanation

    • DICKSON KASANO

      Member
      April 11, 2026 at 1:13 pm
      75 HPs
      4 QPs
      502 XPs

      well explained

  • Andrew McGill

    Member
    November 6, 2025 at 12:38 pm
    15 HPs
    0 QPs
    1916 XPs

    “netstat -rn -A inet6” is not standard equipment on current Ubuntu. Half of the functionality has moved to “ss” (socket info), and the rest is in things like “ip -6 route”

Log in to reply.