Article Title: Use vpn to connect to a remote server in Ubuntu. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
The company's servers provide vpn access points so that they can connect to the company's servers through vpn at home. I applied for a vpn account yesterday afternoon, and then tried to connect to the vpn Server in windows. Everything was okay to prove that my vpn account was okay, so today we are going to configure the vpn access environment in Ubuntu.
The VPN Client I use is pptp-linux from the official Ubuntu source. First download and install the pptp client from sudo apt-get install pptp-linux.
Then I checked the manual of pptp and searched the internet. It seems that the command line options of pptp are relatively simple:
Sudo pptp user password <密码> .
The company's vpn Server's Internet ip address is 100.100.1.1, the Intranet ip address is 192.168.1.1, the vpn user name is hello, And the password is hello, so after calling the following command:
Sudo pptp 100.100.1.1 user hello password hello
Then, ifconfig finds a new network connection named ppp0. The IP address corresponding to this connection should belong to the same network segment as the Intranet address of the vpn Server you are connected. The IP address corresponding to the ppp0 network connection added in my application scenario is 192.168.1.x. This new ppp0 connection is used to provide the vpn connection service.
Then, I tried to ping the company's vpn Server's intranet ip address 192.168.1.1, which can be pinged normally. Ping other servers, such as 192.168.1.10. The ping command failed! I am puzzled. It took me some time to think about it. It may be that the corresponding Gateway access to the company's server is incorrectly set. So try:
Route add 192.168.1.10 gw 192.168.1.1
Then ping 192.168.1.10 again, and the ping will be successful this time.
Then try to log on to 192.168.1.10 through ssh.
Now, I have configured the vpn work environment in Ubuntu.