# # L2TP/IPsecを使用したリモートアクセス : ルーター コマンド設定 # # # ルーター 複数のL2TPクライアント(アドレス不定)の接続を受け付ける場合 # # # ゲートウェイの設定 # ip route default gateway pp 1 # # LANインターフェースの設定 # ip lan1 address 192.168.100.1/24 ip lan1 proxyarp on # # WANインターフェースの設定 # pp select 1 pp always-on on pppoe use lan2 pp auth accept pap chap pp auth myname (ISPに接続するID) (ISPに接続するパスワード) ppp lcp mru on 1454 ppp ipcp ipaddress on ppp ipcp msext on ppp ccp type none ip pp mtu 1454 ip pp nat descriptor 1 pp enable 1 # # L2TP接続を受け入れるための設定 # pp select anonymous pp bind tunnel1 tunnel2 tunnel3 pp auth request chap-pap pp auth username (PPPユーザー名1) (PPPパスワード1) pp auth username (PPPユーザー名2) (PPPパスワード2) pp auth username (PPPユーザー名3) (PPPパスワード3) ppp ipcp ipaddress on ppp ipcp msext on ip pp remote address pool 192.168.100.10-192.168.100.20 ip pp mtu 1258 pp enable anonymous # # L2TP接続で使用するトンネル1の設定 # tunnel select 1 tunnel encapsulation l2tp ipsec tunnel 101 ipsec sa policy 101 1 esp aes-cbc sha-hmac ipsec ike keepalive use 1 off ipsec ike local address 1 192.168.100.1 ipsec ike nat-traversal 1 on ipsec ike pre-shared-key 1 text (事前共有鍵) ipsec ike remote address 1 any l2tp tunnel disconnect time off l2tp keepalive use on 10 3 l2tp keepalive log on l2tp syslog on ip tunnel tcp mss limit auto tunnel enable 1 # # L2TP接続で使用するトンネル2の設定 # tunnel select 2 tunnel encapsulation l2tp ipsec tunnel 102 ipsec sa policy 102 2 esp aes-cbc sha-hmac ipsec ike keepalive use 2 off ipsec ike local address 2 192.168.100.1 ipsec ike nat-traversal 2 on ipsec ike pre-shared-key 2 text (事前共有鍵) ipsec ike remote address 2 any l2tp tunnel disconnect time off l2tp keepalive use on 10 3 l2tp keepalive log on l2tp syslog on ip tunnel tcp mss limit auto tunnel enable 2 # # L2TP接続で使用するトンネル3の設定 # tunnel select 3 tunnel encapsulation l2tp ipsec tunnel 103 ipsec sa policy 103 3 esp aes-cbc sha-hmac ipsec ike keepalive use 3 off ipsec ike local address 3 192.168.100.1 ipsec ike nat-traversal 3 on ipsec ike pre-shared-key 3 text (事前共有鍵) ipsec ike remote address 3 any l2tp tunnel disconnect time off l2tp keepalive use on 10 3 l2tp keepalive log on l2tp syslog on ip tunnel tcp mss limit auto tunnel enable 3 # # NATの設定 # nat descriptor type 1 masquerade nat descriptor address outer 1 ipcp nat descriptor address inner 1 auto nat descriptor masquerade static 1 1 192.168.100.1 esp nat descriptor masquerade static 1 2 192.168.100.1 udp 500 nat descriptor masquerade static 1 3 192.168.100.1 udp 4500 # # IPsecのトランスポートモード設定 # ipsec transport 1 101 udp 1701 ipsec transport 2 102 udp 1701 ipsec transport 3 103 udp 1701 ipsec auto refresh on # # DNSの設定 # dns server (ISPから指定されたDNSサーバーのIPアドレス) dns private address spoof on # # L2TPの設定 # l2tp service on