bgpd,tests: Modify import-check to require underlying prefixes to exist

Modify the import-check command to require the underlying prefix
to exist in the rib.  General consensus is that this is the correct
behavior.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-04-15 08:21:11 -04:00
parent 425c241a49
commit 62282e8379
20 changed files with 26 additions and 3 deletions

View File

@ -73,8 +73,12 @@
#endif #endif
FRR_CFG_DEFAULT_BOOL(BGP_IMPORT_CHECK, FRR_CFG_DEFAULT_BOOL(BGP_IMPORT_CHECK,
{ .val_bool = true, .match_profile = "datacenter", }, {
{ .val_bool = false }, .val_bool = false,
.match_profile = "traditional",
.match_version = "< 7.4",
},
{ .val_bool = true },
) )
FRR_CFG_DEFAULT_BOOL(BGP_SHOW_HOSTNAME, FRR_CFG_DEFAULT_BOOL(BGP_SHOW_HOSTNAME,
{ .val_bool = true, .match_profile = "datacenter", }, { .val_bool = true, .match_profile = "datacenter", },

View File

@ -5,6 +5,7 @@ router bgp 100
bgp router-id 192.168.0.1 bgp router-id 192.168.0.1
bgp log-neighbor-changes bgp log-neighbor-changes
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.7.10 remote-as 100 neighbor 192.168.7.10 remote-as 100
neighbor 192.168.7.20 remote-as 200 neighbor 192.168.7.20 remote-as 200
neighbor fc00:0:0:8::1000 remote-as 100 neighbor fc00:0:0:8::1000 remote-as 100
@ -48,4 +49,4 @@ line vty
route-map LIES deny 10 route-map LIES deny 10
match interface notpresent match interface notpresent
! !

View File

@ -2,6 +2,7 @@ debug bgp neighbor-events
router bgp 101 router bgp 101
bgp router-id 10.254.254.1 bgp router-id 10.254.254.1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
timers bgp 8 24 timers bgp 8 24
bgp graceful-restart bgp graceful-restart
neighbor 2001:db8:4::1 remote-as 102 neighbor 2001:db8:4::1 remote-as 102

View File

@ -2,6 +2,7 @@ debug bgp neighbor-events
router bgp 102 router bgp 102
bgp router-id 10.254.254.3 bgp router-id 10.254.254.3
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
timers bgp 20 60 timers bgp 20 60
bgp graceful-restart bgp graceful-restart
! simulate NSF machine ! simulate NSF machine

View File

@ -1,5 +1,6 @@
router bgp 101 router bgp 101
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.2 remote-as 102 neighbor 192.168.0.2 remote-as 102
neighbor 192.168.0.2 bfd neighbor 192.168.0.2 bfd
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -1,5 +1,6 @@
router bgp 102 router bgp 102
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.1 remote-as 101 neighbor 192.168.0.1 remote-as 101
neighbor 192.168.0.1 bfd neighbor 192.168.0.1 bfd
neighbor 192.168.1.1 remote-as 103 neighbor 192.168.1.1 remote-as 103

View File

@ -1,5 +1,6 @@
router bgp 103 router bgp 103
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.1.2 remote-as 102 neighbor 192.168.1.2 remote-as 102
neighbor 192.168.1.2 bfd neighbor 192.168.1.2 bfd
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -1,5 +1,6 @@
router bgp 104 router bgp 104
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.2.2 remote-as 102 neighbor 192.168.2.2 remote-as 102
neighbor 192.168.2.2 bfd neighbor 192.168.2.2 bfd
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -1,5 +1,6 @@
router bgp 101 vrf r1-cust1 router bgp 101 vrf r1-cust1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.2 remote-as 102 neighbor 192.168.0.2 remote-as 102
! neighbor 192.168.0.2 ebgp-multihop 10 ! neighbor 192.168.0.2 ebgp-multihop 10
neighbor 192.168.0.2 bfd neighbor 192.168.0.2 bfd

View File

@ -1,5 +1,6 @@
router bgp 102 vrf r2-cust1 router bgp 102 vrf r2-cust1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.1 remote-as 101 neighbor 192.168.0.1 remote-as 101
neighbor 192.168.0.1 bfd neighbor 192.168.0.1 bfd
neighbor 192.168.1.1 remote-as 103 neighbor 192.168.1.1 remote-as 103

View File

@ -1,5 +1,6 @@
router bgp 103 vrf r3-cust1 router bgp 103 vrf r3-cust1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.1.2 remote-as 102 neighbor 192.168.1.2 remote-as 102
neighbor 192.168.1.2 bfd neighbor 192.168.1.2 bfd
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -1,5 +1,6 @@
router bgp 104 vrf r4-cust1 router bgp 104 vrf r4-cust1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.2.2 remote-as 102 neighbor 192.168.2.2 remote-as 102
neighbor 192.168.2.2 bfd neighbor 192.168.2.2 bfd
address-family ipv4 unicast address-family ipv4 unicast

View File

@ -6,6 +6,7 @@ log stdout notifications
log monitor notifications log monitor notifications
log commands log commands
router bgp 5226 router bgp 5226
no bgp network import-check
bgp router-id 99.0.0.1 bgp router-id 99.0.0.1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5226 neighbor 192.168.1.1 remote-as 5226

View File

@ -6,6 +6,7 @@ log stdout notifications
log monitor notifications log monitor notifications
log commands log commands
router bgp 5226 router bgp 5226
no bgp network import-check
bgp router-id 99.0.0.2 bgp router-id 99.0.0.2
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5226 neighbor 192.168.1.1 remote-as 5226

View File

@ -6,6 +6,7 @@ log stdout notifications
log monitor notifications log monitor notifications
log commands log commands
router bgp 5226 router bgp 5226
no bgp network import-check
bgp router-id 99.0.0.3 bgp router-id 99.0.0.3
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5226 neighbor 192.168.1.1 remote-as 5226

View File

@ -8,6 +8,7 @@ log commands
log file bgpd.log log file bgpd.log
router bgp 5227 router bgp 5227
no bgp network import-check
bgp router-id 99.0.0.1 bgp router-id 99.0.0.1
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5227 neighbor 192.168.1.1 remote-as 5227

View File

@ -8,6 +8,7 @@ log commands
log file bgpd.log log file bgpd.log
router bgp 5227 router bgp 5227
no bgp network import-check
bgp router-id 99.0.0.2 bgp router-id 99.0.0.2
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5227 neighbor 192.168.1.1 remote-as 5227

View File

@ -8,6 +8,7 @@ log commands
log file bgpd.log log file bgpd.log
router bgp 5227 router bgp 5227
no bgp network import-check
bgp router-id 99.0.0.3 bgp router-id 99.0.0.3
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.1.1 remote-as 5227 neighbor 192.168.1.1 remote-as 5227

View File

@ -8,6 +8,7 @@ log commands
log file bgpd.log log file bgpd.log
router bgp 5228 vrf ce4-cust2 router bgp 5228 vrf ce4-cust2
no bgp network import-check
bgp router-id 99.0.0.4 bgp router-id 99.0.0.4
no bgp ebgp-requires-policy no bgp ebgp-requires-policy
neighbor 192.168.2.1 remote-as 5228 neighbor 192.168.2.1 remote-as 5228

View File

@ -219,6 +219,7 @@ def __create_bgp_global(tgen, input_dict, router, build=False):
if router_id: if router_id:
config_data.append("bgp router-id {}".format(router_id)) config_data.append("bgp router-id {}".format(router_id))
config_data.append("no bgp network import-check")
return config_data return config_data