There are cases, where you might want to use OpenVPN to redirect only a fraction of traffic, but not all. By default, after you connect to OpenVPN, server would push the call
'redirect-gateway' to the client to make the client divert all the traffic through
This behavior can be override with the following command line argument:
--pull-filter ignore redirect-gateway
You can add it in the openvpn command line as following:
openvpn --pull-filter ignore redirect-gateway --config "your_file.ovpn"
Once this is done, remember that, you have to route the targetted traffic using either the
route command or
'ip route' command, otherwise no traffic will route through your openvpn tunnel network.
If you are using OpenVPN in a Linux platform through command line, it is always handy to be able to save the authentication information in a file and let openvpn use them. There are two ways you can do it.
First save the password in a file e.g auth.txt with two lines:
First line is for username and the second line is for password.
If you are using .ovpn files for configuration, open the .ovpn file and simply add the following:
Now, your authentication would use the authentication given in that file
You may add the
auth-user-pass in the openvpn command line argument, but you have to make sure, this is passed after the
--config. Here is an example
openvpn --config "your_file.ovpn" --auth-user-pass "auth.txt"
That should be enough.
CentOS 7 doesn’t come with ifconfig tools. It encourages users to use ‘ip’ tool for network administration. Although, it is still possible to use ifconfig with CentOS 7. ifconfig is a part of net-tools package. All you have to do is to install the net-tools package using yum.
How to install ifconfig in CentOS 7
Run the following command to install net-tools package in CentOS 7, this will install ifconfig as well:
# yum install net-tools -y