11 lines
529 B
Django/Jinja
11 lines
529 B
Django/Jinja
[Interface]
|
|
Address = {{ server_ip }}
|
|
ListenPort = {{ server_port }}
|
|
PrivateKey = {{ server_private_key.stdout }}
|
|
|
|
# Enable IPv4 forwarding
|
|
PostUp = sysctl -w net.ipv4.ip_forward=1
|
|
# NAT configuration (adjust eth0 to your outbound interface if different)
|
|
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
|
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
|