OpenWrtで IPSec + L2TP VPN > (2)パッケージインストール

「OpenWrtで IPSec + L2TP VPN/(2)パッケージインストール」の編集履歴(バックアップ)一覧に戻る

OpenWrtで IPSec + L2TP VPN/(2)パッケージインストール - (2014/11/05 (水) 23:36:44) のソース

OpenWrtで IPSec + L2TP VPN/(2)パッケージインストール

必要モジュールインストール

 opkg install kmod-crypto-aes
 opkg install kmod-crypto-arc4
 opkg install kmod-crypto-authenc
 opkg install kmod-crypto-cbc
 opkg install kmod-crypto-core
 opkg install kmod-crypto-crc32c
 opkg install kmod-crypto-deflate
 opkg install kmod-crypto-des
 opkg install kmod-crypto-ecb
 opkg install kmod-crypto-fcrypt
 opkg install kmod-crypto-hash
 opkg install kmod-crypto-hmac
 opkg install kmod-crypto-hw-hifn-795x
 opkg install kmod-crypto-iv
 opkg install kmod-crypto-manager
 opkg install kmod-crypto-md4
 opkg install kmod-crypto-md5
 opkg install kmod-crypto-michael-mic
 opkg install kmod-crypto-misc
 opkg install kmod-crypto-null
 opkg install kmod-crypto-ocf
 opkg install kmod-crypto-ocf-hifn7751
 opkg install kmod-crypto-pcbc
 opkg install kmod-crypto-pcompress
 opkg install kmod-crypto-rng
 opkg install kmod-crypto-sha1
 opkg install kmod-crypto-sha256
 opkg install kmod-crypto-test
 opkg install kmod-crypto-user
 opkg install kmod-crypto-wq
 opkg install kmod-crypto-xts
 opkg install kmod-ip6tables
 opkg install kmod-ipsec
 opkg install kmod-ipsec4
 opkg install kmod-ipsec6
 opkg install kmod-ipt-conntrack
 opkg install kmod-ipt-core
 opkg install kmod-ipt-extra
 opkg install kmod-ipt-ipsec
 opkg install kmod-ipt-ipset
 opkg install kmod-ipt-nat
 opkg install kmod-ipt-nathelper
 opkg install kmod-iptunnel4
 opkg install kmod-iptunnel6
 opkg install kmod-ipv6
 opkg install kmod-ledtrig-usbdev
 opkg install kmod-lib-crc-ccitt
 opkg install kmod-lib-zlib
 opkg install kmod-mac80211
 opkg install kmod-nfnetlink
 ※kmod: failed to insert~ というエラーが出ても無視してください

Firewallとインターフェース設定

 /etc/config/network に以下追記
 #L2TP
 config interface 'vpn0'
 	option 'ifname' 'ppp0'
 	option 'proto' 'none'
 	option 'auto' '1'
 config interface 'vpn1'
 	option ifname 'ppp1'
 	option proto 'none'
 	option auto '1'
 config interface 'vpn2'
	option ifname 'ppp2'
 	option proto 'none'
 	option auto '1'
 config interface 'vpn3'
 	option ifname 'ppp3'
 	option proto 'none'
 	option auto '1'

 /etc/config/firewall に以下追記
 #config IPSec
 config rule
	option name Allow-ESP
	option src 'wan'
	option proto 'esp'
	option target 'ACCEPT'
 config rule
	option name Allow-IKE
	option src 'wan'
	option proto 'udp'
	option dest_port '500'
	option target 'ACCEPT'
 config rule
	option name Allow-IKE(NAT-T)
	option src 'wan'
	option proto 'udp'
	option dest_port '4500'
	option target 'ACCEPT'
 config rule
	option name Allow-AH
	option src 'wan'
	option proto 'ah'
	option target 'ACCEPT'
 config rule
	option name 'L2TP'
	option target 'ACCEPT'
	option src 'wan'
	option proto 'udp'
	option dest_port '1701'
 config zone
	option name 'vpn'
	option network 'vpn0 vpn1 vpn2 vpn3'
	option conntrack '1'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'
 config forwarding
	option src 'vpn'
	option dest 'lan'
 config forwarding
	option src 'lan'
	option dest 'vpn'
 config forwarding
	option src 'vpn'
	option dest 'wan'

/etc/firewall.user に以下追記

 iptables -I INPUT  -m policy --dir in --pol ipsec --proto esp -j ACCEPT
 iptables -I FORWARD  -m policy --dir in --pol ipsec --proto esp -j ACCEPT
 iptables -I FORWARD  -m policy --dir out --pol ipsec --proto esp -j ACCEPT
 iptables -I OUTPUT   -m policy --dir out --pol ipsec --proto esp -j ACCEPT


ここまで、およびこれからの設定ファイルについて、いずれも最終行で改行しておくこと。
ここまででルータ再起動
ルータ再起動後

 opkg update
 opkg install strongswan-full
 opkg install ipsec-tools openssl-util
 opkg install xl2tpd