IPsec(L2TPD)ã§VPNãµã¼ããç«ã¦ã¦ã¿ã
IPsec(L2TPD)ã§VPNãµã¼ããç«ã¦ã¦ã¿ãã
OpenVPNã§è¨ãæã®ãããªãã¸ã¢ã¼ãã
ã¯ã©ã¤ã¢ã³ãã¯ãµã¼ãã¨åããããã¯ã¼ã¯ã«è¿½å ãããã
ã
å¿
è¦ãªãã¡ã¤ã«å
¨é¨è¨è¼ã
詳ããã¯åèURLãã
ãµã¼ãã¯CentOSã
ã
XL2TPD
ã¤ã³ã¹ãã¼ã«
yum -y install --enablerepo=epel xl2tpd
ã
/etc/xl2tpd/xl2tpd.conf
[global] auth file = /etc/ppp/chap-secrets [lns default] ip range = 192.168.0.240-192.168.0.254 local ip = 192.168.0.50 require chap = yes refuse pap = yes require authentication = yes name = LinuxVPNserver ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes
ã
/etc/ppp/options.xl2tpd
ipcp-accept-local ipcp-accept-remote ms-dns 192.168.0.40 ms-wins 192.168.0.40 noccp auth crtscts idle 1800 mtu 1410 mru 1410 nodefaultroute debug lock proxyarp connect-delay 5000 logfile /var/log/xl2tpd.l2tp-ipsec.log
ã
/etc/ppp/chap-secrets
åãã¦ã¼ã¶ã§åææ¥ç¶åºæ¥ãã
# Secrets for authentication using CHAP # client server secret IP addresses user1 * "password1" * user2 * "password2" *
ã
Openswan
ã¤ã³ã¹ãã¼ã«
yum -y install openswan
ã
/etc/ipsec.conf
version 2.0 config setup protostack=netkey nat_traversal=yes #oe=off nhelpers=0 include /etc/ipsec.d/*.conf
ã
/etc/ipsec.d/l2tp-psk.conf
rightsubnetã0.0.0.0/0ã«ããªãã¨ç¹ãããªãã£ãã
ã«ã³ãã§ã¯æå®åºæ¥ãªãããããæ¥ç¶å
ãçµãè¾¼ã¿ããå ´åã¯connãå¢ããå¿
è¦ããããããã
rightprotoportã®ãã¼ãã«anyãæå®ããªãã¨ã1ã¤ã®ã°ãã¼ãã«IPã«å¯¾ãã¦1ã¤ãããã³ãã«ãè²¼ããªãã
conn L2TP-PSK-NAT #rightsubnet=vhost:%priv #rightsubnet=192.168.0.0/24 #rightsubnet=vhost:%no,%priv rightsubnet=0.0.0.0/0 also=L2TP-PSK-noNAT conn L2TP-PSK-noNAT # # Configuration for one user with any type of IPsec/L2TP client # including the updated Windows 2000/XP (MS KB Q818043), but # excluding the non-updated Windows 2000/XP. # # # Use a Preshared Key. Disable Perfect Forward Secrecy. # # PreSharedSecret needs to be specified in /etc/ipsec.secrets as # YourIPAddress %any: "sharedsecret" left=192.168.0.50 #leftnexthop=192.168.0.1 leftnexthop=%any authby=secret pfs=no auto=add keyingtries=3 # we cannot rekey for %any, let client rekey rekey=no type=transport # #left=%defaultroute # or you can use: left=YourIPAddress # # For updated Windows 2000/XP clients, # to support old clients as well, use leftprotoport=17/%any leftprotoport=17/1701 # # The remote user. # right=%any #rightprotoport=17/1701 rightprotoport=17/%any
ã
/etc/ipsec.d/no_oe.conf
CentOSã®ãªãã¸ããªã®RPMã«ã¯ãã®ãã¡ã¤ã«ãã¤ãã¦ãªãã¦ãæ¢ãåã£ãã
# 'include' this file to disable Opportunistic Encryption. # See /usr/share/doc/openswan/policygroups.html for details. # # RCSID $Id: no_oe.conf.in,v 1.2 2004/10/03 19:33:10 paul Exp $ conn block auto=ignore conn private auto=ignore conn private-or-clear auto=ignore conn clear-or-private auto=ignore conn clear auto=ignore conn packetdefault auto=ignore
ã
iptables
ãã¼ã¹ã¯ããã
ã
ãã¡ã¤ã¢ã¦ã©ã¼ã«æ§ç¯(iptables) - CentOSã§èªå®
ãµã¼ãã¼æ§ç¯
http://centossrv.com/iptables.shtml
ã
# FORWARDè¨å® iptables -A FORWARD -s $LOCALNET -j ACCEPT iptables -A FORWARD -d $LOCALNET -j ACCEPT # L2TP/IPSec iptables -A INPUT -p tcp --dport 1701 -j ACCEPT_COUNTRY iptables -A INPUT -p udp --dport 1701 -j ACCEPT_COUNTRY iptables -A INPUT -p udp --dport 500 -j ACCEPT_COUNTRY iptables -A INPUT -p tcp --dport 500 -j ACCEPT_COUNTRY iptables -A INPUT -p tcp --dport 4500 -j ACCEPT_COUNTRY iptables -A INPUT -p udp --dport 4500 -j ACCEPT_COUNTRY iptables -A INPUT -p esp -j ACCEPT_COUNTRY
ã
確èª
ããããã¦FAILEDããã£ããããã®é ç®ã解決ãã¦OKã«ããã
ipsec verify
ã
ããããã¦æå¾ã®æ¹ã«connã®ååã表示ããã¦ãªãã£ããããã®è¨å®ã§ä½ããã¹ãããã
ipsec auto --status
ã
åèURL
Memo - VPN Server for Fedora (L2TP/IPsec,PPTP)
http://www.ln-lab.net/lunar-night.lab/page2-memo_vpn/design-white/lang-ja
ã
Kung Noi:OpenSwanã§l2tp IPsec VPNç°å¢
http://nai.homelinux.net/l2tp_ipsec.html
ã
L2TPã§VPNæ¥ç¶ | Kirie.net Blog
http://blog.kirie.net/linux/62.html
ã
suz-lab - blog: Openswanã§IPsec(ãã¶ãä¸çªç°¡åãªæ¹æ³)
http://blog.suz-lab.com/2010/06/openswanipsec.html