Score:0

Routing does not work

cn flag

I have two interfaces wan0 and wg0. The routing table looks like this:

::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

When I try to ping dns.google from the wg0 interface, the packets are not redirected to the wan0 interface. Why?


tcpdump on the wg0 interface gives something like this:

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

Checking the route via ip -6 r get shows the correct route (2001:4860:4860::8888 is 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

Sometimes packets are still redirected to the wan0 interface, but this happens very rarely.

drookie avatar
za flag
Did you set the `net.ipv4.ip_forward` to 1 ?
async await avatar
cn flag
@drookie Yes, both `net.ipv4.ip_forward` and `net.ipv6.conf.all.forwarding` are set to 1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.