VPN Policy-Based Routing + Web UI -- Discussion

PM sent. Thanks for the help.

1 Like

I am new to this openwrt (linux) also I am Spanish, so I cannot do a port 6969 redirection udp is for a teamspeak3 server, my vpn client is ipvanish.
Thanks and best regards

Hi Stan,

I upgraded my build tonight and pulled latest VPR (0.2.1-8) down, now VPR GUI will not load, gives me this when clicking on it in the LUCI menu:

/usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: bad argument #2 to 'tonumber' (integer expected, got string)
stack traceback:
	[C]: in function 'tonumber'
	/usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: in function 'func'
	/usr/lib/lua/luci/cbi.lua:66: in function 'load'
	/usr/lib/lua/luci/dispatcher.lua:1243: in function '_cbi'
	/usr/lib/lua/luci/dispatcher.lua:927: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:441: in function </usr/lib/lua/luci/dispatcher.lua:440>

Build Info:
Powered by LuCI (LuCI Master) / OpenWRT SNAPSHOT r12903-c30220d458

What's the version of web UI package?

UPDATE: it has to do with the webui_sorting option -- what is it set to? I've tried to experiment with different (even bad) settings there and I cannot reproduce on release.

1 Like

luci - git-20.074.84698-ead5e81

Where would I find that sorting option to check ?

Aren't you manually modifying the sort for newest to oldest?

No, I have to manually add that after each new build which I have not done to this one (yet). That reverses the system log order when implemented. Right now it's oldest to newest - stock.

uci show webui_sorting or uci get webui_sorting

one of those should work

Thanks cybrnook that worked well... Here are checks I did:

It was set to:
uci show
vpn-policy-routing.config.webui_sorting='1'

I changed to 0 in the /etc/config file and rebooted:
uci show
vpn-policy-routing.config.webui_sorting='0'

I also tried switching to the stock config file for VPR that comes with it, same LUCI error...
VPR is running, just cannot get into LUCI.

Unfortunately the issue remains -- the VPR luci does not load at all -- errors with this right away:

/usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: bad argument #2 to 'tonumber' (integer expected, got string)
stack traceback:
	[C]: in function 'tonumber'
	/usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: in function 'func'
	/usr/lib/lua/luci/cbi.lua:66: in function 'load'
	/usr/lib/lua/luci/dispatcher.lua:1243: in function '_cbi'
	/usr/lib/lua/luci/dispatcher.lua:927: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:441: in function </usr/lib/lua/luci/dispatcher.lua:440>

EDIT:
Looks like a bad build, I did another build today and now LUCI doesnt even load at all...
/usr/lib/lua/luci/ccache.lua:70: error loading module 'luci.controller.advanced_reboot' from file '/usr/lib/lua/luci/controller/advanced_reboot.lua':
/usr/lib/lua/luci/controller/advanced_reboot.lua:46: ')' expected (to close '(' at line 45) near 'alt_partition_unmount'
stack traceback:
[C]: in function 'loader'
/usr/lib/lua/luci/ccache.lua:70: in function </usr/lib/lua/luci/ccache.lua:61>
[C]: in function 'require'
/usr/lib/lua/luci/dispatcher.lua:985: in function 'createindex'
/usr/lib/lua/luci/dispatcher.lua:1096: in function 'createtree'
/usr/lib/lua/luci/dispatcher.lua:639: in function 'menu_json'
/usr/lib/lua/luci/dispatcher.lua:734: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:441: in function </usr/lib/lua/luci/dispatcher.lua:440>

Hi!
Pretty new to OpenWRT and policy-based routing so please be easy on me :slight_smile:

I have two local networks 192.168.1.0/24 192.168.2.0/24, using VPN Policy-Based routing traffic from 192.168.1.0/24 is always directed to wan intefrace, and the traffic from 192.168.2.0/24 is directed to tun0 interface, that seems to work great!

One thing I've noticed is that once I enable VPN PBR connectivity between between 192.168.1.0/24 and 192.168.2.0/24 is gone.

There was a solution back in the day from @algebro VPN Policy-Based Routing + Web UI -- Discussion, but that seems ugly as it requires to hardcode isp's WAN Gateway IP.

Any more modern and up-to-date solution to this?

Regards,
V

Same issue here after upgrading to KONG 19 r12903-c30220d458.

usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: bad argument #2 to 'tonumber' (integer expected, got string)
stack traceback:
[C]: in function 'tonumber'
/usr/lib/lua/luci/model/cbi/vpn-policy-routing.lua:260: in function 'e'
/usr/lib/lua/luci/cbi.lua:48: in function 'load'
/usr/lib/lua/luci/dispatcher.lua:1014: in function '_cbi'
/usr/lib/lua/luci/dispatcher.lua:767: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:379: in function </usr/lib/lua/luci/dispatcher.lua:378>

Douglas, the advanced-reboot issue was a botched PR, @hnyman has already fixed it in the tree.

For the VPR luci package, I can't reproduce it on stable. Could you please try the following in command line on your router:

lua
uci = require "luci.model.uci".cursor()
= uci:get("vpn-policy-routing", "config", "webui_sorting")
= tonumber(uci:get("vpn-policy-routing", "config", "webui_sorting"))

Then press Ctrl-C to exit lua prompt.

I did another new build yesterday (OpenWRT SNAPSHOT, r12911-e66becb490) and got the advanced reboot Luci issue. After Hnyman fixed that I manually added the ')' and was able to get back into everything today. VPR is launching again as well.

Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio (double int32)
> uci = require "luci.model.uci".cursor()
= uci:get("vpn-policy-routing", "config", "webui_sorting")
= tonumber(uci:get("vpn-policy-routing", "config", "webui_sorting"))> 1
>
1

Here is a shot of my software after the build for VPR:

Is that Turris? Nevermind updates in my repo for a little while.

Solution for these is opkg update; opkg install ip-full; /etc/init.d/vpn-policy-routing reload;

1 Like

He's got a Linksys WRT32X

Oh, that's a very pretty update Web UI in snapshots then.

@dk4dk4 I've rebuilt all the packages in my repo, no more "unknown" for luci apps.

any know how to use vpn only for netflix with this packages? cos. i try use custom file conf not work. this my error notif

this my policies conf

Thanks for this confirmation.

pretty nubish question here, sorry for that.
I'm trying to route only my IPTV traffic through nordvpn. I'm not really sure why I need an openvpn server in addition to the client, and when following Local OpenVPN Server + OpenVPN Client (Scenario 2), the section "Relevant part of /etc/config/openvpn" includes incomplete config openvpn 'vpnserver':

  option port '1194'
  option proto 'tcp'
  option server '192.168.200.0 255.255.255.0'
  ...

and I don't know how to complete it (it fails to start it though luci)

p.s. my config openvpn 'vpnclient' part consists of

option config '/etc/openvpn/my-vpn.conf' 
option enabled '1'

and the content of /etc/openvpn/my-vpn.conf is defined according to nordvpn's server .opvn file.