# NVR510 Rev.15.01.15 # Created by Kohakugin # このCONFIGでPPPoEとIPoE(OCN バーチャルコネクト)の2つのセッションが張れて # さらに外部からL2TP-VPNで接続できるようになります。L2TPはPPPoEセッション側で待ち受けます # ------------------------------------------------------ user attribute connection=serial,telnet,remote,ssh,sftp,http gui-page=dashboard,lan-map,config login-timer=300 # filter 100と101だけIPoE側へ行くようにしてあります。PPPoE側へGatewayを向けたいときは何も書かなくていいです # サーバー公開とかしたい時はPPPoE側へ向けてNAT通してポートを開けてあげればよいでしょう ip route default gateway pp 1 metric 1 gateway tunnel 2 filter 100 101 metric 2 # ipv6 route default gateway dhcp onu1 ipv6 prefix 1 dhcp-prefix@onu1::1/64 ip lan1 address 192.168.2.1/24 ip lan1 proxyarp on ipv6 lan1 address ra-prefix@onu1::1/64 ipv6 lan1 address dhcp-prefix@onu1::1/64 ipv6 lan1 rtadv send 1 o_flag=on ipv6 lan1 dhcp service server description onu1 OCNバーチャルコネクト ip onu1 address dhcp ipv6 onu1 address dhcp ipv6 onu1 secure filter in 200030 200031 200038 200039 ipv6 onu1 secure filter out 200099 dynamic 200080 200081 200082 200083 200084 200098 200099 ipv6 onu1 dhcp service client ngn type onu1 ntt pp disable all pp select 1 description pp provider pp keepalive interval 30 retry-interval=30 count=12 pp always-on on pppoe use onu1 pppoe auto disconnect off pp auth accept pap chap # PPPoEのPPP接続情報を書き換えてください pp auth myname PPP_USERNAME PPP_PASSWORD # ppp lcp mru on 1454 ppp ipcp ipaddress on ppp ccp type none ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030 200032 200100 200101 200102 200103 ip pp secure filter out 200013 200020 200021 200022 200023 200024 200025 200026 200027 200099 dynamic 200080 200081 200082 200083 200084 200085 200098 200099 ip pp nat descriptor 1000 pp enable 1 pp select anonymous pp bind tunnel1 pp auth request chap-pap # L2TP-VPNのログインユーザー名とパスワードを書き換えてください pp auth username VPN_USERNAME VPN_PASSWORD # ppp ipcp ipaddress on ppp ipcp msext on ppp ccp type none ip pp remote address pool dhcp ip pp mtu 1258 pp enable anonymous no tunnel enable all tunnel select 1 tunnel encapsulation l2tp ipsec tunnel 1 ipsec sa policy 1 1 esp aes-cbc sha-hmac ipsec ike keepalive use 1 off ipsec ike local address 1 192.168.2.1 ipsec ike nat-traversal 1 on # L2TPの事前共有キーを書き換えてください ipsec ike pre-shared-key 1 text PRE-SHAREDKEY # ipsec ike remote address 1 any l2tp tunnel disconnect time off ip tunnel tcp mss limit auto tunnel enable 1 tunnel select 2 tunnel encapsulation map-e tunnel map-e type ocn ip tunnel mtu 1460 ip tunnel secure filter in 200030 200039 ip tunnel secure filter out 200097 200098 200099 dynamic 200080 200082 200083 200084 200098 200099 ip tunnel nat descriptor 2000 tunnel enable 2 # ここでちゃんとIPアドレスごとにfilter定義しないとGatewayの振り分けができないです ip filter 100 pass 192.168.2.100 * * * * ip filter 101 pass 192.168.2.101 * * * * # ip filter 200000 reject 10.0.0.0/8 * * * * ip filter 200001 reject 172.16.0.0/12 * * * * ip filter 200002 reject 192.168.0.0/16 * * * * ip filter 200010 reject * 10.0.0.0/8 * * * ip filter 200011 reject * 172.16.0.0/12 * * * ip filter 200012 reject * 192.168.0.0/16 * * * ip filter 200013 reject * 192.168.2.0/24 * * * ip filter 200020 reject * * udp,tcp 135 * ip filter 200021 reject * * udp,tcp * 135 ip filter 200022 reject * * udp,tcp netbios_ns-netbios_ssn * ip filter 200023 reject * * udp,tcp * netbios_ns-netbios_ssn ip filter 200024 reject * * udp,tcp 445 * ip filter 200025 reject * * udp,tcp * 445 ip filter 200026 restrict * * tcpfin * www,21,nntp ip filter 200027 restrict * * tcprst * www,21,nntp ip filter 200030 pass * 192.168.2.0/24 icmp * * ip filter 200031 pass * 192.168.2.0/24 established * * ip filter 200032 pass * 192.168.2.0/24 tcp * ident ip filter 200033 pass * 192.168.2.0/24 tcp ftpdata * ip filter 200034 pass * 192.168.2.0/24 tcp,udp * domain ip filter 200035 pass * 192.168.2.0/24 udp domain * ip filter 200036 pass * 192.168.2.0/24 udp * ntp ip filter 200037 pass * 192.168.2.0/24 udp ntp * ip filter 200099 pass * * * * * ip filter 200100 pass * 192.168.2.1 udp * 500 ip filter 200101 pass * 192.168.2.1 esp * * ip filter 200102 pass * 192.168.2.1 udp * 4500 ip filter 200103 pass * 192.168.2.1 udp * 1701 ip filter 500000 restrict * * * * * ip filter 500001 restrict * * * * * ip filter dynamic 200080 * * ftp ip filter dynamic 200081 * * domain ip filter dynamic 200082 * * www ip filter dynamic 200083 * * smtp ip filter dynamic 200084 * * pop3 ip filter dynamic 200085 * * submission ip filter dynamic 200098 * * tcp ip filter dynamic 200099 * * udp nat descriptor type 1000 masquerade nat descriptor masquerade static 1000 1 192.168.2.1 udp 500 nat descriptor masquerade static 1000 2 192.168.2.1 esp nat descriptor masquerade static 1000 3 192.168.2.1 udp 4500 nat descriptor masquerade static 1000 4 192.168.2.1 udp 1701 nat descriptor type 2000 masquerade nat descriptor address outer 2000 map-e ipsec auto refresh on ipsec transport 1 1 udp 1701 ipv6 filter 200030 pass * * icmp6 * * ipv6 filter 200031 pass * * 4 ipv6 filter 200038 pass * * udp * 546 ipv6 filter 200039 reject * * ipv6 filter 200099 pass * * * * * ipv6 filter dynamic 200080 * * ftp ipv6 filter dynamic 200081 * * domain ipv6 filter dynamic 200082 * * www ipv6 filter dynamic 200083 * * smtp ipv6 filter dynamic 200084 * * pop3 ipv6 filter dynamic 200098 * * tcp ipv6 filter dynamic 200099 * * udp syslog debug off telnetd host lan dhcp service server dhcp server rfc2131 compliant except remain-silent dhcp scope 1 192.168.2.2-192.168.2.191/24 expire 7:00 maxexpire 7:00 # IPアドレスを割り当てたいMACアドレスに書き換えてください。割り当てたIPアドレスをfileter定義に使うのでちゃんと指定、コレ大事 dhcp scope bind 1 192.168.2.2 ethernet 00:00:00:00:00:00 dhcp scope bind 1 192.168.2.3 ethernet 11:11:11:11:11:11 # dhcp client release linkdown on dns host lan1 dns server 8.8.8.8 8.8.4.4 dns server dhcp onu1 dns server select 500000 dhcp onu1 any . dns server select 500001 8.8.8.8 8.8.4.4 any . restrict pp 1 dns private address spoof on dns private name setup.netvolante.jp schedule at 1 */* 00:00:00 * ntpdate ntp.nict.jp syslog l2tp service on statistics traffic on statistics nat on # 以下はひかり電話を使う人だけ設定してね analog supplementary-service pseudo call-waiting analog extension emergency-call-dial type normal-number analog extension dial prefix sip prefix="9#" analog extension dial prefix port=1 ngn onu1 analog extension dial prefix port=2 ngn onu1 sip use on sip codec permit onu1 g711u #