⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test_peering1.sh

📁 xorp源码hg
💻 SH
📖 第 1 页 / 共 3 页
字号:
    echo "TEST20 - EBGP peer single withdraw"    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 assert established    PACKET='packet update withdraw 30.30.30.0/24'    coord peer1 send $PACKET    # Make sure that the session still exists.    sleep 2    coord peer1 assert established    # Reset the connection    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    sleep 2    # Make a new connection.    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 assert established}test20_ipv6(){    echo "TEST20 IPV6 - EBGP peer single withdraw"    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true    coord peer1 assert established    PACKET='packet update withdraw6 2000::/3'    coord peer1 send $PACKET    # Make sure that the session still exists.    sleep 2    coord peer1 assert established    # Reset the connection    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    sleep 2    # Make a new connection.    coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true    sleep 2    coord peer1 assert established}test21(){    echo "TEST21 - EBGP peer update packet then corresponding withdraw"    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 assert established    PACKET_1="packet update	origin 1	aspath $PEER2_AS	nexthop 20.20.20.20	nlri 10.10.10.0/16"    PACKET_2='packet update withdraw 10.10.10.0/16'    coord peer1 send $PACKET_1    coord peer1 send $PACKET_2    # Make sure that the session still exists.    sleep 2    coord peer1 assert established    # Reset the connection    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    sleep 2    # Make a new connection.    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 assert established}test22(){    echo "TEST22 - EBGP Establish an IPV6 peering"    coord reset    coord target $HOST $PORT3    coord initialise attach peer1    coord peer1 establish AS $PEER3_AS holdtime 0 id 192.150.187.100 ipv6 true    coord peer1 assert established}test23(){    echo "TEST23"    echo "	1) Establish an IBGP IPV6 peering"    echo "	2) Send an IPv6 only update packet"    coord reset    coord target $HOST $PORT3    coord initialise attach peer1    coord peer1 establish AS $PEER3_AS holdtime 0 id 192.150.187.100 ipv6 true    PACKET="packet update	origin 1	aspath 1,2,[3,4,5],6,[7,8],9	nexthop6 20:20:20:20:20:20:20:20	nlri6 2000::/3        localpref 100"        coord peer1 send $PACKET    coord peer1 assert established}test24(){    echo "TEST24"    echo "	1) Establish an EBGP IPV6 peering"    echo "	2) Send an IPv6 only update packet"    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true    PACKET="packet update	origin 1	aspath $PEER4_AS	nexthop6 20:20:20:20:20:20:20:20	nlri6 2000::/3"        coord peer1 send $PACKET    coord peer1 assert established}test25(){    echo "TEST25"    echo "	1) Establish an EBGP IPV6 peering"    echo "	2) Send an IPv4 and IPv6 update packet"    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true    PACKET="packet update	origin 1	aspath $PEER4_AS	nexthop 20.20.20.20	nlri 10.10.10.0/24	nexthop6 20:20:20:20:20:20:20:20	nlri6 2000::/3"        coord peer1 send $PACKET    coord peer1 assert established}test26(){    echo "TEST26"    echo "	1) Establish an EBGP IPV6 peering"    echo "	2) Send an IPv4 and IPv6 update packet repeat both nexthops"    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    coord peer1 establish AS $PEER4_AS holdtime 0 id 192.150.187.100 ipv6 true    PACKET="packet update	origin 1	aspath $PEER4_AS	nexthop 20.20.20.20	nexthop 20.20.20.20	nlri 10.10.10.0/24	nexthop6 20:20:20:20:20:20:20:20	nexthop6 20:20:20:20:20:20:20:20	nlri6 2000::/3"        coord peer1 expect packet notify $UPDATEMSGERR $MALATTRLIST	    coord peer1 send $PACKET    sleep 2    coord peer1 assert queue 0    coord peer1 assert idle}test27(){    echo "TEST27 - Verify that routes originated by BGP reach an IBGP peer"    coord reset    coord target $HOST $PORT1    coord initialise attach peer1    # Introduce a route    originate_route4 10.10.10.0/24 20.20.20.20 true false    coord peer1 establish AS $PEER1_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 trie recv lookup 10.10.10.0/24 aspath empty    coord peer1 assert queue 0    coord peer1 assert established}test27_ipv6(){    echo "TEST27 (IPV6) - Verify that routes originated by BGP reach an IBGP peer"    coord reset    coord target $HOST $PORT3    coord initialise attach peer1    # Introduce a route    originate_route6 2000::/3 20:20:20:20:20:20:20:20 true false    coord peer1 establish AS $PEER1_AS holdtime 0 id 192.150.187.100 ipv6 true    sleep 2    coord peer1 trie recv lookup 2000::/3 aspath empty    coord peer1 assert queue 0    coord peer1 assert established}test28(){    echo "TEST28 - Verify that routes originated by BGP reach an EBGP peer"    echo "Also verify that the nexthop is rewritten and the provided nexthop"    echo "is ignored"    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 expect packet open asnum $AS bgpid $ID holdtime $HOLDTIME \	afi 1 safi 1    coord peer1 expect packet keepalive    coord peer1 expect packet update \	origin 0 \	nexthop 192.150.187.78 \	aspath 65008 \	med 1 \	nlri 10.10.10.0/24    # Introduce a route    originate_route4 10.10.10.0/24 20.20.20.20 true false    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 trie recv lookup 10.10.10.0/24 aspath 65008    coord peer1 assert queue 0    coord peer1 assert established}test28_ipv6(){    echo "TEST28 (IPV6) - Verify that routes originated by BGP reach an EBGP peer"    echo "Also verify that the nexthop is rewritten and the provided nexthop"    echo "is ignored"    coord reset    coord target $HOST $PORT4    coord initialise attach peer1    coord peer1 expect packet open asnum $AS bgpid $ID holdtime $HOLDTIME \	afi 2 safi 1    coord peer1 expect packet keepalive    coord peer1 expect packet update \	origin 0 \	aspath 65008 \	med 1 \	nlri6 2000::/3 \	nexthop6 ::    # Introduce a route    originate_route6 2000::/3 20:20:20:20:20:20:20:20 true false    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 ipv6 true    sleep 2    coord peer1 trie recv lookup 2000::/3 aspath 65008    coord peer1 assert queue 0    coord peer1 assert established}test29(){    echo "TEST29"    echo "	1) Make a connection"    echo "	2) Send a notify packet before establishing a session"    echo "	3) Verify that we do not get a notify packet in response"    echo "	4) Verify that the TCP session has been torn down"    reset    coord peer1 connect    # Verify that we have a connection    sleep 2    coord peer1 assert connected    sleep 2    # We have to add something to the queue in order to make the    # assertion later    coord peer1 expect packet notify $FSMERROR    coord peer1 send packet notify $UPDATEMSGERR $MALATTRLIST    sleep 2    coord peer1 assert queue 1    sleep 2    coord peer1 assert idle}test30(){    echo "TEST30 - Bugzilla BUG #32"    echo "	1) The test peer performs a bind but no listen"    echo "	2) A BGP connection attempt will leave it in connect state"    echo "	3) Toggle the peering to ensure BGP can get out of this state"    coord reset    BASE=peer1 bind $HOST $PEER1_PORT    # Toggle the BGP peering to force a connection attempt.    disable_peer $LOCALHOST $PORT1 $PEER1 $PEER1_PORT $PEER1_AS    enable_peer $LOCALHOST $PORT1 $PEER1 $PEER1_PORT $PEER1_AS    # The BGP should be in the CONNECT state now.    # Toggle the BGP peering again to verify that it can get out of the    # CONNECT state.    disable_peer $LOCALHOST $PORT1 $PEER1 $PEER1_PORT $PEER1_AS    enable_peer $LOCALHOST $PORT1 $PEER1 $PEER1_PORT $PEER1_AS    # Need to find out that the BGP process still exists so make a peering.    BASE=peer1 ${srcdir}/xrl_shell_funcs.sh reset    sleep 2    coord reset    coord target $HOST $PORT1    coord initialise attach peer1    coord peer1 establish \	active true \	AS $PEER1_AS \	holdtime $HOLDTIME \	id 192.150.187.100    sleep 2    coord peer1 assert established}test31(){    echo "TEST31 - On an I-BGP peering send an update with an empty aspath"    PACKET='packet update	origin 1	aspath empty	nexthop 20.20.20.20 	nlri 10.10.10.0/24'    reset    coord peer1 establish AS $AS holdtime 0 id 192.150.187.100    coord peer1 assert established    coord peer1 send $PACKET    sleep 2    coord peer1 assert established}test32(){    echo "TEST32 - Bugzilla BUG #139"    echo "	1) Originate a route on an I-BGP peering with an empty aspath."    echo "	2) Send the same route to the BGP process."    echo "	3) The comparison of two routes with empty aspath caused BGP"    echo "	   BGP to fail"    coord reset    coord target $HOST $PORT1    coord initialise attach peer1    # Introduce a route    originate_route4 10.10.10.0/24 20.20.20.20 true false    coord peer1 establish AS $PEER1_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 trie recv lookup 10.10.10.0/24 aspath empty    PACKET='packet update	origin 2	aspath empty	nexthop 20.20.20.20 	nlri 10.10.10.0/24'    coord peer1 send $PACKET    sleep 2    coord peer1 assert queue 0    coord peer1 assert established}test33(){    echo "TEST33 - DampPeerOscillations 10 sessions 11th should fail"    for i in 1 2 3 4 5 6 7 8 9 10    do	coord reset	coord target $HOST $PORT2	coord initialise attach peer1	coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100	sleep 2	coord peer1 assert established    done    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    sleep 2    coord peer1 assert idle}test34(){    echo "TEST34 - Illicit a Message Header Error Connection Not Synchronized."    echo "	1) Establish a connection"    echo "	2) Send a keepalive with a corrupted marker field"    echo "	3) Should return a notify Connection Not Synchronized."    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 expect packet notify $MSGHEADERERR $CONNNOTSYNC    coord peer1 send packet corrupt 0 0 keepalive    sleep 2    coord peer1 assert queue 0    sleep 2        coord peer1 assert idle}test35(){    echo "TEST35 - Illicit a Message Header Error Bad Message Length. 0"    echo "	1) Establish a connection"    echo "	2) Send a keepalive with a short message length"    echo "	3) Should return a notify Bad Message Length.."    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 expect packet notify $MSGHEADERERR $BADMESSLEN 0 0    coord peer1 send packet corrupt 17 0 keepalive    sleep 2    coord peer1 assert queue 0    sleep 2        coord peer1 assert idle}test36(){    echo "TEST36 - Illicit a Message Header Error Bad Message Length. 20"    echo "	1) Establish a connection"    echo "	2) Send a keepalive with a long message length"    echo "	3) Should return a notify Bad Message Length."    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 expect packet notify $MSGHEADERERR $BADMESSLEN 0 20    coord peer1 send packet corrupt 17 20 keepalive    # send a second message to force the previous one to be delivered.    coord peer1 send packet keepalive    sleep 2    coord peer1 assert queue 0    sleep 2        coord peer1 assert idle}test37(){    echo "TEST37 - Illicit a Message Header Error Bad Message Type."    echo "	1) Establish a connection"    echo "	2) Send a message with the type set to 10"    echo "	3) Should return a notify Bad Message Type with the 10"    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 expect packet notify $MSGHEADERERR $BADMESSTYPE 10    coord peer1 send packet corrupt 18 10 keepalive    sleep 2    coord peer1 assert queue 0    sleep 2        coord peer1 assert idle}test38(){    echo "TEST38 - Illicit a UPDATE Message Error Malformed AS_PATH."    echo "	1) Establish a connection"    echo "	2) Send a malformed aspath"    echo "	3) Should return a notify UPDATE Message Error."    coord reset    coord target $HOST $PORT2    coord initialise attach peer1    coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100    coord peer1 expect packet notify $UPDATEMSGERR $MALASPATH    #     # Hit the check in AsPath::decode()    #     coord peer1 send packet corrupt 38 0 \	update \	origin 2 \	aspath "[$PEER2_AS],[$PEER2_AS]" \	nlri 10.10.10.0/24 \	nexthop 20.20.20.20    sleep 2    coord peer1 assert queue 0    sleep 2        coord peer1 assert idle}test39(){    echo "TEST39 - Send a short open packet. 20"    echo "	1) Send an open packet with a length field of 20"    echo "	2) Should return a notify Bad Message Length."    reset    coord peer1 connect    sleep 2    coord peer1 expect packet notify $MSGHEADERERR $BADMESSLEN 0 20    coord peer1 send packet corrupt 17 20 \	open \	asnum $PEER1_AS \	bgpid 192.150.187.100 \	holdtime 0    sleep 2    coord peer1 assert queue 0}    test40(){    echo "TEST40 - Open message with illegal version number"    echo "	1) Send an open message with a version number of 6"    echo "	2) Should get a notify with unsupported version number 4"    reset    coord peer1 connect    sleep 2    coord peer1 expect packet notify $OPENMSGERROR $UNSUPVERNUM 0 4    coord peer1 send packet corrupt 19 6 \	open \	asnum $PEER1_AS \	bgpid 192.150.187.100 \	holdtime 0    sleep 2    coord peer1 assert queue 0}    test41(){    echo "TEST41 - Open message with an illegal BGP ID"    echo "	1) Send an open message with a BGP ID of 0.0.0.0"    echo "	2) Should get a notify with Bad BGP Identifier"    reset    coord peer1 connect    sleep 2    coord peer1 expect packet notify $OPENMSGERROR $BADBGPIDENT    coord peer1 send packet \	open \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -