Connect to wireguard service with LAN not blocked

I have an issue with my wireguard tunnel. Im trying to set it up in a routed lxc with the lan intact. The containers networking works fine but im showing the config so you can see.

The issue is that i cant get the tunnel and the lan to work at the same time. If i set allowed ips to 0.0.0.0/0 the tunnel works fine. But the lan is gone. I tried different versions of allowed ips like “https://www.reddit.com/r/WireGuard/comments/awudup/how_to_exclude_local_network_packets_from/ehp7euo/?utm_source=share&utm_medium=web2x&context=3

I also tried some others i found but nothing. When im using the one above i get a handshake and lan works. But no internet. Cant ping anything outside my network. ufw is disabled in the container. ssh also stops working on this one, but i can ping my host.

Im using the wg-quick. Any help?

config:
user.network-config: |
version: 2
ethernets:
eth0:
addresses:
- 192.168.1.200/32
nameservers:
addresses:
- 192.168.1.1
search: []
routes:
- to: 0.0.0.0/0
via: 169.254.0.1
on-link: true
description: “”
devices:
eth0:
ipv4.address: 192.168.1.200
nictype: routed
parent: eno1np0
type: nic

netstat -rn with wireguard off.
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 169.254.0.1 0.0.0.0 UG 0 0 0 eth0

Are you trying to add 2 default routes at the same time?

No. But i found the problem. I used ubuntu 22.04. After a clean install and use of 20.04 the route works. may be a wg-quick problem

1 Like