Description: This article describes how to add server and client directives using the CLI — you can specify adding these OpenVPN directives to the client or server configuration files.
For our steps, we'll use this example, pushing the below command:
route 10.0.0.0 255.255.192.0 net_gateway
The server directive will be:
push "route 10.0.0.0 255.255.192.0 net_gateway"
The client directive will be:
route 10.0.0.0 255.255.192.0 net_gateway
Follow the steps below to add any of those via CLI.
Add Server Directives
+ Add the server directive to a txt file:
echo 'push "route 10.0.0.0 255.255.192.0 net_gateway"' > route.txt
If you want to add more than one directive, your command looks like this:
echo 'push "route 10.10.10.0 255.255.255.0 net_gateway"' > route.txt
echo 'push "route 10.10.20.0 255.255.255.0 net_gateway"' >> route.txt
echo 'push "route 10.10.30.0 255.255.255.0 net_gateway"' >> route.txt
+ Then, run the below command to provide your txt file as server config directives:
sudo su
cd /usr/local/openvpn_as/scripts/
./sacli --key "vpn.server.config_text" --value_file=./route.txt ConfigPut
./sacli start
Verify the server directive saves:
sudo su
cd /usr/local/openvpn_as/scripts/
./sacli configquery | grep "vpn.server.config_text"
Add Client Directives
+ Add the client directive to a txt file:
echo 'route 10.0.0.0 255.255.192.0 net_gateway' > route.txt
If you want to add more than one directive, your command looks like this:
echo 'route 10.10.10.0 255.255.255.0 net_gateway' > route.txt
echo 'route 10.10.20.0 255.255.255.0 net_gateway' >> route.txt
echo 'route 10.10.30.0 255.255.255.0 net_gateway' >> route.txt
+ Then, run the below command to provide your txt file as client config directives:
sudo su
cd /usr/local/openvpn_as/scripts/
./sacli --key "vpn.client.config_text" --value_file=./route.txt ConfigPut
./sacli start
Verify client directive saves:
sudo su
cd /usr/local/openvpn_as/scripts/
./sacli configquery | grep "vpn.client.config_text"
Note: You can configure these same server and client directives in the Admin Web UI from the Configuration > Advanced VPN page, under Additional OpenVPN Config Directives (Advanced).
If you have additional questions, please submit a ticket.
Comments
0 comments
Please sign in to leave a comment.