check_router_status(tgen)
for addr_type in ADDR_TYPES:
-
step(
"Redistribute configured static routes into BGP process" " on R1/R2 and R3"
)
)
for addr_type in ADDR_TYPES:
-
step("Import from default vrf into vrf ISR on R1 and R2 as below")
input_dict_vrf = {}
)
for addr_type in ADDR_TYPES:
-
step("Verify Pre-emption")
input_routes_r3 = {
shutdown_bringup_interface(tgen, "r4", intf_r4_r1, False)
for addr_type in ADDR_TYPES:
-
input_routes_r3 = {
"r3": {"static_routes": [{"network": [NETWORK3_3[addr_type]]}]}
}
shutdown_bringup_interface(tgen, "r4", intf_r4_r1, True)
for addr_type in ADDR_TYPES:
-
input_routes_r3 = {
"r3": {"static_routes": [{"network": [NETWORK3_3[addr_type]]}]}
}
step("Active-Standby scenario(as-path prepend and Local pref)")
for addr_type in ADDR_TYPES:
-
step("Create prefix-list")
input_dict_pf = {
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set localpref 500")
input_dict_rm = {
attribute = "locPrf"
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is installed as per highest localpref")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set localpref 700")
input_dict_rm = {
)
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is changed as per highest localpref")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set as-path prepend")
input_dict_rm = {
attribute = "path"
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is changed as per shortest as-path")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(
check_router_status(tgen)
for addr_type in ADDR_TYPES:
-
step(
"Configure route-map to set community attribute for a specific"
"prefix on R1 in vrf ISR"
)
for addr_type in ADDR_TYPES:
-
step(
"Apply this route-map on R1 to vrf ISR while redistributing the"
" prefixes into BGP"
)
for addr_type in ADDR_TYPES:
-
step(
"Configure another route-map for filtering the prefixes based on"
" community attribute while importing into default vrf"
)
for addr_type in ADDR_TYPES:
-
step(
"Apply the route-map while Importing vrf ISR's prefixes into "
"default vrf on router R1:"
)
for addr_type in ADDR_TYPES:
-
step(
"Verify on R1 that only prefixes with community value 100:100"
"in vrf ISR are imported to vrf default. While importing, the"
)
for addr_type in ADDR_TYPES:
-
step("Add set clause in route-map IMP:")
input_dict_rm = {
)
for addr_type in ADDR_TYPES:
-
step(
"Verify that as we continue adding different attributes "
"step-by-step in route-map IMP those attributes gets "
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
for addr_type in ADDR_TYPES:
-
input_routes_r1 = {
"r1": {
"static_routes": [
verify_bgp_community,
verify_bgp_rib,
clear_bgp,
- verify_best_path_as_per_bgp_attribute
+ verify_best_path_as_per_bgp_attribute,
)
from lib.topojson import build_config_from_json
check_router_status(tgen)
for addr_type in ADDR_TYPES:
-
step(
"Redistribute configured static routes into BGP process" " on R1/R2 and R3"
)
)
for addr_type in ADDR_TYPES:
-
step("Import from default vrf into vrf ISR on R1 and R2 as below")
input_dict_vrf = {}
)
for addr_type in ADDR_TYPES:
-
step("Verify Pre-emption")
input_routes_r3 = {
shutdown_bringup_interface(tgen, "r4", intf_r4_r1, False)
for addr_type in ADDR_TYPES:
-
input_routes_r3 = {
"r3": {"static_routes": [{"network": [NETWORK3_3[addr_type]]}]}
}
shutdown_bringup_interface(tgen, "r4", intf_r4_r1, True)
for addr_type in ADDR_TYPES:
-
input_routes_r3 = {
"r3": {"static_routes": [{"network": [NETWORK3_3[addr_type]]}]}
}
step("Active-Standby scenario(as-path prepend and Local pref)")
for addr_type in ADDR_TYPES:
-
step("Create prefix-list")
input_dict_pf = {
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set localpref 500")
input_dict_rm = {
attribute = "locPrf"
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is installed as per highest localpref")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set localpref 700")
input_dict_rm = {
)
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is changed as per highest localpref")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(
)
for addr_type in ADDR_TYPES:
-
step("Create route-map to match prefix-list and set as-path prepend")
input_dict_rm = {
attribute = "path"
for addr_type in ADDR_TYPES:
-
step("Verify bestpath is changed as per shortest as-path")
input_routes_r3 = {
- "r3": {
- "static_routes": [
- {"network": [NETWORK3_3[addr_type], NETWORK3_4[addr_type]]}
- ]
- }
+ "r3": {"static_routes": [{"network": [NETWORK3_4[addr_type]]}]}
}
result = verify_best_path_as_per_bgp_attribute(