Get zones info for two ip (multiple firewalls)

Reply
Highlighted
L3 Networker

Get zones info for two ip (multiple firewalls)

So, say i have a multiple firewalls of many zones. 

 

If i want to create a rule between two servers in different firewall i need to create one rule in each firewall. For example trust to utrust and in the other firewall untrust to trust. (in some cases we allow it in one of the firewalls by default). If I need to type in this manualy in the automation job (no matter if its ansible or powershell or other) it feels like i almost can use the gui anyway. But if i can get this info via a script it would get alot easier.

 

So if you had a enviorment consisting of many firewall and need to find out the routing between two servers. How would you build that logic?

 

Highlighted
L2 Linker

Greetings,

 

Using the XML API you can get the routing table of each firewall and compare the results.

https://FIREWALLIP/api/?type=op&cmd=<show><routing><fib></fib></routing></show>

Example of a simple python method to get the routing table:

import requests
import xmltodict
def
getRoutes(FWIP, FW_API_KEY):
URL = 'https://' + FWIP + '/api'
params = {
'type': 'op',
'key': FW_API_KEY,
'cmd' : '<show><routing><fib></fib></routing></show>'
}
result = requests.get(URL, params=params, verify=False)
result = xmltodict.parse(result.text)
routeList = result.get('response').get('result').get('fibs').get('entry')
for i in routeList:
# do something
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!