First page Back Continue Last page Overview Graphics

Internet gateway: SVR

# svr.wg0.conf

[Interface] # Server can address all of 10.0.0.0/24

Address = 10.0.0.1/24

ListenPort = 51820

PrivateKey = SERVER_PRIVATE_KEY_WE_CREATED

# Internet Gateway: nat wg0 out to internet on eth0

PostUp = iptables -A FORWARD -i wg0 -j ACCEPT;

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

PostDown = iptables -D FORWARD -i wg0 -j ACCEPT;

iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]

# client1

PublicKey = CLIENT_PUBLIC_KEY_WE_CREATED

# This specific client can only occupy 10.0.0.2

AllowedIPs = 10.0.0.2/32