Connect Two OpenWrt Networks over the Internet with WireGuard

Build an OpenWrt WireGuard tunnel to interconnect two LANs over the Internet.

Goal

Bridge two separate LANs through an encrypted WireGuard tunnel while keeping existing Internet access.

Requirements

  • At least one side has reachable public address/DDNS
  • Both sides run OpenWrt with WireGuard installed

Key steps

  1. Generate key pairs:
1
2
wg genkey | tee privatekey1 | wg pubkey > publickey1
wg genkey | tee privatekey2 | wg pubkey > publickey2
  1. Configure interfaces and peers on both routers.
  2. Set routes/firewall rules to allow cross-LAN access.
记录并分享
Built with Hugo
Theme Stack designed by Jimmy