I've searched and could not find how to set vpn policy routing policies by using uci set commands.
I'm trying to set individual policies for different hosts that need to go via the WireGuard interface, as I've set the default to be the wan interface.
I start by issuing an 'uci set vpn-policy-routing.@policy[0]=policy' command, which returns NO error.
But, I keep getting and "uci: Invalid argument" after each of the following commands:
uci set vpn-policy-routing.@policy[0].interface='wg0'
uci set vpn-policy-routing.@policy[0].name='MACMINI'
uci set vpn-policy-routing.@policy[0].src_addr='XX:XX:XX:XX:XX:XX'
I know I'm probably making a syntax mistake, but so far I have failed to discover where.
Is anybody here able to point me in the right direction?
TIA
PS: vpn-policy-routing is working if I change it to be the default, or if I set individual policies via the GUI. I'm only having problems setting the individual hosts policies via the uci set commands. Also, if I use the 'uci show -policy-routing' command after manually adding a host from the GUI, the working config is shown, ending with the following:
Answering my own question, I just found out that the correct syntax is WITHOUT ' ' surrounding the interface name, host name and mac address, as follows:
uci set vpn-policy-routing.@policy[0]=policy
uci set vpn-policy-routing.@policy[0].interface=wg0
uci set vpn-policy-routing.@policy[0].name=MYROKU
uci set vpn-policy-routing.@policy[0].src_addr=XX:XX:XX:XX:XX:XX
uci commit vpn-policy-routing
Wow, thanks for bringing that out!
I don't quite know how I could not find it before, because I've searched and searched, but never got to find above mentioned wiki...