################################################## /etc/network/interfaces ################################################## auto wg0 iface wg0 inet manual pre-up ip link add dev wg0 type wireguard pre-up ip address add 192.168.2.2 peer 192.168.2.1 dev wg0 pre-up wg setconf wg0 /etc/wireguard/wg0.conf up ip link set up dev wg0 post-up ip rule add from 192.168.2.0/24 table WGNYC post-up ip route add default via 192.168.2.1 table WGNYC down ip link del dev wg0 ################################################## /etc/wireguard/wg0.conf ################################################## [Interface] PrivateKey = cIMu6L8THDyQLaoQeDw6x4ddjEva8D/fnvKUJbaYP24= ListenPort = 41920 [Peer] PublicKey = DqnU34h2a3tw2GZyi+tpkhk4VQurA3A/7RF2QEGV9Ag= Endpoint = $OTHER_ENDPOINT_IP_HERE:41920 AllowedIPs = 0.0.0.0/0, $OTHER_ENDPOINT_IP_HERE/24, 192.168.2.0/24 PersistentKeepalive = 21 ################################################## /etc/rc.local ################################################## #!/bin/sh -e ip rule add from 10.9.0.0/24 table DALLAS ip route add default via 10.9.0.1 table DALLAS ip rule add from 192.168.2.0/24 table WGNYC ip route add default via 192.168.2.1 table WGNYC exit 0