由于pptp要用到NAT,但是默认的Linaro内核是不支持的,首先要配置内核支持NAT和PPP,具体的配置如下:
[*] Networking support —> Networking options —> [*] Network packet filtering framework (Netfilter) —> IP: Netfilter Configuration —> <*> IPv4 connection tracking support (required for NAT) <*> Full NAT <*> MASQUERADE target support <*> NETMAP target support <*> REDIRECT target support Device Drivers —> [*] Network device support —> <*> Universal TUN/TAP device driver support
vi /etc/ppp/options.pptpd
输入以下内容:
name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 proxyarp lock nobsdcomp novj novjccomp nologfd idle 2592000 ms-dns 114.114.114.114
②、配置文件/etc/ppp/chap-secrets
vi /etc/ppp/chap-secrets
输入以下内容
# Secrets for authentication using CHAP # client server secret IP addresses
test1 pptpd 123456 *
注:这里的myusername和mypassword即为PPTP VPN的登录用户名和密码
③、配置文件/etc/pptpd.conf
vi /etc/pptpd.conf
输入以下内容:
option /etc/ppp/options.pptpd logwtmp localip 192.168.10.1 remoteip 192.168.10.100-199
注:为拨入VPN的用户动态分配192.168.10.100~192.168.10.199之间的IP
④、配置文件/etc/sysctl.conf
vi /etc/sysctl.conf
修改以下内容:
net.ipv4.ip_forward = 1
保存、退出后执行:
/sbin/sysctl -p
3、启动PPTP VPN 服务器端:
/sbin/service pptpd start
4、启动iptables:
/sbin/service iptables start /sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.10.0/24 -j MASQUERADE