Skip to content
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

Open
sprokkel78 opened this issue Oct 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@sprokkel78
Copy link

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.

@sprokkel78
Copy link
Author

nordvpn settings
Technology: OPENVPN
Protocol: TCP
Firewall: enabled
Firewall Mark: 0x2
Routing: enabled
Analytics: disabled
Kill Switch: enabled
Threat Protection Lite: disabled
Obfuscate: disabled
Notify: enabled
Tray: enabled
Auto-connect: disabled
IPv6: disabled
Meshnet: enabled
DNS: 192.168.1.100
LAN Discovery: disabled
Virtual Location: enabled
Allowlisted ports:
53 (UDP|TCP)
853 (UDP|TCP)
Allowlisted subnets:
192.168.1.0/24
192.168.240.0/24

@mariusSincovici
Copy link
Contributor

Hi,

thank you for your feedback.

I was able to reproduce it.
Could you also please add the rules for iptables(sudo iptables -S FORWARD) to see that it is the same situation?

Would it work to use meshnet routing from other devices instead?
Thanks

@mariusSincovici mariusSincovici added the bug Something isn't working label Oct 18, 2024
@sprokkel78
Copy link
Author

sprokkel78 commented Oct 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants