The code is as follows:
Route add default Dev ppp0
Route add-net 192.168.2.0 netmask 255.255.255.0 ppp0
1 Install VPN Client first
The code is as follows:
Sudoapt-getinstall Pptp-linux
2 command line allocated number to connect the VPN server
The code is as follows:
sudo pptpsetup--create testvpn--server 123.45.67.88--username kk--password fku--encrypt--start
After the –create is created the connection name, can be any name;
–server is followed by the IP of the VPN server;
–username is the user name
–password is a password, you can not have this parameter in this, the command will be automatically asked later. This will keep your account safe.
–encrypt means encryption is required, the encryption method is not specified, and the command reads the encryption in the configuration file
–start is the connection after the creation of the connection, if you do not want to connect, do not write
3 later to connect VPN or disconnect VPN
The code is as follows:
Pon Testvpn <--VPN connection name </p> <p>poff <--Disconnect VPN
4 All traffic to go VPN channel
The code is as follows:
# put the following two lines into the/etc/ppp/ip-up or direct command line input, delete the default gateway and the VPN server as the default gateway, that is, change the routing strategy, so the transmission flow through the VPN line to go. </p> <p> #route Add default GW 192.168.0.1</p> <p> #route del default GW the original gateway//original default gateway address is available via route command to get