当前位置:   article > 正文

openwrt使用l2tp_openwrt l2tp客户端

openwrt l2tp客户端

1、配置openwrt

  1. cat > /etc/ipsec.conf <<EOF
  2. # ipsec.conf - strongSwan IPsec configuration file
  3. # basic configuration
  4. config setup
  5. # strictcrlpolicy=yes
  6. # uniqueids = no
  7. # Add connections here.
  8. # Sample VPN connections
  9. conn %default
  10. ikelifetime=60m
  11. keylife=20m
  12. rekeymargin=3m
  13. keyingtries=1
  14. keyexchange=ikev1
  15. authby=secret
  16. ike=aes128-sha1-modp1024,3des-sha1-modp1024!
  17. esp=aes128-sha1-modp1024,3des-sha1-modp1024!
  18. conn myvpn
  19. keyexchange=ikev1
  20. left=%defaultroute
  21. auto=add
  22. authby=secret
  23. type=transport
  24. leftprotoport=17/1701
  25. rightprotoport=17/1701
  26. right=47.100.171.251
  27. EOF
  28. cat > /etc/ipsec.secrets <<EOF
  29. : PSK "xindoo.me"
  30. EOF
  31. cat > /etc/xl2tpd/xl2tpd.conf <<EOF
  32. [lac myvpn]
  33. lns = 47.100.171.251
  34. ppp debug = yes
  35. pppoptfile = /etc/ppp/options.l2tpd.client
  36. length bit = yes
  37. EOF
  38. cat > /etc/ppp/options.l2tpd.client <<EOF
  39. ipcp-accept-local
  40. ipcp-accept-remote
  41. refuse-eap
  42. require-chap
  43. noccp
  44. noauth
  45. mtu 1280
  46. mru 1280
  47. noipdefault
  48. defaultroute
  49. usepeerdns
  50. connect-delay 5000
  51. name Test1
  52. password test1
  53. EOF
  54. chmod 600 /etc/ppp/options.l2tpd.client
  55. ipsec restart
  56. ipsec up myvpn

2、参考

配置l2tp服务器:

https://blog.csdn.net/xindoo/article/details/52830609

配置l2tp客户端:
https://blog.csdn.net/rainforest_c/article/details/71171237
https://github.com/hwdsl2/setup-ipsec-vpn/blob/master/docs/clients-zh.md#linux

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
  

闽ICP备14008679号