Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: Allow aspath prepending for default-originate with route-maps #8860

Merged

Conversation

ton31337
Copy link
Member

Closes #8840

@polychaeta polychaeta added bgp tests Topotests, make check, etc labels Jun 15, 2021
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 15, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8860 1edaaf6
Date 06/15/2021
Start 08:55:46
Finish 09:21:13
Run-Time 25:27
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-06-15-08:55:46.txt
Log autoscript-2021-06-15-08:57:05.log.bz2
Memory 514 493 422

For details, please contact louberger

@qlyoung qlyoung requested a review from pushpasis June 15, 2021 15:39
@srimohans srimohans self-requested a review June 15, 2021 15:40
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jun 15, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-19621/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 amd64 part 1: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TP1U1804AMD64-19621/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 1:

2021-06-15 13:36:29,416 ERROR: 'router_json_cmp' failed after 135.58 seconds
2021-06-15 13:36:29,419 ERROR: assert failed at "bfd_topo2.test_bfd_topo2/test_protocols_convergence": "r2" JSON output mismatches
assert Generated JSON diff error report:
  
  > $: d2 has key '10.254.254.1/32' which is not present in d1
2021-06-15 13:37:59,322 ERROR: r1: bgpd left a dead pidfile (pid=19742)
2021-06-15 14:06:35,131 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/bgp.py", line 203, in create_router_bgp
    tgen, router, data_all_bgp, "bgp", build, load_config
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 6: % Unknown command[27]: neighbor 10.0.0.13 remote-as 0 
% Specify remote-as or peer-group commands first
line 7: Failure to communicate[13] to bgpd, line: neighbor 10.0.0.13 timers 3 10 

line 9: % Unknown command[30]: neighbor fd00:0:0:3::1 remote-as 0 
% Specify remote-as or peer-group commands first
line 11: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:3::1 activate 

% Specify remote-as or peer-group commands first
line 12: Failure to communicate[13] to bgpd, line: neighbor fd00:0:0:3::1 timers 3 10 

% Specify remote-as or peer-group commands first
line 14: Failure to communicate[13] to bgpd, line: no neighbor fd00:0:0:3::1 activate 



2021-06-15 14:06:35,684 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/bgp.py", line 203, in create_router_bgp
    tgen, router, data_all_bgp, "bgp", build, load_config
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TP1U1804AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: % No BGP process is configured
line 2: Failure to communicate[13] to bgpd, line: no router bgp  

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-19621/artifact/TP1U1804AMD64/ErrorLog/log_topotests.txt

Successful on other platforms/tests
  • Topotests Ubuntu 18.04 amd64 part 4
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 arm8 part 0
  • Addresssanitizer topotests part 0
  • IPv4 ldp protocol on Ubuntu 18.04
  • Topotests debian 10 amd64 part 4
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 5
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 amd64 part 0
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 i386 part 4
  • Addresssanitizer topotests part 8
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 arm8 part 6
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests debian 10 amd64 part 8
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 amd64 part 9
  • Topotests Ubuntu 18.04 amd64 part 5
  • Fedora 29 rpm pkg check
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • Ubuntu 18.04 deb pkg check
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests debian 10 amd64 part 1
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 2
  • Debian 10 deb pkg check
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 2
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 3
  • Addresssanitizer topotests part 9
  • Addresssanitizer topotests part 3
  • Topotests debian 10 amd64 part 3
  • Ubuntu 16.04 deb pkg check
  • Addresssanitizer topotests part 5
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 6

@ton31337 ton31337 force-pushed the fix/aspath_prepend_default-originate branch from 1edaaf6 to bc60e16 Compare June 17, 2021 07:14
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 17, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8860 bc60e16
Date 06/17/2021
Start 04:08:25
Finish 04:34:05
Run-Time 25:40
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-06-17-04:08:25.txt
Log autoscript-2021-06-17-04:09:42.log.bz2
Memory 511 512 429

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jun 17, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-19660/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 arm8 part 9: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 9: No useful log found
Successful on other platforms/tests
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests debian 10 amd64 part 2
  • IPv4 protocols on Ubuntu 18.04
  • Topotests debian 10 amd64 part 7
  • Addresssanitizer topotests part 8
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests debian 10 amd64 part 3
  • Topotests Ubuntu 18.04 amd64 part 6
  • Addresssanitizer topotests part 6
  • Ubuntu 16.04 deb pkg check
  • Ubuntu 20.04 deb pkg check
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 2
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 amd64 part 8
  • IPv4 ldp protocol on Ubuntu 18.04
  • Topotests debian 10 amd64 part 1
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 7
  • Addresssanitizer topotests part 9
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests Ubuntu 18.04 i386 part 3
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 amd64 part 9
  • Topotests debian 10 amd64 part 9
  • Static analyzer (clang)
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 arm8 part 5
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 amd64 part 5
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 amd64 part 1
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • CentOS 7 rpm pkg check
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 amd64 part 4
  • Addresssanitizer topotests part 1
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 amd64 part 0

ton31337 added 2 commits June 22, 2021 15:51
The initial idea was to deny prepending and just use _self_.

This patch at least allows prepending aspath with route-maps, but drops
all non-self ASNs in the path.

Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337 ton31337 force-pushed the fix/aspath_prepend_default-originate branch from bc60e16 to cc54c07 Compare June 22, 2021 12:51
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jun 22, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/8860 cc54c07
Date 06/22/2021
Start 08:55:44
Finish 09:21:13
Run-Time 25:29
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-06-22-08:55:44.txt
Log autoscript-2021-06-22-08:56:55.log.bz2
Memory 516 506 425

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-19757/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp
Copy link
Member

This is not a bug fix. it looks like a feature. Why the backport label?

@ton31337
Copy link
Member Author

Wasn't really sure about this, removing.

@ton31337 ton31337 removed the backport label Jun 23, 2021
@donaldsharp donaldsharp merged commit 43d985e into FRRouting:master Jun 23, 2021
@idryzhov
Copy link
Contributor

@donaldsharp why isn't it a bugfix?

Looking at the config posted in the linked issue – we allow creating a route-map with as-path prepend clause and applying it to the "default-originate" statement:

router bgp 64549

  neighbor 100.64.4.110 activate
  neighbor 100.64.4.110 next-hop-self
  neighbor 100.64.4.110 default-originate route-map PREPEND
  neighbor 100.64.4.110 soft-reconfiguration inbound
  neighbor 100.64.4.110 prefix-list UE in
  neighbor 100.64.4.110 prefix-list ISP_outbound out
  neighbor 100.64.4.110 route-map PREPEND  in
  neighbor 100.64.4.110 route-map PREPEND out

route-map PREPEND permit 10
 set as-path prepend 64549 64549 64549 64549

And this config doesn't work without this fix.

@ton31337 ton31337 deleted the fix/aspath_prepend_default-originate branch June 23, 2021 14:59
@donaldsharp
Copy link
Member

one can argue either way. But effectively we are adding new functionality. This is not fixing existing behavior as that we never said that this would work.

@idryzhov
Copy link
Contributor

For me, if we allow something to be configured then we say that it should work. Otherwise, why we allow this to be configured? :)
Anyway, if you're against the backport, I won't insist.

@triple-it
Copy link

Shouldn't this also be reflected on the 'show ip bgp neighbor ... advertised-routes' ?
As in..

  neighbor 10.64.14.2 default-originate route-map PREPEND-DEFAULT
  neighbor 10.64.14.2 soft-reconfiguration inbound
  neighbor 10.64.14.2 prefix-list UE in
  neighbor 10.64.14.2 prefix-list ISP_outbound out
  neighbor 10.64.14.2 route-map PREPEND in
  neighbor 10.64.14.2 route-map PREPEND out


route-map PREPEND-DEFAULT permit 10
 set as-path prepend 65000 65000 65000 
 set metric 123
exit

Would currently result in...

changeme# show ip bgp neighbor 10.64.14.2 advertised-routes    {json}
BGP table version is 17, local router ID is 1.2.3.4, vrf id 0
Default local pref 100, local AS 65000
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Originating default network 0.0.0.0/0


Total number of prefixes 1
changeme# 

While debug hints it is probably working..

2024/10/10 14:37:03 BGP: [T5SJP-4SNA8] u4:s4 send UPDATE 0.0.0.0/0 nexthop 0.0.0.0, origin i, mp_nexthop ::, metric 123, path 65000 65000 65000

I see only 'show ip bgp' commands are tested?
Is there also a 'show ip bgp neighbor .. advertised-routes' test I am missing?

~~
def _bgp_default_route_has_metric(router):
output = json.loads(router.vtysh_cmd("show ip bgp 0.0.0.0/0 json"))
expected = {"paths": [{"metric": 123}]}
expected = {
"paths": [{"aspath": {"string": "65000 65000 65000 65000"}, "metric": 123}]
}
return topotest.json_cmp(output, expected)
~~

@ton31337
Copy link
Member Author

You can check using:

"bgpOriginatingDefaultNetwork": True,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BGP default-originate route-map as-path prepending issue?
7 participants