PPTPL2TP协议详解以及应用部署 - 图文(11)
echo 0 > $each/send_redirects done 2.L2TP配置
# /etc/xl2tpd/xl2tpd.conf [global] ipsec saref = yes [lns default] ip range = 10.10.20.100-10.10.20.254 local ip = 10.10.20.1 require chap = yes refuse pap = yes require authentication = yes ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes 3.PPP配置
# /etc/ppp/options.xl2tpd refuse-mschap-v2 refuse-mschap ms-dns 8.8.8.8 ms-dns 8.8.4.4 asyncmap 0 auth lock hide-password local #debug name l2tpd proxyarp lcp-echo-interval 30 lcp-echo-failure 4 mtu 1404 mru 1404 5.启用转发
echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE 对于OpenVZ的主机,可能不支持MASQUERADE,此时需要使用SNAT: iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source $IP 其中$IP就是你主机的eth0接口的IP地址。
四、检查ipsec是否工作正常
我们通过执行ipsec verify命令进行验证ipsec服务是否工作正常:
错误1:pluto is running [FAILED]
Checking your system to see if IPsec got installed and started correctly: Version check and ipsec on-path [OK] Linux Openswan U2.6.38/K(no kernel code presently loaded) Checking for IPsec support in kernel [FAILED] SAref kernel support [N/A] Checking that pluto is running [FAILED] whack: Pluto is not running (no \Checking for 'ip' command [OK] Checking /bin/sh is not /bin/dash [WARNING] Checking for 'iptables' command [OK] Opportunistic Encryption Support [DISABLED] 这是因为你还没有启动ipsec服务! /etc/init.d/ipsec start 错误2:NETKEY: Testing XFRM related proc values [FAILED]
Checking your system to see if IPsec got installed and started correctly: Version check and ipsec on-path [OK] Linux Openswan U2.6.38/K2.6.32-38-generic-pae (netkey) Checking for IPsec support in kernel [OK] SAref kernel support [N/A] NETKEY: Testing XFRM related proc values [FAILED] Please disable /proc/sys/net/ipv4/conf/*/send_redirects or NETKEY will cause the sending of bogus ICMP redirects! [FAILED] Please disable /proc/sys/net/ipv4/conf/*/accept_redirects or NETKEY will accept bogus ICMP 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] Checking for 'ip' command [OK] Checking /bin/sh is not /bin/dash [WARNING] Checking for 'iptables' command [OK] Opportunistic Encryption Support [DISABLED] 你可能忘记修改网络策略: for each in /proc/sys/net/ipv4/conf/* do echo 0 > $each/accept_redirects echo 0 > $each/send_redirects done 错误3:Pluto listening for IKE on udp 500 [FAILED]
Pluto listening for IKE on udp 500 [FAILED] Cannot execute command \Pluto listening for NAT-T on udp 4500 [FAILED] Cannot execute command \那么你需要安装lsof: apt-get install lsof 五、测试与调试 1.启用测试用户
编辑/etc/ppp/chap-secrets文件,加入如下行: # Secrets for authentication using CHAP # client server secret IP addresses guest l2tpd password * 该行创建一个用户,用户名为guest,密码为password(明文)
server字段与options.xl2tpd配置文件中的name属性对应。还可以星号(*)代替,表示不限调用服务。
IP address表示来源IP,这里星号(*)表示接受所有连接。
对来源IP的过滤应该由iptables防火墙来完成。读者可以查阅本博客关于iptables的相关文章进行设置。
2.连接
现在就可以尝试连接,如果连接失败,需要通过查看日志信息排错。
3.查看日志
ipsec日志记录在/var/log/auth中,如果发现该行: STATE_MAIN_R3: sent MR3, ISAKMP SA established 则表示IPSec认证或连接没有问题,可以检查其他日志。但是有时候即使出现established,也会在稍后的行中出现错误信息,这是需要用户留意的地方。 xl2tpd和pppd的日志记录在/var/log/syslog中。
…… 此处隐藏:1218字,全部文档内容请下载后查看。喜欢就下载吧 ……相关推荐:
- [实用模板]第八章:法国“新浪潮”与“左岸派”
- [实用模板]2021年北京上半年临床医学检验技师生物
- [实用模板]SAP GUI 7.10客户端安装配置文档
- [实用模板]2001年临床执业医师资格考试综合笔试试
- [实用模板]36机场工作实用英语词汇总结
- [实用模板](一)社会保险稽核通知书
- [实用模板]安全教育主题班会材料
- [实用模板]濉溪县春季呼吸道传染病防控应急演练方
- [实用模板]长沙房地产市场周报(1.30-2.3)
- [实用模板]六年级数学上册典中点 - 图文
- [实用模板]C程序设计(红皮书)习题官方参考答案
- [实用模板]中国证监会第一届创业板发行审核委员会
- [实用模板]桥梁工程复习题
- [实用模板]2011学而思数学及答案
- [实用模板]初中病句修改专项练习
- [实用模板]监理学习知识1 - 图文
- [实用模板]小机灵杯四年级试题
- [实用模板]国贸专业毕业论文模板
- [实用模板]教育学概论考试练习题-判断题4
- [实用模板]2015届高考英语一轮复习精品资料(译林
- 00Nkmhe_市场营销学工商管理_电子商务_
- 事业单位考试法律常识
- 诚信教育实施方案
- 吉大小天鹅食品安全检测箱方案(高中低
- 房地产销售培训资料
- 高一地理必修1复习提纲
- 新概念英语第二册lesson_1_练习题
- 证券公司内部培训资料
- 小学英语时间介词专项练习
- 新世纪英语专业综合教程(第二版)第1册U
- 【新课标】浙教版最新2018年八年级数学
- 工程建设管理纲要
- 外研版 必修一Module 4 A Social Surve
- Adobe认证考试 AE复习资料
- 基于H.264AVC与AVS标准的帧内预测技术
- 《食品检验机构资质认定管理办法》(质
- ABB变频器培训课件
- (完整版)小学说明文阅读练习题及答案
- 深思洛克(SenseLock) 深思IV,深思4,深
- 弟子规全文带拼音




