Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Why can't a WireGuard interface route packets to itself?





On 31/07/23 02:18, logothesia wrote:
Hi folks,

I have a very simple WG network with only two machines: 10.0.0.1 (NetBSD), and
10.0.0.2 (linux). Indeed they can ping each other just fine, but attempting to
ping 10.0.0.1 from itself yields the following error:

% ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes
ping: sendto: No route to host
...

Is this intended behavior? If so, it seems very strange to me. Here is my
routing table:

% netstat -rn
Internet:
Destination        Gateway            Flags    Refs      Use    Mtu Interface
...
10/8               10.0.0.1           U           -        -      -  wg0
10.0.0.1           wg0                UHl         -        -      -  wg0
...

Looks fine, no?

It does look a bit different from ppoe0 which I chose because it is probably the closest thing I have to a WireGuard interface.

I get the following from netstat and it looks like pppoe adds a route via localhost to itself. Beware of possible line wrapping.

drumhunter$ netstat  -rnfinet
Routing tables

Internet:
Destination Gateway Flags Refs Use Mtu Interface
default            114.23.164.222     US          -        -      -  pppoe0
...
114.23.17.255      114.23.164.222     UH          -        -      -  pppoe0
114.23.164.222     pppoe0             UHl         -        -      -  lo0
127/8              127.0.0.1          UGRS        -        -  33624  lo0
127.0.0.1          lo0                UHl         -        -  33624  lo0
...

Cheers,
Lloyd


Home | Main Index | Thread Index | Old Index