Forward Wireguard traffic to ETH1
I setup a wireguard server with AWS, setup the wireguard client with a raspberry PI.
Now I need to redirect the WG traffic (wg0) to eth1
-- my goal is to get a IP from my WG server when a client is connected to the PI eth1 (Full tunnel)
my WG config
[Interface]
Address = 10.1.1.1/24
ListenPort = 51820
PrivateKey = ##
PostUp = iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = ##
AllowedIPs = 10.1.1.2/32
I installed Netplan but I'm very lost with the config (I need to sent WG0 traffic to ETH1)
does the follow config make sense : (probably not...)
network:
version: 2
renderer: networkd
bonds:
bond0:
dhcp4: yes
interfaces:
- wg0
- eth1
parameters:
primary: wg0
It's would be even better for the Raspberry PI to joint my UniFi VLAN (uplink) and get an IP from there but still sent/receive all the traffic from WG server but that's to complex for me I guess
UPDATE: should I add the WG config to Netplan?
tunnels:
wg0:
mode: wireguard
addresses: 10.1.1.1/24
peers:
- keys:
Public_key?
...
key: Private_key?
network:
version: 2
renderer: networkd
bonds:
bond0:
dhcp4: yes
interfaces:
- wg0
- eth1
parameters:
primary: wg0