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.

Home Page:http://www.batfish.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

match command not recognized under ip policy list IOS

jaswant6068 opened this issue · comments

Describe the bug and expected behavior
command "match ip address prefix-list ONE" being configured under ip policy-list is not being recognized which cause batfish to declare prefix list named "ONE" as unused incorrectly while questioning for unusedStructures.

Runnable example

from pybatfish.client.session import Session
TXT = """
hostname device03

boot-start-marker
boot system flash bootflash:asr1002x-universealk9.17.06.04.SPA.bin
boot-end-marker

int loopback0
 ip address 1.1.1.1 255.255.255.255

ip prefix-list ONE permit 2.2.2.0/24

ip policy-list ONE permit
 match ip address prefix-list ONE

route-map TEST permit 10
 match policy-list ONE

router bgp 11111
neighbor TEST2 peer-group
neighbor TEST2 remote-as 22222
neighbor TEST2 route-map TEST in
neighbor TEST2 route-map TEST out
neighbor 3.3.3.3 peer-group TEST2

"""
bf = Session()
bf.set_network("github-bug-report")
bf.init_snapshot_from_text(TXT)

print(bf.q.fileParseStatus().answer())
        File_Name                  Status File_Format         Nodes

0  configs/config  PARTIALLY_UNRECOGNIZED   CISCO_IOS  ['device03']
print(bf.q.initIssues().answer())
  Nodes           Source_Lines           Type                      Details  \

0  None  [configs/config:[14]]  Parse warning  This syntax is unrecognized  

 

                          Line_Text  \

0  match ip address prefix-list ONE  

 

                                   Parser_Context 

0  [null_block s_null stanza cisco_configuration]

print(bf.q.unusedStructures().answer())

 Structure_Type Structure_Name         Source_Lines

0 ipv4 prefix-list ONE configs/config:[11]

ip policy-list is not supported in the Cisco IOS model right now. We would welcome a contribution for this support!