openpyn-nordvpn icon indicating copy to clipboard operation
openpyn-nordvpn copied to clipboard

add ICMP in "--allow" arguments

Open Kipjr opened this issue 4 years ago • 1 comments

To firewall.py:

# open sepecified ports for devices in the local network
def internally_allow_ports(interfaces_details: List, internally_allowed: List) -> None:
    for interface in interfaces_details:
        # if interface is active with an IP in it, and not "tun*"
        if len(interface) == 3 and "tun" not in interface[0]:
            # Allow the specified ports on internal network
            for port in internally_allowed:

Add this block

                if port.isdigit():
                subprocess.call(
                    ("sudo iptables -A INPUT -p tcp --dport " + port + " -i " +
                        interface[0] + " -s " + interface[2] + " -j ACCEPT").split())

Add this block:

                 else:
                     switch (port) {
                         ICMP :   
                              subprocess.call(
                        ("sudo iptables -A INPUT -p icmp --icmp-type echo-request " + " -i " +
                            interface[0] + " -s " + interface[2] + " -j ACCEPT").split())
                              break;
                         default: continue;

Kipjr avatar Aug 31 '19 22:08 Kipjr

I'm unable to ping a local VM with Openpyn installed. So thought this could resolve this.

Kipjr avatar Aug 31 '19 22:08 Kipjr