このドキュメントでは、インターフェイス Null0 を使用する IPv6 の Black-Holing の設定方法を説明します。 ブラック ホール ルーティングは、不正送信元からのトラフィック、またはサービス拒絶(DoS)攻撃によって生成されるトラフィックなどの望ましくないトラフィックを、デッド インターフェイス、または調査のため情報収集を目的とするホストへ動的にルーティングすることによって、管理者がそのようなトラフィックをブロックし、ネットワークへの攻撃の影響を緩和する方法です。
この設定を行う前に、以下の要件を満たしていることを確認してください。
BGP ルーティング プロトコルとその動作
IPv6 アドレス割り当て方式
この 文書に記載されている 情報は Cisco IOS ® ソフトウェア リリース 15.0(1)が付いている Cisco 7200 シリーズ ルータに基づいています。
ドキュメント表記の詳細は、『シスコ テクニカル ティップスの表記法』を参照してください。
この項では、このドキュメントで説明する機能の設定に必要な情報を提供します。
注: このドキュメントで使用されているコマンドの詳細を調べるには、Command Lookup Tool(登録ユーザ専用)を使用します。
このドキュメントでは、次のネットワーク構成を使用しています。
このネットワークでは、ルータの R1 と R2 が相互に eBGP 関係を構築しています。 ルータは OSPFv3 を使用して内部的に通信します。 ルータ R1 では、送信元アドレスが 20:20::20/128 のパケットがすべて Null0 に転送されるような Null0 の設定によってブラックホール化が実現されます。 つまり、Null0 にルーティングされたすべてのトラフィックが破棄されます。
このドキュメントでは、次の設定を使用します。
ルータ R1 |
---|
! hostname R1 ! no ip domain lookup ip cef ipv6 unicast-routing ipv6 cef ! ! interface Loopback1 no ip address ipv6 address AA::1/128 ipv6 enable ipv6 ospf 10 area 0 ! interface Loopback10 no ip address ipv6 address AA:10::10/128 ipv6 enable ! interface FastEthernet1/0 no ip address speed auto duplex auto ipv6 address 2012:AA::1/64 ipv6 enable ipv6 ospf 10 area 0 ! router bgp 6501 bgp router-id 1.1.1.1 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor BB::1 remote-as 6502 neighbor BB::1 ebgp-multihop 2 neighbor BB::1 update-source Loopback1 ! address-family ipv4 exit-address-family ! address-family ipv6 redistribute static network AA:10::10/128 neighbor BB::1 activate exit-address-family ! ipv6 route 20:20::20/128 Null0 ipv6 router ospf 10 router-id 1.1.1.1 ! end |
ルータ R2 |
---|
! hostname R2 ! ipv6 unicast-routing ipv6 cef ! ! interface Loopback1 no ip address ipv6 address BB::1/128 ipv6 enable ipv6 ospf 10 area 0 ! interface Loopback20 no ip address ipv6 address 20:20::20/128 ipv6 enable ! interface FastEthernet1/0 no ip address speed auto duplex auto ipv6 address 2012:AA::2/64 ipv6 enable ipv6 ospf 10 area 0 ! router bgp 6502 bgp router-id 2.2.2.2 bgp log-neighbor-changes no bgp default ipv4-unicast neighbor AA::1 remote-as 6501 neighbor AA::1 ebgp-multihop 2 neighbor AA::1 update-source Loopback1 ! address-family ipv4 exit-address-family ! address-family ipv6 network 20:20::20/128 neighbor AA::1 activate exit-address-family ! ipv6 router ospf 10 router-id 2.2.2.2 ! end |
ここでは、設定が正常に動作していることを確認します。
Output Interpreter Tool(OIT)(登録ユーザ専用)では、特定の show コマンドがサポートされています。 OIT を使用して、show コマンド出力の解析を表示できます。
eBGP の設定を確認するには、ルータ R1 で show ipv6 route bgp コマンドと show bgp ipv6 unicast コマンドを使用します。
ルータ R1 |
---|
show ipv6 route R1#show ipv6 route bgp IPv6 Routing Table - default - 7 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary D - EIGRP, EX - EIGRP external, ND - Neighbor Discovery O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 !--- The router R2 advertises the network 20:20::20/128, !--- but still the routing table is empty.BGP で受信されたルートを確認するには、show bgp ipv6 unicast コマンドを使用します。 R1#show bgp ipv6 unicast BGP table version is 3, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, I - internal, r RIB-failure, S Stale Origin codes: I - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path * 20:20::20/128 BB::1 0 0 6502 I *> :: 0 32768 ? *> AA:10::10/128 :: 0 32768 I !--- Note that the route 20:20::20/128 is received, !--- but it is not installed in the routing table. |
送信元をループバック インターフェイス 20 として使用して、ルータ R1 からルータ R2 への ping を試みます。
R2#ping ipv6 AA:10::10 source lo20 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to AA:10::10, timeout is 2 seconds: Packet sent with a source address of 20:20::20 ..... Success rate is 0 percent (0/5) !--- The reason is the ICMP packet reaches !--- router R1 with source address as !--- 20:20::20/128 and therefore gets dropped.
送信元としてループバック インターフェイスを使用せずに、ルータ R1 からルータ R2 への ping を試みます。
R2#ping AA:10::10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to AA:10::10, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 8/61/180 ms !--- In this case, the ICMP packet has !--- the source address as BB::1.
ipv6 route 20:20::20/128 Null0 文がルータ R1 から削除されている場合は、ルータ R2 からアドバタイズされたルート 20:20::20/128 がルータ R1 のルーティング テーブルにインストールされます。 次に、出力例を示します。
ルータ R1 内 |
---|
R1(config)#no ipv6 route 20:20::20/128 Null0 !--- The Null0 command in removed from router R1. R1#show bgp ipv6 unicast BGP table version is 7, local router ID is 1.1.1.1 Status codes: s suppressed, d damped, h history, * valid, > best, I - internal, r RIB-failure, S Stale Origin codes: I - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 20:20::20/128 :: 0 32768 ? * BB::1 0 0 6502 I *> AA:10::10/128 :: 0 32768 I !--- After the removal of the statement, !--- the route 20:20::20/128 is shown as best route. R1#show ipv6 route bgp IPv6 Routing Table - default - 7 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, HA - Home Agent, MR - Mobile Router, R - RIP I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary D - EIGRP, EX - EIGRP external, ND - Neighbor Discovery O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 B 20:20::20/128 [20/0] via BB::1 !--- You can see that the route is displayed in routing table. |
ここで、送信元としてループバック インターフェイス Lo 20 を使用して、ルータ R1 からルータ R2 への ping を試みます。
R2#ping ipv6 AA:10::10 source lo20 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to AA:10::10, timeout is 2 seconds: Packet sent with a source address of 20:20::20 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/54/140 ms !--- You can see that the ping is successful.