测试环境依然用上次测STT的两台物理机, 已有的网络环境如下:
node1, duduo.seg,
ubuntu@duduo:~$ sudo cat /etc/quagga/bgpd.conf
hostname duduo
password zebra
log file /var/log/quagga/bgpd.log
log stdout
!
router bgp 100
no synchronization
bgp router-id 10.230.56.15
network 192.168.1.0/24
neighbor 10.230.56.21 remote-as 200
neighbor 10.230.56.21 description test-v4
neighbor 2001:db8:3::2 remote-as 200
neighbor 2001:db8:3::2 description test-v6
no auto-summary
no neighbor 2001:db8:3::2 activate
!
address-family ipv6
network 2001:db8:1::/48
network 2001:db8:1::/56
network 2001:db8:1::/64
neighbor 2001:db8:3::2 activate
neighbor 2001:db8:3::2 route-map IPV6-OUT out
exit-address-family
!
ipv6 prefix-list pl-ipv6 seq 10 permit 2001:db8:1::/56 le 64
route-map IPV6-OUT permit 10
match ipv6 address prefix-list pl-ipv6
set ipv6 next-hop global 2001:db8:3::1
!
line vty
!
debug bgp events
debug bgp filters
!debug bgp fsm
!debug bgp keepalives
debug bgp updates
ubuntu@voltorb:~$ sudo cat /etc/quagga/bgpd.conf
hostname voltorb
password zebra
log file /var/log/quagga/bgpd.log
log stdout
!
router bgp 200
no synchronization
bgp router-id 10.230.56.21
network 192.168.2.0/24
neighbor 10.230.56.15 remote-as 100
neighbor 10.230.56.15 description test-v4
neighbor 2001:db8:3::1 remote-as 100
neighbor 2001:db8:3::1 description test-v6
no auto-summary
no neighbor 2001:db8:3::1 activate
!
address-family ipv6
network 2001:db8:2::/48
network 2001:db8:2::/56
network 2001:db8:2::/64
neighbor 2001:db8:3::1 activate
neighbor 2001:db8:3::1 route-map IPV6-OUT out
exit-address-family
!
ipv6 prefix-list pl-ipv6 seq 10 permit 2001:db8:2::/56 le 64
route-map IPV6-OUT permit 10
match ipv6 address prefix-list pl-ipv6
set ipv6 next-hop global 2001:db8:3::2
!
line vty
!
debug bgp events
debug bgp filters
!debug bgp fsm
!debug bgp keepalives
debug bgp updates
ubuntu@duduo:~$ sudo vtysh
Hello, this is Quagga (version 0.99.22.4).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
duduo# show bgp summary
BGP router identifier 10.230.56.15, local AS number 100
RIB entries 6, using 672 bytes of memory
Peers 2, using 9120 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:db8:3::2 4 200 10 11 0 0 0 00:06:30 2
Total number of neighbors 1
ubuntu@voltorb:~$ sudo vtysh
Hello, this is Quagga (version 0.99.22.4).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
voltorb# show bgp summary
BGP router identifier 10.230.56.21, local AS number 200
RIB entries 6, using 672 bytes of memory
Peers 2, using 9120 bytes of memory
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2001:db8:3::1 4 100 11 14 0 0 0 00:08:22 2
Total number of neighbors 1
2016/07/04 09:29:46 BGP: BGPd 0.99.22.4 starting: vty@2605, bgp@<all>:179
2016/07/04 09:29:46 BGP: Import timer expired.
2016/07/04 09:29:49 BGP: [Event] BGP connection from host 2001:db8:3::2
2016/07/04 09:29:49 BGP: [Event] BGP connection IP address 2001:db8:3::2 is Idle state
2016/07/04 09:29:50 BGP: 2001:db8:3::2 [Event] Connect start to 2001:db8:3::2 fd 13
2016/07/04 09:29:51 BGP: 2001:db8:3::2 send UPDATE 2001:db8:1::/56
2016/07/04 09:29:51 BGP: 2001:db8:3::2 send UPDATE 2001:db8:1::/64
2016/07/04 09:29:51 BGP: 2001:db8:3::2 rcvd UPDATE w/ attr: , origin i, mp_nexthop 2001:db8:3::2(fe80::3ea8:2aff:fe21:9908), metric 0, path 200
2016/07/04 09:29:51 BGP: 2001:db8:3::2 rcvd 2001:db8:2::/56
2016/07/04 09:29:51 BGP: 2001:db8:3::2 rcvd UPDATE w/ attr: , origin i, mp_nexthop 2001:db8:3::2(fe80::3ea8:2aff:fe21:9908), metric 0, path 200
2016/07/04 09:29:51 BGP: 2001:db8:3::2 rcvd 2001:db8:2::/64
2016/07/04 09:29:53 BGP: 10.230.56.21 [Event] Connect start to 10.230.56.21 fd 14
2016/07/04 09:29:54 BGP: 10.230.56.21 send UPDATE 192.168.1.0/24
2016/07/04 09:29:54 BGP: 10.230.56.21 rcvd UPDATE w/ attr: nexthop 10.230.56.21, origin i, metric 0, path 200
2016/07/04 09:29:54 BGP: 10.230.56.21 rcvd 192.168.2.0/24
2016/07/04 09:29:11 BGP: 2001:db8:3::1 [Event] Connect start to 2001:db8:3::1 fd 13
2016/07/04 09:29:11 BGP: stream_read_try: read failed on fd 13: Connection reset by peer
2016/07/04 09:29:11 BGP: 2001:db8:3::1 [Error] bgp_read_packet error: Connection reset by peer
2016/07/04 09:29:12 BGP: [Event] BGP connection from host 2001:db8:3::1
2016/07/04 09:29:12 BGP: [Event] Make dummy peer structure until read Open packet
2016/07/04 09:29:12 BGP: 2001:db8:3::1 [Event] Transfer accept BGP peer to real (state Active)
2016/07/04 09:29:12 BGP: 2001:db8:3::1 [Event] Accepting BGP peer delete
2016/07/04 09:29:13 BGP: 2001:db8:3::1 send UPDATE 2001:db8:2::/56
2016/07/04 09:29:13 BGP: 2001:db8:3::1 send UPDATE 2001:db8:2::/64
2016/07/04 09:29:13 BGP: 2001:db8:3::1 rcvd UPDATE w/ attr: , origin i, mp_nexthop 2001:db8:3::1(fe80::8edc:d4ff:feb3:9c3c), metric 0, path 100
2016/07/04 09:29:13 BGP: 2001:db8:3::1 rcvd 2001:db8:1::/56
2016/07/04 09:29:13 BGP: 2001:db8:3::1 rcvd UPDATE w/ attr: , origin i, mp_nexthop 2001:db8:3::1(fe80::8edc:d4ff:feb3:9c3c), metric 0, path 100
2016/07/04 09:29:13 BGP: 2001:db8:3::1 rcvd 2001:db8:1::/64
2016/07/04 09:29:15 BGP: [Event] BGP connection from host 10.230.56.15
2016/07/04 09:29:15 BGP: [Event] Make dummy peer structure until read Open packet
2016/07/04 09:29:15 BGP: 10.230.56.15 [Event] Transfer accept BGP peer to real (state Active)
2016/07/04 09:29:15 BGP: 10.230.56.15 [Event] Accepting BGP peer delete
2016/07/04 09:29:16 BGP: 10.230.56.15 send UPDATE 192.168.2.0/24
2016/07/04 09:29:16 BGP: 10.230.56.15 rcvd UPDATE w/ attr: nexthop 10.230.56.15, origin i, metric 0, path 100
2016/07/04 09:29:16 BGP: 10.230.56.15 rcvd 192.168.1.0/24
ubuntu@duduo:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.230.56.1 0.0.0.0 UG 0 0 0 eth6
10.230.56.0 0.0.0.0 255.255.248.0 U 0 0 0 eth6
10.230.56.0 0.0.0.0 255.255.248.0 U 0 0 0 br-ex
10.230.56.0 0.0.0.0 255.255.248.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br-phy
192.168.2.0 10.230.56.21 255.255.255.0 UG 0 0 0 eth6
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 br-phy
ubuntu@duduo:~$ route -n |grep 192.168.2
192.168.2.0 10.230.56.21 255.255.255.0 UG 0 0 0 eth6
ubuntu@duduo:~$ ping -c 1 192.168.2.1
PING 192.168.2.1 (192.168.2.1) 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.232 ms
--- 192.168.2.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.232/0.232/0.232/0.000 ms
ubuntu@duduo:~$ ping6 -c 1 2001:db8:2::1
PING 2001:db8:2::1(2001:db8:2::1) 56 data bytes
64 bytes from 2001:db8:2::1: icmp_seq=1 ttl=64 time=0.287 ms
--- 2001:db8:2::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.287/0.287/0.287/0.000 ms
ubuntu@duduo:~$ route -n -6 |grep 2001:db8:2
2001:db8:2::/64 fe80::3ea8:2aff:fe21:9908 UG 1024 1 0 eth6
2001:db8:2::/56 fe80::3ea8:2aff:fe21:9908 UG 1024 0 0 eth6