- 论坛徽章:
- 0
|
本帖最后由 zxpxyz 于 2011-01-30 16:50 编辑
转载需注明转自CU的zxpxyz
wget http://www.openswan.org/download/openswan-2.6.32.tar.gz
wget http://downloads.sourceforge.net ... /rp-l2tp-0.4.tar.gz
wget http://www.xelerance.com/wp-cont ... xl2tpd-1.2.7.tar.gz
yum install libpcap-devel ppp -y
tar zxf openswan-2.6.32.tar.gz
cd openswan-2.6.32
make programs install
vi /etc/ipsec.conf- version 2.0
- config setup
- nat_traversal=yes
- virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12
- oe=off
- protostack=netkey
- conn L2TP-PSK-NAT
- rightsubnet=vhost:%priv
- also=L2TP-PSK-noNAT
- conn L2TP-PSK-noNAT
- authby=secret
- pfs=no
- auto=add
- keyingtries=3
- rekey=no
- ikelifetime=8h
- keylife=1h
- type=transport
- left=192.168.0.10
- leftprotoport=17/1701
- right=%any
- rightprotoport=17/%any
复制代码 上面这段格式要对,否则报错。
vi /etc/ipsec.secrets
192.168.0.10 %any: PSK "YourSharedSecret"
检查ipsec是否正常
ipsec verify
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.32/K2.6.18-194.el5 (netkey)
Checking for IPsec support in kernel [OK]
SAref kernel support [N/A]
NETKEY: Testing for disabled ICMP send_redirects [OK]
NETKEY detected, testing for disabled ICMP accept_redirects [OK]
Checking that pluto is running [OK]
Pluto listening for IKE on udp 500 [OK]
Pluto listening for NAT-T on udp 4500 [OK]
Two or more interfaces found, checking IP forwarding [OK]
Checking NAT and MASQUERADEing
Checking for 'ip' command [OK]
Checking /bin/sh is not /bin/dash [OK]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]
tar zxvf rp-l2tp-0.4.tar.gz
cd rp-l2tp-0.4
./configure
make
cp handlers/l2tp-control /usr/local/sbin/
mkdir /var/run/xl2tpd/
ln -s /usr/local/sbin/l2tp-control /var/run/xl2tpd/l2tp-control
tar zxvf xl2tpd-1.2.4.tar.gz
cd xl2tpd-1.2.4
make install
vi /etc/xl2tpd/xl2tpd.conf
[global]
ipsec saref = yes
[lns default]
ip range = 10.1.2.2-10.1.2.254
local ip = 10.1.2.1
refuse chap = yes
refuse pap = yes
require authentication = yes
ppp debug = yes
pppoptfile = /etc/xl2tpd/options.xl2tpd
length bit = yes
vi /etc/xl2tpd/options.xl2tpd
require-mschap-v2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
asyncmap 0
auth
crtscts
lock
hide-password
modem
debug
name l2tpd
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
开启xl2tpd
xl2tpd -D |
|