Quggaを使用してIPv 4/IPv 6 BGP双スタック動的経路をテストする(by quqi 99)

10675 ワード

作者:张华 2010-07-04著作権声明:任意で転載してもいいです.転載する時は必ずハイパーリンク形式で文章の原本の出所と作者の情報と著作権の声明を明示してください.
(http://blog.csdn.net/quqi99 )
テスト環境 
テスト環境は前回STTを測定した2台の物理機を依然として使っています.既存のネットワーク環境は以下の通りです.
node 1、duduo.seg、 
  • eth 0:10.23.56.14、  1000 M/s、 bb-ex
  • eth 6:10.23.56.15、 100000 Mb/s,out-off-band management
  • eth 7:192.168.122.2,000 Mb/s,bb-phy
  • sudoov-vsctl--may-exist add-br bs-exsudo overs-vsctl--may-exist add-port bred-ex eth 0 sudo ifconfig eth 0 0.0.0 usudo ifconfig breg-ex 10.23.53/21
    sudoovas-vsctl--may-exist add-br bs-physudio ovas-vsctl----may-exist add-port bred-phy eth 7 sudo ifconfig eth 7 0.0.0 uusdo fconfig bred-phy 192.168.122.2/24
    node 2,voltorb.seg
  • eth 0:10.23.56.21、  1000 M/s,out-off-band management
  • eth 4:192.168.122.3,10000 Mb/s,bb-phy
  • sudoovas-vsctl--may-exist add-br bs-physudio ovas-vsctl----may-exist add-port bred-phy eth 4 sudo ifconfig eth 4 0.0.0 usudo fconfig bred-phy 192.168.122.3/24
    今回のBGP実験計画の新たなネットワーク環境は以下の通りである.
    -------------------      -------------------------------|   eth 6:10.23.56.15/21    |-------|   eth 0:10.23.56.21/21    ||   eth 6:2001:db 8:3:1/64   |       |   eth 0:2001:db 8:3:2/64   ||     AS:100                |       |     AS:200                || br-phy:2001:db 8:1:1/64   |-------| br-phy:2001:db 8:2:1/64   |       | br-phy:192.168.1.1/24     |       | br-phy:192.168.2.1/24     |-------------------------------       -------------------------------sudo ip addr add 2001:db 8:3:1/64 dev eth 6 sudo ip addr add 2001:db 8:1:1/64 dev bro ip add 192.168.1.1/24 dev bri-phy
    sudo ip addr add 2001:db 8:3:2/64 dev eth 0 sudo ip addr add 2001:db 8:2:1/64 dev bri-physud ip add 192.168.2.1/24 dev bri-phy
    Qugga設置及びファイアウォール配置
    sudo ap-get install quagga sudo chown quagga.quagga vty/etc/quagga/*.confsudo chmod 640/etc/quagga/*.conf
    echo「net.ipv 4.conf.all.forwarding=1」sudo tee-a/etc/syssctl.co nf echo「net.ipv 4.conf.default.forwarding=1」sudo tee-a/etc/syssctl.com nf sed's/膋net.ipv.6.conf.all.forwarding=1/net.ipv 6.conf.all.forwarding=1/g'/etc/syssctl.co.com/etc/syssctl.co.com fecho「net.ipv 6.conf.deultwarding.」 sudo syssctl-psp 6 tables-F
    dport 179-j ACCEPTSUNT iptables-A INPUT-A INPUT-p tcp--dport 179-j ACCEPTドiptables-A INPUT-p-p tcp--sport 179-j ACCEPT to zbbbbrishatbles-A INPUT-atcdpop-sport 175-sport ttcp-sport 179-ap p-app-ap-app-app ttttppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppj ACCEPT
    Qugg aプロファイル
    1,両ノードのプロファイル /etc/quagga/zbraa.com nf
    sudo cp/usr/share/doc/quagga/examples/zbraa.co.com/sample/etc/quagga/zbraa.com nf
    ubuntu@duduo:~$sudo cat/etc/quagga/zbraa.com nfhostname duo        #もう一つのノードは、voltorbpassword zbranable password zbralogfile/var/log/quagga/zbra.logsに修正されました.
    1,両ノードのプロファイル /etc/quagga/daemens
    ubuntu@duduo:~sudo cat/etc/quagga/daemens ゼブラ=yesbgpd=yesospfd=noospf 6 d=noripd=noripgd=noisisd=nobabed=no
    3, 両ノードのプロファイル /etc/quagga/bgpd.com nfは以下の通りです.
    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
    検証結果
    両ノードにおいてquaggaプロセスを再開した後に観測された隣人情報は以下の通りである.
    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