[[サーバーTips]] ** 概要 [#vdfdb2a1] *** strongSwan のインストール [#a33ee763] dnf install -y strongswan *** L2TP + IPsec 用の xl2tpd のインストール [#f9d364c4] dnf install -y xl2tpd *** /etc/ipsec.conf 設定 [#i951df6c] *** /etc/xl2tpd/xl2tpd.conf [#d1b6a668] [global] port = 1701 [lns default] ip range = 192.168.200.10-192.168.200.20 local ip = 192.168.200.1 require chap = yes refuse pap = yes require authentication = yes name = l2tpd ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes *** /etc/ppp/options.xl2tpd [#x0157c38] ipcp-accept-local ipcp-accept-remote ms-dns 8.8.8.8 noccp auth crtscts idle 1800 mtu 1410 mru 1410 nodefaultroute debug lock proxyarp name l2tpd require-mschap-v2 *** /etc/ppp/chap-secrets [#e5f39e8e] youruser l2tpd yourpassword * *** firewalld/iptables の設定 [#j7901f3b] UDP 500, 4500, 1701 を開放 NAT 設定(L2TP 接続用の SNAT) ** vi /etc/sysctl.conf [#o753fb40] net.ipv4.ip_forward = 1 net.ipv6.conf.all.forwarding = 1 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.all.send_redirects = 0 ** sysctl -p [#d56eb247] ** dnf install strongswan [#bca3935e] ** vi /etc/strongswan/ipsec.conf [#qddbda08] config setup charondebug="all" uniqueids=yes conn ateway1-to-gateway2 type=tunnel auto=start keyexchange=ikev2 authby=secret left=192.168.56.7 leftsubnet=10.10.1.1/24 right=192.168.56.6 rightsubnet=10.20.1.1/24 ike=aes256-sha1-modp1024! esp=aes256-sha1! aggressive=no keyingtries=%forever ikelifetime=28800s lifetime=3600s dpddelay=30s dpdtimeout=120s dpdaction=restar