Wireguard between openwrt and lxc debian works great. When I try to ping from PC 192.168.130.209 to 192.168.1.2, the ping works correctly.
I run tcpdump on PC 192.168.1.2 and there I see that the ping is coming from IP 192.168.1.111 and that is the IP address of the wireguard server (see the picture).
How to achieve the state that the ping comes from IP 10.10.0.3.
Yes disable NAT. Since the ping replies will then be coming from the actual IP of the PC beyond LXC, you'll also need to install 192.168.1.0/24 as an allowed_ip on the OpenWrt end of the wireguard tunnel.
I use several WG interfaces in one LXC (wg0, wg1 ...). I use masquerade for wg0 interface and not for wg1. When I stop the wg0 interface and masquerade is not used, it works.
Ping from PC 192.168.130.209 to 192.168.1.2
tcpdump running on PC 192.168.1.2
08:40:36.242152 IP 192.168.130.209 > 192.168.1.2: ICMP echo request, id 2378, seq 37, length 64
08:40:36.242166 IP 192.168.1.2 > 192.168.130.209: ICMP echo reply, id 2378, seq 37, length 64
08:40:37.245839 IP 192.168.130.209 > 192.168.1.2: ICMP echo request, id 2378, seq 38, length 64
08:40:37.245848 IP 192.168.1.2 > 192.168.130.209: ICMP echo reply, id 2378, seq 38, length 64
08:40:38.245558 IP 192.168.130.209 > 192.168.1.2: ICMP echo request, id 2378, seq 39, length 64
08:40:38.245566 IP 192.168.1.2 > 192.168.130.209: ICMP echo reply, id 2378, seq 39, length 64
Look at my first post, last sentence
How to achieve the state that the ping comes from IP 10.10.0.3.
Is it even possible ?
Then the IP address 192.168.130.209 should be masked as the IP address 10.10.0.3, but it doesn't work that way.
If I ping from the openwrt router and carefully check tcpdump on the other one, it's OK.
ping 192.168.130.209
PING 192.168.130.209 (192.168.130.209) 56(84) bytes of data.
64 bytes from 192.168.130.209: icmp_seq=1 ttl=62 time=73.0 ms
64 bytes from 192.168.130.209: icmp_seq=2 ttl=62 time=78.1 ms
I still see the response from the real IP and not from the WG IP 10.10.0.1.
08:26:56.594351 IP 192.168.1.2 > 192.168.130.209: ICMP echo request, id 3, seq 22, length 64
08:26:56.594403 IP 192.168.130.209 > 192.168.1.2: ICMP echo reply, id 3, seq 22, length 64
08:26:57.598425 IP 192.168.1.2 > 192.168.130.209: ICMP echo request, id 3, seq 23, length 64
08:26:57.598455 IP 192.168.130.209 > 192.168.1.2: ICMP echo reply, id 3, seq 23, length 64