インターネットのコアはCiscoとJuniperで出来ている。自分で作ったことはないがたぶんそうなっていると思う。そしてインターネットはBGP4で動いている。遠からずインターネット上で一般的にIPv6が動くようになると思うので、CiscoとJuniperをつないでIPv6のBGP接続を試してみた。
BGP4はIPv4以外のプロトコルも扱えるように機能拡張ができるようになっており、IPv6にもその仕組みで対応をしている。IPv6対応のBGP4をBGP4+とも呼ぶ。
BGPを使うときは経路の優先制御やフィルタなどの様々なポリシーを設定するが、まずは繋ぐだけの簡単な設定をしてみよう。Cisco側はAS番号1111、Juniper側はAS番号2222で、eBGP接続をしている。またそれぞれ1台ずつ、iBGP接続もしている。
Ciscoの設定は以下のとおり。
Cisco#show config ! version 12.2 ! hostname Cisco ! ip subnet-zero ! ipv6 unicast-routing ! interface GigabitEthernet1/1 ip address 10.0.0.1 255.255.255.252 ipv6 address 2000::1/64 ipv6 enable ! interface GigabitEthernet1/2 ip address 172.16.0.254/24 ipv6 address 2001::1/64 ipv6 enable ! interface Loopback0 ip address 172.16.255.254/32 ipv6 address 2001:0:0:255::254/128 ipv6 enable ! router bgp 1111 no synchronization bgp log-neighbor-changes neighbor 172.16.255.253 remote-as 1111 neighbor 10.0.0.2 remote-as 2222 neighbor 2001:0:0:255::253 remote-as 1111 neighbor 2000::2 remote-as 2222 no auto-summary ! address-family ipv6 neighbor 2001:0:0:255::253 activate neighbor 2001:0:0:255::253 update-source Loopback0 neighbor 2001:0:0:255::253 soft-reconfiguration inbound neighbor 2000::2 activate neighbor 2000::2 soft-reconfiguration inbound network 2002::/48 exit-address-family ! address-family ipv4 neighbor 172.16.255.253 activate neighbor 172.16.255.253 update-source Loopback0 neighbor 172.16.255.253 soft-reconfiguration inbound neighbor 10.0.0.2 activate neighbor 10.0.0.2 soft-reconfiguration inbound network 172.16.0.0 mask 255.255.240.0 exit-address-family ! ip classless ! ip route 172.16.0.0 255.240.0.0 Null0 ! ipv6 route 2001::/48 Null0 ! line con 0 line vty 0 4 line vty 5 15 ! end
Juniperの設定は以下のとおり。
interfaces {
fe-0/0/0 {
unit 0 {
family inet {
address 10.0.0.2/30;
}
family inet6 {
address 2000::2/64;
address fe80::2/64;
}
}
}
fe-0/0/1 {
unit 0 {
family inet {
address 192.168.0.254/24;
}
family inet6 {
address 2002::1/64;
address fe80::1/64;
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.255.254/32;
}
family inet6 {
address 2002:0:0:255::254/128;
address fe80::1/128;
}
}
}
}
routing-options {
rib inet6.0 {
static {
route 2002::/48 discard;
}
}
static {
route 192.168.0.0/16 discard;
}
router-id 192.168.255.254;
autonomous-system 2222;
}
protocols {
bgp {
remove-private;
group IBGP {
type internal;
local-address 192.168.255.254;
export ( LOCAL BGP);
peer-as 2222;
neighbor 192.168.255.253;
}
group IBGP6 {
type internal;
local-address 2002:0:0:255::254;
export ( LOCAL6 BGP);
peer-as 2222;
neighbor 2002:0:0:255::253;
}
group EBGP_Cisco {
type external;
export ( LOCAL BGP);
peer-as 1111;
neighbor 10.0.0.1;
}
group EBGP_Cisco6 {
type external;
export ( LOCAL6 BGP);
peer-as 1111;
neighbor 2000::2;
}
}
}
policy-options {
policy-statement LOCAL {
term 10 {
from {
protocol static;
route-filter 192.168.0.0/16 exact;
}
then accept;
}
then reject;
}
policy-statement LOCAL6 {
term 10 {
from {
protocol static;
route-filter 2002::/48 exact;
}
then accept;
}
then reject;
}
policy-statement BGP {
term 10 {
from protocol bgp;
then accept;
}
then reject;
}
}
設定の量が増えるため省略しているが、各AS内ではOSPFなどが適切に動いていて、IBGPのルータID同士が通信できる必要がある。またEBGPのネットワークもOSPF Passiveなどにしておいて、IBGPルータのためにネクストホップが解決されている必要がある。