Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Oracle - /etc/wireguard/wg0.conf
- ================================
- [Interface]
- PrivateKey = xxx
- ListenPort = 55108
- Address = 10.0.0.1/24
- PostUp = iptables -t nat -A PREROUTING -p tcp -i ens3 --match multiport --dports 32400 -j DNAT --to-destination 10.0.0.2
- PostUp = iptables -t nat -A POSTROUTING -o ens3 -j SNAT --to-source 10.0.0.151
- PostDown = iptables -t nat -D PREROUTING -p tcp -i ens3 --match multiport --dports 32400 -j DNAT --to-destination 10.0.0.2
- PostDown = iptables -t nat -D POSTROUTING -o ens3 -j SNAT --to-source 10.0.0.151
- [Peer]
- PublicKey = xxx
- AllowedIPs = 10.0.0.2/32
- Local Docker - /config/wg0.conf
- ===============================
- [Interface]
- PrivateKey = xxx
- Address = 10.0.0.2/24
- PostUp = DROUTE=$(ip route | grep default | awk '{print $3}'); HOMENET=192.168.0.0/16; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route add $HOMENET3 via $DROUTE; ip route add $HOMENET2 via $DROUTE; ip route add $HOMENET via $DROUTE; iptables -I OUTPUT -d $HOMENET -j ACCEPT; iptables -A OUTPUT -d $HOMENET2 -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; HOMENET2=10.0.0.0/8; HOMENET3=172.16.0.0/12; ip route delete $HOMENET; ip route delete $HOMENET2; ip route delete $HOMENET3; 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 $HOMENET2 -j ACCEPT; iptables -D OUTPUT -d $HOMENET3 -j ACCEPT
- [Peer]
- PublicKey = xxx
- AllowedIPs = 0.0.0.0/0
- Endpoint = [Oracle public IP address]:55108
- PersistentKeepalive = 25
Advertisement
Add Comment
Please, Sign In to add comment