-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling meshnet breaks forwarding rules for masqueraded/forwarded traffic for the lan. #659
Comments
nordvpn settings |
Hi, thank you for your feedback. I was able to reproduce it. Would it work to use meshnet routing from other devices instead? |
HI, these are the rules in the forward chain when meshnet is enabled.
…-P FORWARD DROP
-A FORWARD -o wlp1s0f0 -m comment --comment nordvpn-exitnode-transient -j
DROP
-A FORWARD -o end0 -m comment --comment nordvpn-exitnode-transient -j DROP
-A FORWARD -s 100.64.0.0/10 -d 169.254.0.0/16 -m comment --comment
nordvpn-exitnode-transient -j DROP
-A FORWARD -s 100.64.0.0/10 -d 192.168.0.0/16 -m comment --comment
nordvpn-exitnode-transient -j DROP
-A FORWARD -s 100.64.0.0/10 -d 172.16.0.0/12 -m comment --comment
nordvpn-exitnode-transient -j DROP
-A FORWARD -s 100.64.0.0/10 -d 10.0.0.0/8 -m comment --comment
nordvpn-exitnode-transient -j DROP
-A FORWARD -s 100.125.63.180/32 -m comment --comment
nordvpn-exitnode-transient -j ACCEPT
-A FORWARD -d 100.64.0.0/10 -m conntrack --ctstate RELATED,ESTABLISHED -m
comment --comment nordvpn-exitnode-permanent -j ACCEPT
-A FORWARD -d 100.64.0.0/10 -m comment --comment nordvpn-exitnode-permanent
-j DROP
-A FORWARD -s 100.64.0.0/10 -m comment --comment nordvpn-exitnode-permanent
-j DROP
-A FORWARD -s 192.168.1.200/32 -m comment --comment "sprokkel DROP TRAFFIC
FOR REPEATER" -j DROP
-A FORWARD -d 192.168.1.0/24 -m comment --comment "sprokkel FORWARD LAN
TRAFFIC" -j ACCEPT
-A FORWARD -s 192.168.1.0/24 -m comment --comment "sprokkel FORWARD LAN
TRAFFIC" -j ACCEPT
-A FORWARD -d 192.168.1.0/24 -o wlp1s0f0 -m comment --comment nordvpn -j
ACCEPT
-A FORWARD -d 192.168.240.0/24 -o wlp1s0f0 -m comment --comment nordvpn -j
ACCEPT
-A FORWARD -d 192.168.1.0/24 -o end0 -m comment --comment nordvpn -j ACCEPT
-A FORWARD -d 192.168.240.0/24 -o end0 -m comment --comment nordvpn -j
ACCEPT
It is possible to use another nordvpn client on the lan with meshnet
enabled as a work-around.
offtopic: I use meshnet on my lan and my phone with 4G when I'm outside the lan to contact my lan-NAS system.
Now my nas system doesn't have a nordvpn client so with ssh port forwarding I create a tunnel from the meshnet enabled lan device to my nas system. Now when I'm outside I enable meshnet on my phone and through the meshnet connection I access my nas. That;'s what I use meshnet for.
|
So I'm running this nordvpn gateway (with OPENVPN, which is the nordtun interface) for my local lan by putting these rules in iptables:
$sudo iptables -t nat -I POSTROUTING -s 192.168.1.0/24 -o nordtun -j MASQUERADE
$sudo iptables -I FORWARD -s 192.168.1.0/24 -j ACCEPT
$sudo iptables -I FORWARD -d 192.168.1.0/24 -j ACCEPT
At this stage all lan-clients have internet through the nordtun interface. This works flawless.
Now, when I enable meshnet, the next rules are inserted into the FORWARD chain which then in turn
DROPS the FORWARD traffic for the local lan so internet connection is lost to the entire lan:
$ sudo iptables -L FORWARD -vn
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP 0 -- * wlp1s0f0 0.0.0.0/0 0.0.0.0/0 /* nordvpn-exitnode-transient /
22 1264 DROP 0 -- * end0 0.0.0.0/0 0.0.0.0/0 / nordvpn-exitnode-transient /
0 0 DROP 0 -- * * 100.64.0.0/10 169.254.0.0/16 / nordvpn-exitnode-transient /
0 0 DROP 0 -- * * 100.64.0.0/10 192.168.0.0/16 / nordvpn-exitnode-transient /
0 0 DROP 0 -- * * 100.64.0.0/10 172.16.0.0/12 / nordvpn-exitnode-transient /
0 0 DROP 0 -- * * 100.64.0.0/10 10.0.0.0/8 / nordvpn-exitnode-transient /
0 0 ACCEPT 0 -- * * 100.125.63.180 0.0.0.0/0 / nordvpn-exitnode-transient /
0 0 ACCEPT 0 -- * * 0.0.0.0/0 100.64.0.0/10 ctstate RELATED,ESTABLISHED / nordvpn-exitnod>
The second rule is the rule dropping the forward traffic to the lan making internet connection unavailable for the entire lan.
Now I was thinking just INSERTING these rules after meshnet connection
$sudo iptables -I FORWARD -s 192.168.1.0/24 -j ACCEPT
$sudo iptables -I FORWARD -d 192.168.1.0/24 -j ACCEPT
and that works for like 10 minutes, then the FORWARD chain is rewriten again and traffic is blocked again.
Any ideas how to fix this? I'd like to keep and the gateway active and the meshnet connection enabled.
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: