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

FS#1278 - Firewall fails to load properly for Openvpn #7970

Closed
openwrt-bot opened this issue Jan 16, 2018 · 2 comments
Closed

FS#1278 - Firewall fails to load properly for Openvpn #7970

openwrt-bot opened this issue Jan 16, 2018 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

porjo:

  • x86_64 device
  • LEDE 17.01.1
  • Openvpn 2.4.4-2

I have setup Openvpn using TUN server method, as per https://wiki.openwrt.org/doc/howto/vpn.openvpn

Clients are able to connect and ping the tun0 IP, however cannot connect to anything on the lan. The problem appears to be the firewall script is unable to resolve tun0 interface, so skips rules that requiring that interface.

root@LEDE:/etc/config# /etc/init.d/firewall restart
Warning: Section 'vpn' cannot resolve device of network 'vpn0'

To work around the problem, I have to manually insert the following iptables rules:

iptables -t nat -A POSTROUTING -o tun0 -j zone_vpn_postrouting
iptables -t nat -A PREROUTING -i tun0 -j zone_vpn_prerouting
iptables -A INPUT -i tun0 -j zone_vpn_input
iptables -A OUTPUT -o tun0 -j zone_vpn_output
iptables -I FORWARD 9 -i tun0 -j zone_vpn_forward

Once those rules have been inserted, everthing works perfectly!

This issue may relate to [[https://bugs.lede-project.org/index.php?do=details&task_id=1024|External LinkFS#1024]]


Further details

This is the 'vpn0' entry in /etc/config/networks:

config interface 'vpn0'
option ifname 'tun0'
option proto 'none'
option auto '1'

@openwrt-bot
Copy link
Author

cgull:

I believe I'm also seeing this issue, though I haven't verified the firewall rules/behavior. I also see the behavior that clients cannot ping LAN addresses.

  • WD Mynet N750
  • LEDE Reboot 17.01.4 r3560-79f57e422d / LuCI lede-17.01 branch (git-17.290.79498-d3f0685)
  • openvpn-openssl 2.4.4-2

On my system, OpenVPN worked after initial install, but not after reboot. I discovered that restarting OpenVPN with /etc/init.d/openvpn restart made it work again. That suggests initscript ordering problems, but is not conclusive.

My current workaround is to add this to rc.local:
sleep 60
/etc/init.d/openvpn restart

@openwrt-bot
Copy link
Author

cgull:

I looked at my issue more closely and it appears to be different from the original report: different OpenWRT version, no error seen from /etc/init.d/firewall restart no change in iptables -L output between broken and restarted/working OpenVPN. I'll open a new issue on the GitHub packages project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant