|
|
|
@ -14,6 +14,8 @@ from bgprib import bgpribRequireVpnRoutes, bgpribRequireUnicastRoutes
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "0.0.0.0"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes in ce1", want)
|
|
|
|
@ -21,6 +23,8 @@ bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes in ce1", want)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "0.0.0.0"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 2 routes in ce1", want)
|
|
|
|
@ -28,6 +32,8 @@ bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 2 routes in ce1", want)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "0.0.0.0"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 3 routes in ce1", want)
|
|
|
|
@ -35,6 +41,8 @@ bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 3 routes in ce1", want)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "0.0.0.0"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce4", "ipv4", "ce4-cust2", "Cust 4 routes in ce1", want)
|
|
|
|
@ -49,6 +57,8 @@ bgpribRequireUnicastRoutes("ce4", "ipv4", "ce4-cust2", "Cust 4 routes in ce1", w
|
|
|
|
|
want_r1_cust1_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.1"},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "192.168.1.2"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
@ -58,6 +68,8 @@ bgpribRequireUnicastRoutes(
|
|
|
|
|
want_r3_cust1_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.2"},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "192.168.1.2"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
@ -67,6 +79,8 @@ bgpribRequireUnicastRoutes(
|
|
|
|
|
want_r4_cust1_routes = [
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "192.168.1.2"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
@ -76,6 +90,8 @@ bgpribRequireUnicastRoutes(
|
|
|
|
|
want_r4_cust2_routes = [
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "192.168.2.2"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
@ -152,23 +168,27 @@ else:
|
|
|
|
|
luCommand(
|
|
|
|
|
"r1",
|
|
|
|
|
'vtysh -c "show bgp ipv4 vpn"',
|
|
|
|
|
r"Distinguisher: *10:1.*5.1.0.0/24 *99.0.0.1\b.*5.1.1.0/24 *99.0.0.1\b.*99.0.0.1/32 *192.168.1.2\b",
|
|
|
|
|
r"Distinguisher: *10:1.*5.1.0.0/24 *99.0.0.1\b.*5.1.1.0/24 *99.0.0.1\b.*6.0.1.0/24 *99.0.0.1\b.*6.0.2.0/24 *99.0.0.1\b.*99.0.0.1/32 *192.168.1.2\b",
|
|
|
|
|
"pass",
|
|
|
|
|
"vrf->vpn routes",
|
|
|
|
|
)
|
|
|
|
|
luCommand(
|
|
|
|
|
"r3",
|
|
|
|
|
'vtysh -c "show bgp ipv4 vpn"',
|
|
|
|
|
r"Distinguisher: *10:3.*5.1.0.0/24 *99.0.0.2\b.*5.1.1.0/24 *99.0.0.2\b.*99.0.0.2/32 *192.168.1.2\b",
|
|
|
|
|
r"Distinguisher: *10:3.*5.1.0.0/24 *99.0.0.2\b.*5.1.1.0/24 *99.0.0.2\b.*6.0.1.0/24 *99.0.0.2\b.*6.0.2.0/24 *99.0.0.2\b.*99.0.0.2/32 *192.168.1.2\b",
|
|
|
|
|
"pass",
|
|
|
|
|
"vrf->vpn routes",
|
|
|
|
|
)
|
|
|
|
|
want = [
|
|
|
|
|
{"rd": "10:41", "p": "5.1.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"rd": "10:41", "p": "5.1.3.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"rd": "10:41", "p": "6.0.1.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"rd": "10:41", "p": "6.0.2.0/24", "n": "99.0.0.3"},
|
|
|
|
|
{"rd": "10:41", "p": "99.0.0.3/32", "n": "192.168.1.2"},
|
|
|
|
|
{"rd": "10:42", "p": "5.4.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"rd": "10:42", "p": "5.4.3.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"rd": "10:42", "p": "6.0.1.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"rd": "10:42", "p": "6.0.2.0/24", "n": "99.0.0.4"},
|
|
|
|
|
{"rd": "10:42", "p": "99.0.0.4/32", "n": "192.168.2.2"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireVpnRoutes("r4", "vrf->vpn routes", want)
|
|
|
|
@ -266,58 +286,95 @@ bgpribRequireVpnRoutes(
|
|
|
|
|
# PE routers: VRFs contain routes from remote customer nets
|
|
|
|
|
########################################################################
|
|
|
|
|
want_r1_remote_cust1_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "4.4.4.4", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "4.4.4.4", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "192.168.1.2", "bp": True},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "4.4.4.4"},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
|
"r1", "ipv4", "r1-cust1", "Customer 1 routes in r1 vrf", want_r1_remote_cust1_routes
|
|
|
|
|
)
|
|
|
|
|
"r1", "ipv4", "r1-cust1", "Customer 1 routes in r1 vrf (2)", want_r1_remote_cust1_routes
|
|
|
|
|
, debug=False)
|
|
|
|
|
|
|
|
|
|
want_r3_remote_cust1_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "4.4.4.4"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.2", "bp": False},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.2", "bp": False},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "4.4.4.4", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.2", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "4.4.4.4", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.2", "bp": True},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "4.4.4.4", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
|
"r3", "ipv4", "r3-cust1", "Customer 1 routes in r3 vrf", want_r3_remote_cust1_routes
|
|
|
|
|
)
|
|
|
|
|
"r3", "ipv4", "r3-cust1", "Customer 1 routes in r3 vrf (2)", want_r3_remote_cust1_routes
|
|
|
|
|
, debug=False)
|
|
|
|
|
|
|
|
|
|
want_r4_remote_cust1_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": True},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "192.168.1.2", "bp": True},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "192.168.2.2", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
|
"r4", "ipv4", "r4-cust1", "Customer 1 routes in r4 vrf", want_r4_remote_cust1_routes
|
|
|
|
|
)
|
|
|
|
|
"r4", "ipv4", "r4-cust1", "Customer 1 routes in r4 vrf (2)", want_r4_remote_cust1_routes
|
|
|
|
|
, debug=False)
|
|
|
|
|
|
|
|
|
|
want_r4_remote_cust2_routes = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1"},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "1.1.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "3.3.3.3", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": False},
|
|
|
|
|
{"p": "99.0.0.1/32", "n": "1.1.1.1", "bp": True},
|
|
|
|
|
{"p": "99.0.0.2/32", "n": "3.3.3.3", "bp": True},
|
|
|
|
|
{"p": "99.0.0.3/32", "n": "192.168.1.2", "bp": True},
|
|
|
|
|
{"p": "99.0.0.4/32", "n": "192.168.2.2", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
|
"r4", "ipv4", "r4-cust2", "Customer 2 routes in r4 vrf", want_r4_remote_cust2_routes
|
|
|
|
|
)
|
|
|
|
|
"r4", "ipv4", "r4-cust2", "Customer 2 routes in r4 vrf (2)", want_r4_remote_cust2_routes
|
|
|
|
|
, debug=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
@ -330,36 +387,45 @@ bgpribRequireUnicastRoutes(
|
|
|
|
|
luCommand(
|
|
|
|
|
"ce1",
|
|
|
|
|
'vtysh -c "show bgp ipv4 uni"',
|
|
|
|
|
"10 routes and 10",
|
|
|
|
|
"12 routes and 12",
|
|
|
|
|
"wait",
|
|
|
|
|
"Local and remote routes",
|
|
|
|
|
10,
|
|
|
|
|
)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.1", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes from remote", want)
|
|
|
|
|
bgpribRequireUnicastRoutes("ce1", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
|
|
|
|
|
|
|
|
|
|
luCommand(
|
|
|
|
|
"ce2",
|
|
|
|
|
'vtysh -c "show bgp ipv4 uni"',
|
|
|
|
|
"10 routes and 12",
|
|
|
|
|
"12 routes and 15",
|
|
|
|
|
"wait",
|
|
|
|
|
"Local and remote routes",
|
|
|
|
|
10,
|
|
|
|
|
)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.1.1", "bp": False},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "99.0.0.2", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.1.1", "bp": False},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "99.0.0.2", "bp": True},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "192.168.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.2", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.2", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 1 routes from remote", want)
|
|
|
|
|
bgpribRequireUnicastRoutes("ce2", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
|
|
|
|
|
|
|
|
|
|
# human readable output for debugging
|
|
|
|
|
luCommand("r4", 'vtysh -c "show bgp vrf r4-cust1 ipv4 uni"')
|
|
|
|
@ -371,34 +437,98 @@ luCommand("r4", 'vtysh -c "show ip route vrf r4-cust2"')
|
|
|
|
|
luCommand(
|
|
|
|
|
"ce3",
|
|
|
|
|
'vtysh -c "show bgp ipv4 uni"',
|
|
|
|
|
"10 routes and 10",
|
|
|
|
|
"12 routes and 14",
|
|
|
|
|
"wait",
|
|
|
|
|
"Local and remote routes",
|
|
|
|
|
10,
|
|
|
|
|
)
|
|
|
|
|
# Requires bvl-bug-degenerate-no-label fix (FRR PR #2053)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.2.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "5.4.3.0/24", "n": "192.168.1.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "192.168.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "192.168.1.1", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.3", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.3", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 1 routes from remote", want)
|
|
|
|
|
bgpribRequireUnicastRoutes("ce3", "ipv4", "", "Cust 1 routes from remote", want, debug=False)
|
|
|
|
|
|
|
|
|
|
luCommand(
|
|
|
|
|
"ce4",
|
|
|
|
|
'vtysh -c "show bgp vrf ce4-cust2 ipv4 uni"',
|
|
|
|
|
"10 routes and 10",
|
|
|
|
|
"12 routes and 14",
|
|
|
|
|
"wait",
|
|
|
|
|
"Local and remote routes",
|
|
|
|
|
10,
|
|
|
|
|
)
|
|
|
|
|
want = [
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.2.1"},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.2.1"},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.2.1"},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.2.1"},
|
|
|
|
|
{"p": "5.1.0.0/24", "n": "192.168.2.1", "bp": True},
|
|
|
|
|
{"p": "5.1.1.0/24", "n": "192.168.2.1", "bp": True},
|
|
|
|
|
{"p": "5.1.2.0/24", "n": "192.168.2.1", "bp": True},
|
|
|
|
|
{"p": "5.1.3.0/24", "n": "192.168.2.1", "bp": True},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "192.168.2.1", "bp": False},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "192.168.2.1", "bp": False},
|
|
|
|
|
{"p": "6.0.1.0/24", "n": "99.0.0.4", "bp": True},
|
|
|
|
|
{"p": "6.0.2.0/24", "n": "99.0.0.4", "bp": True},
|
|
|
|
|
]
|
|
|
|
|
bgpribRequireUnicastRoutes(
|
|
|
|
|
"ce4", "ipv4", "ce4-cust2", "Cust 2 routes from remote", want
|
|
|
|
|
"ce4", "ipv4", "ce4-cust2", "Cust 2 routes from remote", want, debug=False
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
#verify details of exported/imported routes
|
|
|
|
|
luCommand("ce1",'vtysh -c "show bgp ipv4 uni 6.0.1.0"',
|
|
|
|
|
"1 available.*192.168.1.1.*99.0.0.1.*Community: 0:67.*Extended Community: RT:89:123.*Large Community: 12:34:56",
|
|
|
|
|
"pass", "Redundant route 1 details")
|
|
|
|
|
luCommand("ce2",'vtysh -c "show bgp ipv4 uni 6.0.1.0"',
|
|
|
|
|
"2 available, best .*192.168.1.1.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1" +
|
|
|
|
|
".* Origin IGP, metric 98, localpref 123, valid, internal" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56",
|
|
|
|
|
".* Local.* 99.0.0.2 from 0.0.0.0 .99.0.0.2" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56",
|
|
|
|
|
"pass", "Redundant route 1 details")
|
|
|
|
|
luCommand("ce3",'vtysh -c "show bgp ipv4 uni 6.0.1.0"',
|
|
|
|
|
"2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3" +
|
|
|
|
|
".* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56" +
|
|
|
|
|
".* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1" +
|
|
|
|
|
".* Origin IGP, metric 98, localpref 123, valid, internal" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56",
|
|
|
|
|
"pass", "Redundant route 1 details")
|
|
|
|
|
luCommand("ce4",'vtysh -c "show bgp vrf ce4-cust2 ipv4 6.0.1.0"',
|
|
|
|
|
"2 available, best .*192.168.2.1.* Local.* 192.168.2.1 from 192.168.2.1 .192.168.2.1" +
|
|
|
|
|
".* Origin IGP, metric 98, localpref 123, valid, internal" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56" +
|
|
|
|
|
".* Local.* 99.0.0.4 from 0.0.0.0 .99.0.0.4" +
|
|
|
|
|
".* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56",
|
|
|
|
|
"pass", "Redundant route 1 details")
|
|
|
|
|
|
|
|
|
|
luCommand("ce1",'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
|
|
|
|
|
"1 available, best .*192.168.1.1.* Local.* 99.0.0.1 from 0.0.0.0 .99.0.0.1" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .First path received" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:11",
|
|
|
|
|
"pass", "Redundant route 2 details")
|
|
|
|
|
luCommand("ce2",'vtysh -c "show bgp ipv4 uni 6.0.2.0"', "1 available, best .*192.168.1.1.* Local.* 99.0.0.2 from 0.0.0.0 .99.0.0.2" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .First path received" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:12",
|
|
|
|
|
"pass", "Redundant route 2 details")
|
|
|
|
|
luCommand("ce3",'vtysh -c "show bgp ipv4 uni 6.0.2.0"',
|
|
|
|
|
"2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:13" +
|
|
|
|
|
".* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, valid, internal" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:14",
|
|
|
|
|
"pass", "Redundant route 2 details")
|
|
|
|
|
luCommand("ce4",'vtysh -c "show bgp vrf ce4-cust2 ipv4 6.0.2.0"',
|
|
|
|
|
"2 available, best .*192.168.2.1.* Local.* 192.168.2.1 from 192.168.2.1 .192.168.2.1" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, valid, internal" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:13" +
|
|
|
|
|
".* Local.* 99.0.0.4 from 0.0.0.0 .99.0.0.4" +
|
|
|
|
|
".* Origin IGP, metric 100, localpref 100, weight 32768, valid, sourced, local, best .Weight" +
|
|
|
|
|
".* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:14",
|
|
|
|
|
"pass", "Redundant route 2 details")
|
|
|
|
|
#done
|
|
|
|
|