diff --git a/worker.py b/worker.py index f10e3c8..500c9dd 100644 --- a/worker.py +++ b/worker.py @@ -313,14 +313,17 @@ PersistentKeepalive = {persistent_keepalive} ssh_execute_command(server_ip, f"echo '{wg_config}' > /etc/wireguard/wg0.conf") ssh_execute_command(server_ip, "wg-quick up wg0") - # Configure ip6tables - ip6tables_rules = [ + # Configure ip(6)tables + iptables_rules = [ "ip6tables -A FORWARD -i wg0 -j ACCEPT", "ip6tables -A FORWARD -o wg0 -j ACCEPT", "ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE", + "iptables -A FORWARD -i wg0 -j ACCEPT", + "iptables -A FORWARD -o wg0 -j ACCEPT", + "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE", ] - for rule in ip6tables_rules: + for rule in iptables_rules: ssh_execute_command(server_ip, rule) @@ -360,6 +363,7 @@ def main(provider, location, server_type): "apt update", "apt install -y wireguard", "echo 'net.ipv6.conf.all.forwarding=1' >> /etc/sysctl.conf", + "echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf", "sysctl -p", ]