OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version lede-17.01
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Ian B - 16.01.2018
Last edited by Yousong Zhou - 27.02.2018

FS#1278 - Firewall fails to load properly for Openvpn

- 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 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'
cgull commented on 04.06.2018 23:42

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
cgull commented on 05.06.2018 00:30

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.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing