# # PPTPとL2TP/IPsecを使用して外出先からVPN接続する # # # 本社 ルーター # # # ゲートウェイの設定 # ip route default gateway pp 1 # # LANインターフェースの設定 # (LAN1ポートを使用) # ip lan1 address 192.168.0.1/24 ip lan1 proxyarp on # # WANインターフェースの設定 # (LAN2ポートを使用) # pp select 1 pp always-on on pppoe use lan2 pp auth accept pap chap pp auth myname (ISP1へ接続するID) (ISP1へ接続するパスワード) ppp lcp mru on 1454 ppp ipcp msext on ip pp address (固定グローバルIPアドレス) ip pp mtu 1454 ip pp secure filter in 1020 1030 1040 1041 1042 1043 1044 2000 ip pp secure filter out 1010 1011 1012 1013 1014 1015 3000 dynamic 100 101 102 103 104 105 106 ip pp nat descriptor 1 pp enable 1 # # PPTPまたはL2TP接続を受け入れるための設定 # pp select anonymous pp bind tunnel1-tunnel2 pp auth request mschap-v2 pp auth username (ユーザー名1) (パスワード1) pp auth username (ユーザー名2) (パスワード2) ppp ipcp ipaddress on ppp ipcp msext on ppp ccp type mppe-any ip pp remote address pool 192.168.0.192-192.168.0.199 ip pp mtu 1258 pptp service type server pp enable anonymous # # VPN(PPTP)の設定 # tunnel select 1 tunnel encapsulation pptp tunnel enable 1 pptp service on # # VPN(L2TP/IPsec)の設定 # tunnel select 2 tunnel encapsulation l2tp ipsec tunnel 2 ipsec sa policy 2 2 esp aes-cbc sha-hmac ipsec ike keepalive use 2 off ipsec ike local address 2 192.168.0.1 ipsec ike nat-traversal 2 on ipsec ike pre-shared-key 2 text (IPsecの事前共有鍵) 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 ipsec auto refresh on ipsec transport 1 2 udp 1701 l2tp service on # # フィルターの設定 # ip filter source-route on ip filter directed-broadcast on ip filter 1010 reject * * udp,tcp 135 * ip filter 1011 reject * * udp,tcp * 135 ip filter 1012 reject * * udp,tcp netbios_ns-netbios_ssn * ip filter 1013 reject * * udp,tcp * netbios_ns-netbios_ssn ip filter 1014 reject * * udp,tcp 445 * ip filter 1015 reject * * udp,tcp * 445 ip filter 1020 reject 192.168.0.0/24 * ip filter 1030 pass * 192.168.0.0/24 icmp ip filter 1040 pass * 192.168.0.1 tcp * 1723 ip filter 1041 pass * 192.168.0.1 gre ip filter 1042 pass * 192.168.0.1 udp * 500 ip filter 1043 pass * 192.168.0.1 udp * 4500 ip filter 1044 pass * 192.168.0.1 esp ip filter 2000 reject * * ip filter 3000 pass * * ip filter dynamic 100 * * ftp ip filter dynamic 101 * * www ip filter dynamic 102 * * domain ip filter dynamic 103 * * smtp ip filter dynamic 104 * * pop3 ip filter dynamic 105 * * tcp ip filter dynamic 106 * * udp # # NATの設定 # nat descriptor type 1 masquerade nat descriptor address outer 1 (固定グローバルIPアドレス) nat descriptor masquerade static 1 1 192.168.0.1 tcp 1723 nat descriptor masquerade static 1 2 192.168.0.1 gre nat descriptor masquerade static 1 3 192.168.0.1 udp 500 nat descriptor masquerade static 1 4 192.168.0.1 udp 4500 nat descriptor masquerade static 1 5 192.168.0.1 esp # # DHCPの設定 # dhcp service server dhcp server rfc2131 compliant except remain-silent dhcp scope 1 192.168.0.2-192.168.0.191/24 # # DNSの設定 # dns server (ISPから指定されたDNSサーバーのIPアドレス) dns private address spoof on