jotyGill / openpyn-nordvpn

Easily connect to and switch between, OpenVPN servers hosted by NordVPN on Linux (+patch leakes)
GNU General Public License v3.0
628 stars 114 forks source link

add ICMP in "--allow" arguments #238

Open Kipjr opened 4 years ago

Kipjr commented 4 years ago

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 commented 4 years ago

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