-
Notifications
You must be signed in to change notification settings - Fork 1
/
wg0.conf
13 lines (11 loc) · 868 Bytes
/
wg0.conf
1
2
3
4
5
6
7
8
9
10
11
12
[Interface]
Address = X.X.X.X/32
PrivateKey = XXXXXXXXXXXXXX
DNS = xxxxxxxxxxxx
MTU = 1400
PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE; ip route add $HOMENET via $DROUTE;iptables -I OUTPUT -d $HOMENET -j ACCEPT; iptables -A OUTPUT -d $HOMENET3 -j ACCEPT; iptables -A OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT
PreDown = HOMENET=192.168.0.0/16; HOMENET3=172.16.0.0/12; ip route del $HOMENET3 via $DROUTE ip route del $HOMENET via $DROUTE; iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT; iptables -D OUTPUT -d $HOMENET -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT
[Peer]
Endpoint = xxxxxxxxxx
PublicKey = xxxxxxxxxxxx
AllowedIPs = 0.0.0.0/0, ::/0