LoginSignup
9
9

More than 5 years have passed since last update.

Juniper SRXでフレッツIPoEのDHCPv6-PD設定

Last updated at Posted at 2018-05-15

Juniper SRX(SRX340)を使って、フレッツIPoE接続のDHCPv6-PDでアドレスを受け取るためのconfig例です。

前提

  • SRX340 + JUNOS 15.1X49-D110.4で確認
  • フレッツはひかり電話契約あり(/56を受け取るためだけに契約しており、電話機能は使っていません)
  • 接続先サービスは、IIJ IPv6 FiberAccess/Fサービス タイプIPoEを使用
  • ge-0/0/6 にONUのoutが接続されている
  • ge-0/0/5 にLANが接続されている
  • IPv6が有効になっている (set security forwarding-options family inet6 mode flow-based)

以下は前提ではないですが注意すべき点です。

  • IPv4用のPPPoEと、IPv6用のDHCPv6は、同じインタフェース上に設定できないので、ONUとSRXの間にスイッチを置いて分岐するなどして、PPPoEとDHCPv6用のそれぞれ別のインタフェースに接続・設定する必要がある。(Can't configure protocol family with encapsulation ppp-over-ether と出てcommitできません)

1. DHCPv6-PDでprefixを受け取る

config

# DHCPv6ステートフルに設定
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client client-type statefull

# Prefix Delegationでアドレス取得
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client client-ia-type ia-pd

# クライアント識別子はLink Layerアドレス
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client client-identifier duid-type duid-ll

# DHCPv6で受け取る情報(ネームサーバー、検索ドメイン名、NTPサーバー、SIPサーバー)
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client req-option dns-server
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client req-option domain
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client req-option ntp-server
# SIPサーバーは全く利用しませんがこういう情報も取れるという例として
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client req-option sip-server

# UntrustゾーンからSRXにDHCPv6の通信を許可
set security zones security-zone Untrust host-inbound-traffic system-services dhcpv6
# interface指定する場合
#set security zones security-zone Untrust interfaces ge-0/0/6.0 host-inbound-traffic system-services dhcpv6

確認

user@srx340> show dhcpv6 client binding detail

Client Interface/Id: ge-0/0/6.0
     Hardware Address:             d8:b1:22:xx:xx:xx
     State:                        BOUND(DHCPV6_CLIENT_STATE_BOUND)
     ClientType:                   STATEFUL
     Lease Expires:                2018-05-15 22:17:33 JST
     Lease Expires in:             14365 seconds
     Lease Start:                  2018-05-15 18:17:33 JST
     Bind Type:                    IA_PD
     Preferred prefix length       0
     Sub prefix length             64
     Client DUID:                  LL0x3-d8:b1:22:xx:xx:xx
     Rapid Commit:                 Off
     Server Identifier:            fe80::226:cbff:xxxx:xxxx
     Client IP Prefix:             2409:10:xxxx:xxxx::/56

DHCP options:
    Name: server-identifier, Value: LL0x1-00:0d:5e:xx:xx:xx
    Name: sip-server-list, Value: 2404:1a8:71ff:ff00::1
    Name: dns-recursive-server, Value: 2404:1a8:7f01:a::3,2404:1a8:7f01:b::3
    Name: domain-serch-list, Value: flets-eastjpiptvfjp
    Name: sntp, Value: 2404:1a8:1102::a,2404:1a8:1102::b

2. フレッツ側からRAを受け取り、default gatewayを設定

受け取ったRAをもとにdefault gatewayを自動でセットする方法が不明で、仕方なくRAを一旦受け取って、gatewayのアドレスを取得してから、手でルーティングを設定しています。

多くの和製ルーターのように、インタフェースに向けてデフォルトルートを設定1できれば一番ラクなのですが、こうするとcommit時にエラーになってしまいます。
(例: bad next-hop ge-0/0/6.0 -- next-hop ge-0/0/6.0 is not point-to-point)
ナレッジベースによれば、インタフェースに向けてルーティングするには、Point to Pointのインターフェースである必要があるそうです。([SRX] The message, 'error: bad next-hop' is seen when IP Monitoring is configured)

RAを受け取るconfig

set protocols router-advertisement interface ge-0/0/6.0

確認

user@srx340> show ipv6 router-advertisement interface ge-0/0/6.0
Interface: ge-0/0/6.0
  Advertisements sent: 134, last sent 00:02:49 ago
  Solicits received: 0
  Advertisements received: 339
  Solicited router advertisement unicast: Disable
  Advertisement from fe80::226:cbff:xxxx:xxxx, heard 00:00:30 ago
    Managed: 1 [0]
    Other configuration: 1 [0]
    Link MTU: 1500 bytes
    Reachable time: 300000 ms
    Default lifetime: 1800 sec
    Retransmit timer: 10000 ms
    Current hop limit: 64

default gateway設定するconfig

qualified-next-hop に続けて、RAで受け取ったgatewayのアドレスを入れます。

set routing-options rib inet6.0 static route ::/0 qualified-next-hop fe80::226:cbff:xxxx:xxxx interface ge-0/0/6.0

確認

user@srx340> show route table inet6.0

inet6.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

::/0               *[Static/5] 00:00:20
                    > to fe80::226:cbff:xxxx:xxxx via ge-0/0/6.0
(以下略)

3. LANに対してprefixを広告する

DHCPv6-PDで受け取ったprefixをLAN側インターフェースに広告します。
DHCPv6のオプションにupdate-router-advertisementを指定すると、受け取った情報をもとに広告するインタフェースを指定できます。

/56を受け取っているので、/64で配る際に、どのprefixを使うかを選びたいところなんですが2、update-router-advertisementで広告する場合は、そういうことはできないようです。(0から順番に振られます)
思う通りに配布したかったら自分で set protocols router-advertisement ... prefix xxxx/64 みたいに、RAの指定をちゃんと書けということなんだと思います。

config

以下の設定に加えてセキュリティの設定もしないと通信ができませんが、このへんはIPv4と大して変わらないので割愛します。

# ge-0/0/5.0にRAする
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0

# Mフラグをセットしない場合
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0 no-managed-configuration

# Mフラグをセットする場合
#set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0 managed-configuration

# Oフラグをセットしない場合
set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0 no-other-stateful-configuration

# Oフラグをセットする場合
#set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0 other-stateful-configuration

# RDNSSでDNSサーバーを広告する場合(だと思います。ドキュメントの記載が見つからない。未検証です)
#set interfaces ge-0/0/6 unit 0 family inet6 dhcpv6-client update-router-advertisement interface ge-0/0/5.0 enable-recursive-dns-server-option

確認

user@srx340> show ipv6 router-advertisement interface ge-0/0/5.0
Interface: ge-0/0/5.0
  Advertisements sent: 8, last sent 00:03:09 ago
  Solicits received: 0
  Advertisements received: 0
  Solicited router advertisement unicast: Disable

user@srx340> show interfaces ge-0/0/5.0
  Logical interface ge-0/0/5.0 (Index 83) (SNMP ifIndex 543)
    Flags: Up SNMP-Traps 0x0 Encapsulation: ENET2
    Input packets : 708
    Output packets: 1333
    Security: Zone: Trust
    Allowed host-inbound traffic : bootp dns dhcp finger ftp tftp ident-reset http https ike netconf ping reverse-telnet reverse-ssh
    rlogin rpm rsh snmp snmp-trap ssh telnet traceroute xnm-clear-text xnm-ssl lsping ntp sip dhcpv6 r2cp webapi-clear-text webapi-ssl
    tcp-encap
    Protocol inet6, MTU: 1500
    Max nh cache: 100000, New hold nh limit: 100000, Curr nh cnt: 2, Curr new hold cnt: 0, NH drop cnt: 0
      Flags: None
      Addresses, Flags: Is-Preferred Is-Primary
        Destination: 2409:10:xxxx:xx00::/64, Local: 2409:10:xxxx:xx00::1
      Addresses, Flags: Is-Preferred
        Destination: fe80::/64, Local: fe80::dab1:22ff:xxxx:xxxx

user@srx340> show route table inet6.0

inet6.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

::/0               *[Static/5] 07:47:35
                    > to fe80::226:cbff:xxxx:xxxx via ge-0/0/6.0
2409:10:xxxx:xxxx::/64
                   *[Direct/0] 1d 00:16:44
                    > via ge-0/0/5.0
2409:10:xxxx:xx00::1/128
                   *[Local/0] 1d 00:16:55
                      Local via ge-0/0/5.0
(以下略)

radmin@srx340> show dhcpv6 client binding detail

Client Interface/Id: ge-0/0/6.0
     Hardware Address:             d8:b1:22:xx:xx:xx
     State:                        BOUND(DHCPV6_CLIENT_STATE_BOUND)
     ClientType:                   STATEFUL
     Lease Expires:                2018-05-17 15:54:37 JST
     Lease Expires in:             9820 seconds
     Lease Start:                  2018-05-17 11:54:37 JST
     Bind Type:                    IA_PD
     Preferred prefix length       0
     Sub prefix length             0
     Client DUID:                  LL0x3-d8:b1:22:xx:xx:xx
     Rapid Commit:                 Off
     Server Identifier:            fe80::226:cbff:xxxx:xxxx
     Client IP Prefix:             2409:10:xxxx:xxxx::/56

DHCP options:
    Name: server-identifier, Value: LL0x1-00:0d:5e:xx:xx:xx
    Name: sip-server-list, Value: 2404:1a8:71ff:ff00::1
    Name: dns-recursive-server, Value: 2404:1a8:7f01:a::3,2404:1a8:7f01:b::3
    Name: domain-serch-list, Value: flets-eastjpiptvfjp
    Name: sntp, Value: 2404:1a8:1102::a,2404:1a8:1102::b

Update RA interfaces:
     Interface: ge-0/0/5.0
            RA Prefix:      2409:10:xxxx:xx00::/64

ここまでやって、フレッツNGN網を使ったIPv6 IPoE通信ができるようになりました。

感想

  • 設定すれば通信はできる
  • 和製ルーターやCISCOにある細かい便利機能はない
  • お手軽に参考になるドキュメントがない。つらいので書きました

参考


  1. ヤマハRTXシリーズにおける ipv6 route default gateway dhcp lan2 みたいな設定 

  2. ヤマハRTXシリーズにおける ipv6 lan1 prefix dhcp-prefix@lan2::1:0:0:0:1/64 みたいな設定 

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9