How to see through which interface / default gateway / default IP in ipv6 packets are going

Use the following command to determine through which IPv6 gateway IPv6 packets are going:

ip -6 route get 2606:4700:4700::1111

In the first instance, the network interface card (NIC) decided that it’s going to use `2c0f:ef18:9fff:1:50a1:d0ff:fe00:309f` as the source (originating) IPv6 address when sending packets.

(replace 2606:4700:4700::1111 with any external IPv6 address like a Google DNS 2001:4860:4860::8888)

ip -6 route get 2606:4700:4700::1111700:4700::1111
2606:4700:4700::1111 from :: via fe80::d601:c3ff:fe00:de9a dev eth0 proto ra src 2c0f:ef18:9fff:1:50a1:d0ff:fe00:309f metric 1024 pref medium

In the second instance, after disabling a bad IPv6 address on the main route, the server originated to the correct IP address. This was important because SPF was bound to just one IP address and Google sent back PTR NDRs.

ip -6 route get 2606:4700:4700::1111
2606:4700:4700::1111 from :: via fe80::d601:c3ff:fe00:de9a dev eth0 proto ra src 2c0f:ef18:9fff:1::f metric 1024 pref medium

Linux Default Behavior

•If you have a dynamic IPv6 address (mngtmpaddr), Linux often prefers using a temporary address for outgoing connections unless explicitly disabled.

•If you have a static global address (2c0f:ef18:9fff:1::f), it may be used if there are no temporary addresses available or if the application prefers it.

•If an address has noprefixroute, it means it won’t be automatically used unless explicitly set.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *