Skip to content

Instantly share code, notes, and snippets.

@ipid
Created August 19, 2022 11:15
Show Gist options
  • Save ipid/ae8780a58a3a334599cc69bdd4173ac8 to your computer and use it in GitHub Desktop.
Save ipid/ae8780a58a3a334599cc69bdd4173ac8 to your computer and use it in GitHub Desktop.
Wireguard DMZ 示例,一条命令让你轻松拥有公网地址。An example of Wireguard DMZ configuration that provides you a public IPv4 address.
[Interface]
Address = 10.0.0.1/24
PrivateKey = ******************************************
ListenPort = 51000
DNS = 223.5.5.5
PostUp = iptables -t nat -F; iptables -t nat -A PREROUTING -p tcp -m multiport --dports 1024:50999,51001:65534 -i eth0 -j DNAT --to-destination 10.0.0.2; iptables -t nat -A PREROUTING -p udp -m multiport --dports 1024:50999,51001:65534 -i eth0 -j DNAT --to-destination 10.0.0.2; iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE
PostDown = iptables -t nat -F
[Peer]
AllowedIPs = 10.0.0.2/32
PublicKey = 4U86nUqmAa8QK5HEPOULfgHGGfYxOcD7E8UK16FWqD8=
PersistentKeepalive = 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment