Link-local and global IPs on IPv6 interfaces

后端 未结 2 1291
谎友^
谎友^ 2021-02-01 10:27

I\'m currently trying to understand how IPv6 adresses work. There are link-local and site-local adresses used for small and organisational networks respectively. But if one of t

2条回答
  •  抹茶落季
    2021-02-01 11:17

    Every interface has a link-local address and optionally one or more public or site-local addresses. Looks like this:

    $ ip -o -6 addr show dev eth0
    eth0    inet6 2001:abcd:ef::1/64 scope global (..)
    eth0    inet6 fe80::1234:5678:2/64 scope link (...)
    

    When sending something, everything sent to a link-local address (i.e. fe80::/64) is sent from the link-local address, everything else from the global one.

    (The choice is not always possible: e.g. if answering to a ping, the source IP of the answer will be the destination IP of the request, no matter which address.)

提交回复
热议问题