fix: add iptables package and simplify iptables rules
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
- Add iptables package in Dockerfile alongside iptables-legacy for compatibility. - Remove redundant `-m tcp` from iptables commands in set_gateway.sh since `-p tcp` already implies the TCP module when using `--dport`.
This commit is contained in:
+4
-4
@@ -5,10 +5,10 @@ IP_GATEWAY=$(route -n | grep 'UG[ \t]' | awk '{print $2}');
|
||||
route add -host $ENDPOINT gw $IP_GATEWAY;
|
||||
|
||||
# temporary added iptables lines
|
||||
iptables-legacy -t nat -I PREROUTING -i wg0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 172.18.103.2:80
|
||||
iptables-legacy -t nat -I PREROUTING -i wg0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 172.18.103.2:443
|
||||
iptables-legacy -t nat -I POSTROUTING -d 172.18.103.0/24 -p tcp -m tcp --dport 80 -j MASQUERADE
|
||||
iptables-legacy -t nat -I POSTROUTING -d 172.18.103.0/24 -p tcp -m tcp --dport 443 -j MASQUERADE
|
||||
iptables-legacy -t nat -I PREROUTING -i wg0 -p tcp --dport 80 -j DNAT --to-destination 172.18.103.2:80
|
||||
iptables-legacy -t nat -I PREROUTING -i wg0 -p tcp --dport 443 -j DNAT --to-destination 172.18.103.2:443
|
||||
iptables-legacy -t nat -I POSTROUTING -d 172.18.103.0/24 -p tcp --dport 80 -j MASQUERADE
|
||||
iptables-legacy -t nat -I POSTROUTING -d 172.18.103.0/24 -p tcp --dport 443 -j MASQUERADE
|
||||
# need to remove after service-exec go update
|
||||
|
||||
/etc/wireguard/persistentkeepalive.sh &
|
||||
|
||||
Reference in New Issue
Block a user