Skip to main content
Anand_Narayana
Explorer
February 15, 2017
Question

How to view Firewall policies in CLI

  • February 15, 2017
  • 2 replies
  • 111574 views

Hi,

 I am aware that to view a specific policy ID from the command line, I will need to type in "show firewall policy <polic ID>, but how to view all the policies specific to an Interface? e.g. source port - port1 and destination port10, I need to view all the policies under this from the CLI

    2 replies

    ede_pfau
    SuperUser
    SuperUser
    February 15, 2017

    This functionality is only available in the GUI. One workaround would be to get the IDs from the GUI section display and call them up one after another in the CLI, e.g.

    show firewall policy <nn>

     

    Thanks to your question I found out that one can call the 'show' command with a policy ID - didn't notice in the last 10 years...

    neonbit
    New Member
    February 15, 2017

    As per ede's post the GUI would be the way to go.

     

    You can show policies in the CLI and filter using grep, but that would only filter if the source or destination interface was port1.

     

    You could use an OR grep for port1 or port10, but again it would show all policies where either port1 or port10 is used in source or destination interface.

     

    FYI to do this you would use the following:

     

    config firewall policy

    show | grep -f 'port1\|port10'

    ede_pfau
    SuperUser
    SuperUser
    February 15, 2017

    @neonbit: grep will only filter the lines with 'set dstintf' and 'set srcintf', not the whole block. I doubt this will suffice.

    jintrah_FTNT
    Staff
    Staff
    February 16, 2017

    May be the below context helps

     

    show firewall policy | grep -f port1