
wan0
2 つのインターフェースとがありますwg0
。ルーティング テーブルは次のようになります。
::1 dev lo proto kernel metric 256 pref medium
2a0c:xxx:yyy:zz00::/56 dev wg0 proto static metric 20 pref medium
2a0c:xxx::/32 dev wan0 proto kernel metric 256 pref medium
2a0c:xxx::/32 dev wan0 proto ra metric 1024 expires 2591957sec pref medium
fe80::/64 dev wan0 proto kernel metric 256 pref medium
default proto static metric 1024 pref medium
nexthop via 2a0c:xxx::1 dev wan0 weight 1
nexthop via fe80::****:****:****:3780 dev wan0 weight 1
dns.google
インターフェースからping を実行しようとするとwg0
、パケットがwan0
インターフェースにリダイレクトされません。なぜでしょうか?
インターフェース上の tcpdump はwg0
次のようになります。
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, echo request, id 1, seq 5093, length 40
IP6 2a0c:xxx:yyy::1 > 2a0c:xxx:yyy:zz60::wwww: ICMP6, destination unreachable, unreachable address dns.google, length 88
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, echo request, id 1, seq 5094, length 40
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, neighbor solicitation, who has dns.google, length 26
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, neighbor solicitation, who has dns.google, length 26
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, neighbor solicitation, who has dns.google, length 26
IP6 2a0c:xxx:yyy::1 > 2a0c:xxx:yyy:zz60::wwww: ICMP6, destination unreachable, unreachable address dns.google, length 88
IP6 2a0c:xxx:yyy:zz60::wwww > dns.google: ICMP6, echo request, id 1, seq 5095, length 40
ip -6 r get でルートを確認すると、正しいルートが表示されます (2001:4860:4860::8888 は dns.google です)。
❯ ip -6 r get to 2001:4860:4860::8888 from 2a0c:xxx:yyy:zz60::wwww iif wg0
2001:4860:4860::8888 from 2a0c:xxx:yyy:zz60::wwww via 2a0c:xxx::1 dev wan0 proto static metric 1024 iif wg0 pref medium
パケットが wan0 インターフェイスにリダイレクトされることもありますが、これは非常にまれにしか発生しません。