Tunneling Network via Wireguard DHCP?

Hello,
i have two networks which should be connected via wireguard to create on big network with only one DHCP-Server
The wireguard-"server" (in Network1) works fine. I'm able to connect to it and ping all devices in Network1 from Network2.


The problem is that at the moment both router are working as DHCP-Server. But only the router of Network 1 should be a DHCP-Server and give the ip-adresses via wireguard to the devices in Network2.
Can somebody help me?
Greetings
Dirtrunner

I am not sure if that is even possible as WireGuard is strictly layer 3 (i.e. routed), I have setup something like this with OpenVPN tap interface.

Maybe someone has devised a clever workaround?

1 Like

first of all, wireguard operates at layer 3, so it's easier to handle this by routing. by far the easiest is to abandon ipv4 entirely and just use ipv6. seriously.

but suppose you really need the two sites to share a broadcast domain. Then I think you will have to set up gretap over the wireguard tunnel, and make the lan on each end bridged with the gretap interface.

2 Likes

I'd rather use a dhcp relay because you run a layer 3 tunnel with wireguard for a reason so you don't bring all the broadcast /multicast garbage into the tunnel and onto the other side of the tunnel. If you prefer to have a layer 2 VPN you could actually either go with GRE or just use OpenVPN in tap mode.

if they aren't on the same broadcast domain then you might as well just route everything, at which point just run a separate DHCP server... or better yet just use ipv6 and abandon ipv4.