-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Is it possible to specify PreUp/PostDown rules for an interface? Something like:
[Interface]
PrivateKey = xxxx
Address = 10.0.0.2/32
ListenPort = 51822
# IP forwarding
PreUp = sysctl -w net.ipv4.ip_forward=1
# IP masquerading (source NAT)
PreUp = iptables -t mangle -A PREROUTING -i wg0 -j MARK --set-mark 0x30
PreUp = iptables -t nat -A POSTROUTING ! -o wg0 -m mark --mark 0x30 -j MASQUERADE
PostDown = iptables -t mangle -D PREROUTING -i wg0 -j MARK --set-mark 0x30
PostDown = iptables -t nat -D POSTROUTING ! -o wg0 -m mark --mark 0x30 -j MASQUERADE
[Peer]
PublicKey = xxxx
AllowedIPs = 10.0.0.1/32
Thanks
Metadata
Metadata
Assignees
Labels
No labels