Ian Macdonald
Occasional Visitor
I have an AC-86U and an OpenVPN client config (client 3) with 20+ tunnel routes. Now I want to create a second client config (client 5) that uses the same set of routes.
I really don't want to type all of those routes into the GUI a second time, so I thought I'd be clever and do it on the command line. After some poking around, I came up with the following:
Unfortunately, setting vpn_client_unit isn't enough to switch to the right client config for reading or writing. Can anyone tell me what I'm missing here?
Additionally, if I manually set vpn_client_clientlist and vpn_client_clientlist[12345] to the right values, they don't stick and constantly revert to the old (blank) values. So I'm evidently missing something there, too. I thought nvram commit might be the answer here, but that doesn't help, either.
I'm not accustomed to reading and writing NVRAM on the command line, so I'm probably making a beginner's error somewhere in my expectations.
I really don't want to type all of those routes into the GUI a second time, so I thought I'd be clever and do it on the command line. After some poking around, I came up with the following:
Code:
for i in '' 1 2 3 4 5; do
nvram set 'vpn_client_unit=3'
foo="$(nvram get vpn_client_clientlist$i)"
nvram set 'vpn_client_unit=5'
nvram set "vpn_client_clientlist$i=$foo"
done
Unfortunately, setting vpn_client_unit isn't enough to switch to the right client config for reading or writing. Can anyone tell me what I'm missing here?
Additionally, if I manually set vpn_client_clientlist and vpn_client_clientlist[12345] to the right values, they don't stick and constantly revert to the old (blank) values. So I'm evidently missing something there, too. I thought nvram commit might be the answer here, but that doesn't help, either.
I'm not accustomed to reading and writing NVRAM on the command line, so I'm probably making a beginner's error somewhere in my expectations.