I have a public IPv6 address but not an IPv4. Therefore I want to route the traffic via a VPS with a public IPv4 and an IPv6 address. My question is how to create this type of tunnel with Wireguard. The tunnel from the VPS to a device in my network is not the challenge, but rather how to redirect the packets on the server to that tunnel.
I've done a bit of research and my approach would look like this.
My Network device
[Interface]
Address = <DEVICE IPv6>
PrivateKey = <private key>
ListenPort = <DEVICE PORT>
# Peer to VPS
[Peer]
PublicKey = [PUBLIC KEY VPS]
AllowedIPs = [VPS IPv6]
Endpoint = [VPS IPv6]:[VPS PORT]
VPS
[Interface]
Address = <VPS IPv6>
Address = <VPS IPv4>
PrivateKey = <private key>
ListenPort = <VPS PORT>
# Peer to device
[Peer]
PublicKey = [PUBLIC KEY DEVICE]
Endpoint = [DEVICE IPv6]:[DEVICE PORT]
AllowedIPs = 0.0.0.0/0, ::/0
# Example peer of client
[Peer]
PublicKey = <client public key>
AllowedIPs = 0.0.0.0/0, ::/0
Example Client
[Interface]
PrivateKey = <private key>
ListenPort = <CLIENT PORT>
[Peer]
PublicKey = [PUBLIC KEY VPS]
Endpoint = [VPS IPv4]:[VPS PORT], [VPS IPv6]:[VPS PORT]
AllowedIPs = 0.0.0.0/0
Is this possible? Or do I need to create two WG interfaces and route the traffic between?