batfish / batfish

Batfish is a network configuration analysis tool that can find bugs and guarantee the correctness of (planned or current) network configurations. It enables network engineers to rapidly and safely evolve their network, without fear of outages or security breaches.
http://www.batfish.org
Apache License 2.0
1.17k stars 233 forks source link

Feature request: Cisco IOS BGP as-path replace command support #8059

Closed kefins closed 2 years ago

kefins commented 2 years ago

Hi, I got some warning while parsing Cisco IOS snapshot, here is the detail warning.

>>> bfq.initIssues().answer().frame()
status: TRYINGTOASSIGN
.... no task information
status: TERMINATEDNORMALLY
.... 2022-02-16 16:04:29.108000+08:00 Begin job.
  Nodes                                                                                         Source_Lines           Type                                  Details                           Line_Text                                                                                       Parser_Context
0  None                                                                   [configs/100.127.131.94.cfg:[550]]  Parse warning              This syntax is unrecognized           set as-path replace 65031                                [set_rm_stanza rm_stanza route_map_stanza stanza cisco_configuration]
1  None                                                                   [configs/100.127.131.95.cfg:[556]]  Parse warning              This syntax is unrecognized           set as-path replace 65032                                [set_rm_stanza rm_stanza route_map_stanza stanza cisco_configuration]
2  None  [configs/11.240.108.181.cfg:[1020, 1025, 1030, 1035, 1042, 1047], configs/11.240.107.51.cfg:[102...  Parse warning              This syntax is unrecognized           set as-path replace 65010                                [set_rm_stanza rm_stanza route_map_stanza stanza cisco_configuration]
3  None                                [configs/11.240.108.181.cfg:[1147], configs/11.240.107.51.cfg:[1147]]  Parse warning              This syntax is unrecognized   maximum-paths eibgp as-path-relax  [dec maximum_paths_bgp_tail bgp_tail address_family_inner address_family_rb_stanza router_bgp_st...
4  None  [configs/11.240.108.181.cfg:[1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1...  Parse warning  This feature is not currently supported  advertise-map RP_DENY_IBGP_PEER_IP  [agg_advertise_map aggregate_address_rb_stanza address_family_inner address_family_rb_stanza rou...
5  None              [configs/11.240.108.181.cfg:[954, 959, 964], configs/11.240.107.51.cfg:[954, 959, 964]]  Parse warning              This syntax is unrecognized           set as-path replace 65313                                [set_rm_stanza rm_stanza route_map_stanza stanza cisco_configuration]

And the unrecognized commands are set as-path replace 65031 and maximum-paths eibgp as-path-relax, the feature is not currently supported command is aggregate-address 11.20.144.0 255.255.240.0 summary-only advertise-map RP_DENY_IBGP_PEER_IP attribute-map RP_DR_OPEN_SET_COMM.

After talking about these commands with @arifogel , who said some of them had been support on FRR. I wonder if they can be migrated to Cisco IOS.

image

arifogel commented 2 years ago

@kefins Thanks for this.

kefins commented 2 years ago

@arifogel Thank you for your replying. It's really a good news, set as-path replace is necessary for my snapshot, from which should verify a network loop. But now batfish gives no loop. So if there is a patch, please let me know as soon as possible. Thank you again.

kefins commented 2 years ago

Hi, @arifogel May I ask when will this patch be released? I need to verify a loop which was produced by bgp as-path replace.

arifogel commented 2 years ago

Turns out it was nothing like the FRR construct, but I was able to churn out support anyhow. May take some time for review, but should be in soon.

kefins commented 2 years ago

OK, thank you so much.