What's new

Import Client Traffic Rules for OpenVPN Clients?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sone

Occasional Visitor
Hi all,

Is there a way to import "Rules for routing client traffic through the tunnel" with the "Custom Configuration" or a script so I can apply it to the 4 other open client slots without manually adding each one? This is down at the bottom of the OpenVPN Client section (Asuswrt-Merlin 384.8.2)

thanks.
 
Using the command line on the router you can get the client list information of the first VPN client using:

nvram get vpn_client1_clientlist > CLIENTLIST

This saves the output to a file called CLIENTLIST. You can verify it has worked using:

cat CLIENTLIST

Store the string as a variable... I had problems with long strings in a single command...

CLIENTS="$(cat CLIENTLIST)"

Verify the CLIENTS variable contains the right information

echo $CLIENTS

To copy this to the second clientlist entry:

nvram set vpn_client2_clientlist="$CLIENTS"
(don't forget the quotes)

remove the CLIENTLIST file (you don't need it):

rm CLIENTLIST

NOTE - When I've done this, I've chosen to capture the output in a file and then use the CLIENTS variable as I had unexpected results with large clientlists.
 
Oh sweet!! Thank you so so much! This will save me a ton of time every time I switch/add new OpenVPN clients.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top