ubuntu vpn client connection

---------------- The vpn client connects to the vpn server ---------------------------- -------------
Step 1: Open Network Connections, select the VPN tab, then click the Add button
Step 2 : Select the type of VPN to connect to, now PPTP, click New
Step 3: Gateway (gateway) ) Fill in the external network address of the VPN server (after logging in to the site, check the server address list in the VPN account tab), then fill in the user name and password, and then click Advanced.
Step 4: Remove EAP from the authentication method box and select Check MPPE, and then click OK. Step


5 : Connect to the VPN server
and see if there is a small lock under the small connection icon to indicate that the connection has been successful

$ ifconfig #More ppp0
ppp0 Link encap: Point-to-Point Protocol 
          inet addr:192.168.9.11 PtP:192.168.9.1 Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1400 Metric:1
          RX packets:16961 errors:600 dropped:0 overruns:0 frame:0
          TX packets:16691 errors:0 dropped :0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:9933207 (9.9 MB) TX bytes:1628387 (1.6 MB)

---------------------------- --vpn server-side configuration ------ as follows -------------
Environment settings: whether the

kernel loads the mppe module
modprobe ppp-compress-18

to enable TUN/TAP support
# cat /dev/ net/tun
cat: /dev/net/tun: File descriptor in bad state

whether to enable ppp support
# cat /dev/ppp
cat: /dev/ppp: No such device or address
----------- ------------install ppp,pptp-------------------------------------- -
yum install ppp-2.4.5-10.el6.x86_64
rpm -ivh http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm
---- -------------------------------------------------- --------------------
--------------------------------Modify the configuration file-------------

1 Configuration file /etc/ppp/options.pptpd

cp /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
# vi /etc/ppp/options.pptpd
use google DNS
ms-dns 8.8.8.8
ms-dns 8.8.4.4

2 Configuration file /etc/ppp/chap-secrets
#cp /etc/ppp/chap-secrets /etc/ppp/chap-secrets.bak #vi /etc
/ppp/chap-secrets

# Secrets for authentication using CHAP , Client name, custom password
# client server secret IP addresses
vpnclient pptpd 123456 *  

// myusername pptpd mypassword *
myusername is your vpn account, mypassword is your vpn password, * means for any ip, remember not to lose this Asterisk.

3 Configuration file /etc/pptpd.conf

#cp /etc/pptpd.conf /etc/pptpd.conf.bak #vi
/etc/pptpd.conf

# (Recommended)
#localip 192.168.0.1
#remoteip 192.168.0.234-238,192.168.0.245 //Indicates that the vpn client obtains ip The scope of
localip 192.168.9.1
remoteip 192.168.9.11-30

pptpd.conf must ensure that the last line ends with a blank line, otherwise it will cause an error of "Starting pptpd:" when starting the pptpd service, and it has been stuck. Problem

4 The configuration file /etc/sysctl.conf /etc/sysctl.conf.bak
modifies the kernel to support forwarding

# sysctl -a | grep ip_forward
net.ipv4.ip_forward = 0

cp /etc/sysctl.conf /etc/sysctl.conf.bak

vi /etc/sysctl.conf
# Controls IP packet forwarding
net.ipv4.ip_forward = 1

# sysctl -p

-----------Start pptp vpn service and iptables---------- -
/etc/init.d/pptpd start
/etc/init.d/iptables start

----------------------------------------- ------------------------
------------------------ ---Set firewall forwarding rules -------------

iptables -t nat -A POSTROUTING -o eth0 -s 192.168.9.0/24 -j SNAT --to-source 10.105.44.* // Cloud host intranet IP, add
iptables -A INPUT -p tcp -m tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p gre -j ACCEPT

--------------- --------- restart pptpd, iptables----
/etc/init.d/pptpd restart
/etc/init.d/iptables restart


Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326762816&siteId=291194637
VPN