YAMAHAルータでDS-Lite＋PPPoE＋L2TP/IPSec

# 前置き
YamahaルータでDS-Lite使っている人は多いと思います。
だけど自宅サーバだけはPPPoEにしたいという人もいると思うので、フィルター使って分けてる人もいると思います。
ついでにVPNもしたいっていう人もいると思うので、ここにconfig書いておきます。ちなみにNVR510です。
# Config
```
administrator password encrypted *
login user <ユーザ名> *
user attribute administrator=off connection=off gui-page=dashboard,lan-map,config
user attribute <ユーザ名> connection=serial,telnet,remote,ssh,sftp,http gui-page=dashboard,lan-map,config
login timer 21474836
ip route default gateway tunnel 1 gateway pp 1 filter 100 101 102 ⇒PPPoE通信したい機器のIPを指定したフィルタ番号
ipv6 prefix 1 ra-prefix@lan2::/64
ip lan1 address <ルータのIPアドレス>/24
ip lan1 proxyarp on
ipv6 lan1 address ra-prefix@lan2::1/64
ipv6 lan1 rtadv send 1 o_flag=on
ipv6 lan1 dhcp service server
description lan2 IPoE
ipv6 lan2 secure filter in 101000 101001 101002 101098
ipv6 lan2 secure filter out 101099 dynamic 101080 101081 101082 101083 101084 101085 101098 101099
ipv6 lan2 dhcp service client ir=on
pp select 1
 description pp PPPoE
 pp keepalive interval 30 retry-interval=30 count=12
 pp always-on on
 pppoe use lan2
 pppoe auto disconnect off
 pp auth accept pap chap
 pp auth myname <PPPoEユーザ名> <PPPoEパスワード>
 ppp lcp mru on 1454
 ppp ipcp ipaddress on
 ppp ipcp msext on
 ppp ccp type none
 ip pp secure filter in 200003 200020 200021 200022 200023 200024 200025 200030　200032 200100 200101 200102 200103 200104 200105
 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 tunnel2
 pp auth request chap-pap
 pp auth username <IPSecユーザ名> <IPSecパスワード>
 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
tunnel select 1
 tunnel name DSLite
 tunnel encapsulation ipip
 tunnel endpoint address 2404:8e00::feed:100
 ip tunnel mtu 1500
 ip tunnel tcp mss limit auto
 tunnel enable 1
tunnel select 2
 tunnel encapsulation l2tp
 ipsec tunnel 1
  ipsec sa policy 1 1 esp aes-cbc sha-hmac
  ipsec ike keepalive use 1 off
  ipsec ike nat-traversal 1 on
  ipsec ike pre-shared-key 1 text <事前共有鍵>
  ipsec ike remote address 1 any
 l2tp tunnel disconnect time off
 ip tunnel tcp mss limit auto
 tunnel enable 2
ip filter 100 pass <PPPoEで通信したい機器のIPアドレス> * * * *
ip filter 101 pass <PPPoEで通信したい機器のIPアドレス> * * * *
ip filter 102 pass <PPPoEで通信したい機器のIPアドレス> * * * *
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 200003 reject 192.168.100.0/24 * * * *
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.100.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.100.0/24 icmp * *
ip filter 200031 pass * 192.168.100.0/24 established * *
ip filter 200032 pass * 192.168.100.0/24 tcp * ident
ip filter 200033 pass * 192.168.100.0/24 tcp ftpdata *
ip filter 200034 pass * 192.168.100.0/24 tcp,udp * domain
ip filter 200035 pass * 192.168.100.0/24 udp domain *
ip filter 200036 pass * 192.168.100.0/24 udp * ntp
ip filter 200037 pass * 192.168.100.0/24 udp ntp *
ip filter 200099 pass * * * * *
ip filter 200100 pass * 192.168.100.1 udp * 500
ip filter 200101 pass * 192.168.100.1 esp * *
ip filter 200102 pass * 192.168.100.1 udp * 4500
ip filter 200103 pass * 192.168.100.1 udp * 1701
ip filter 200104 pass * 192.168.100.1 tcp * 1723
ip filter 200105 pass * 192.168.100.1 gre
ip filter 500000 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.100.1 udp 500
nat descriptor masquerade static 1000 2 192.168.100.1 esp
nat descriptor masquerade static 1000 3 192.168.100.1 udp 4500
nat descriptor masquerade static 1000 4 192.168.100.1 tcp 1723
nat descriptor masquerade static 1000 5 192.168.100.1 gre
ipsec auto refresh on
ipsec transport 2 1 udp 1701
ipv6 filter 101000 pass * * icmp6 * *
ipv6 filter 101001 pass * * tcp * ident
ipv6 filter 101002 pass * * udp * 546
ipv6 filter 101098 reject * * * * *
ipv6 filter 101099 pass * * * * *
ipv6 filter dynamic 101080 * * ftp
ipv6 filter dynamic 101081 * * domain
ipv6 filter dynamic 101082 * * www
ipv6 filter dynamic 101083 * * smtp
ipv6 filter dynamic 101084 * * pop3
ipv6 filter dynamic 101085 * * submission
ipv6 filter dynamic 101098 * * tcp
ipv6 filter dynamic 101099 * * udp
syslog notice off
syslog debug off
telnetd service off
dhcp service server
dhcp server rfc2131 compliant except remain-silent
dhcp scope 1 192.168.100.2-192.168.100.191/24
dns host lan1
dns service fallback on
dns server pp 1
dns server dhcp lan2
dns server select 500000 dhcp lan2 any .
dns server select 500001 pp 1 any . restrict pp 1
dns private address spoof on
dns private name <自分のDNS名>
schedule at 1 */* 01:00:00 * ntpdate ntp.nict.jp syslog
l2tp service on
analog supplementary-service pseudo call-waiting
analog extension dial prefix sip prefix="9#"
mail server smtp 1 <メールサーバ> port=587 smtp-auth "<メールアドレス>" <パスワード> plain
mail template 1 1 From:<送信元メールアドレス> To:<宛先メールアドレス>
mail notify 1 1 trigger lan-map
mail notify 2 1 trigger status all
sshd service on
sshd host key generate *
dashboard accumulate traffic on
dashboard accumulate nat on
```

#さいごに
これやべえだろっていう設定あったら教えてください！
いらんポート開けてたりするかも。