Routing

View and configure routing for the FTD device, including VRFs, static routes, OSPF and BGP.

BGP

class firepyer.Fdm
get_bgp_general_settings()

Gets the device’s general BGP settings if any are set

Returns

The BGPGeneralSettings object or None if none are set

Return type

dict

>>> fdm.get_bgp_general_settings()
{'aggregateTimer': 30,
 'asNumber': '65500',
 'asnotationDot': False,
 'bgpBestPath': {'alwaysCompareMed': False,
                 'bestPathCompareRouterId': False,
                 'bestPathMedMissingAsWorst': False,
                 'defaultLocalPreferenceValue': 100,
                 'deterministicMed': False,
                 'type': 'bgpbestpath'},
 'bgpGracefulRestart': None,
 'bgpNextHopTriggerDelay': 5,
 'bgpNextHopTriggerEnable': True,
 'bgpTimers': {'holdTime': 180,
               'keepAlive': 60,
               'minHoldTime': 0,
               'type': 'bgptimers'},
 'description': None,
 'enforceFirstAs': True,
 'fastExternalFallOver': True,
 'id': '12345678-1234-1234-1234-123456789abc',
 'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/bgpgeneralsettings/12345678-1234-1234-1234-123456789abc'},
 'logNeighborChanges': True,
 'maxasLimit': None,
 'name': 'BgpGeneralSettings',
 'routerId': None,
 'scanTime': 60,
 'transportPathMtuDiscovery': True,
 'type': 'bgpgeneralsettings',
 'version': 'omg123ffsabcd'}
set_bgp_general_settings(asn: str, name='BgpGeneralSettings', description=None, router_id=None) → dict

Set the device’s general BGP settings

Parameters
  • asn (str) – The AS number for the BGP process

  • name (str, optional) – A name for the settings, defaults to ‘BgpGeneralSettings’

  • description (str, optional) – A description for the settings, defaults to None

  • router_id (str, optional) – A router ID for the BGP process, defaults to None

Returns

The BGPGeneralSettings object instance created

Return type

dict

>>> fdm.set_bgp_general_settings(asn='65500')
{'aggregateTimer': 30,
 'asNumber': '65500',
 'asnotationDot': False,
 'bgpBestPath': {'alwaysCompareMed': False,
                 'bestPathCompareRouterId': False,
                 'bestPathMedMissingAsWorst': False,
                 'defaultLocalPreferenceValue': 100,
                 'deterministicMed': False,
                 'type': 'bgpbestpath'},
 'bgpGracefulRestart': None,
 'bgpNextHopTriggerDelay': 5,
 'bgpNextHopTriggerEnable': True,
 'bgpTimers': {'holdTime': 180,
               'keepAlive': 60,
               'minHoldTime': 0,
               'type': 'bgptimers'},
 'description': None,
 'enforceFirstAs': True,
 'fastExternalFallOver': True,
 'id': '12345678-1234-1234-1234-123456789abc',
 'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/bgpgeneralsettings/12345678-1234-1234-1234-123456789abc'},
 'logNeighborChanges': True,
 'maxasLimit': None,
 'name': 'BgpGeneralSettings',
 'routerId': None,
 'scanTime': 60,
 'transportPathMtuDiscovery': True,
 'type': 'bgpgeneralsettings',
 'version': 'omg123ffsabcd'}
get_bgp_settings(vrf='Global')

Get the BGP settings for a specifc VRF or the default (Global)

Parameters

vrf (str, optional) – Name of a VRF to get the BGP settings, defaults to ‘Global’

Returns

The BGPSettings object or None if none are set

Return type

dict

>>> fdm.get_bgp_settings()
{'addressFamilyIPv4': {'afTableMap': None,
                       'aggregateAddressesIPv4s': [],
                       'aggregateTimer': 30,
                       'autoSummary': False,
                       'bgpNextHopTriggerDelay': 5,
                       'bgpNextHopTriggerEnable': True,
                       'bgpRedistributeInternal': False,
                       'bgpSupressInactive': False,
                       'defaultInformationOrginate': False,
                       'distance': {'externalDistance': 20,
                                    'internalDistance': 200,
                                    'localDistance': 200,
                                    'type': 'afbgpdistance'},
                       'distributeLists': [],
                       'injectMaps': [],
                       'maximumPaths': None,
                       'neighbors': [],
                       'networks': [],
                       'redistributeProtocols': [],
                       'scanTime': 60,
                       'synchronization': False,
                       'type': 'afipv4'},
 'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/virtualrouters/12345678-1234-1234-1234-123456789abc/bgp/12345678-1234-1234-1234-123456789abc'},
 'name': 'bgp-general',
 'routerId': None,
 'type': 'bgp',
 'version': 'omg123ffsabcd'}
set_bgp_settings(asn, name='', description=None, router_id=None, vrf='Global', af=4, auto_summary=False, neighbours=[], networks=[], default_originate=False) → dict

Configures BGP settings for the give (or default) VRF

Parameters
  • asn (str) – The AS Number of the BGP process, MUST be the same as in the BGPGeneralSettings

  • name (str, optional) – Name for the BGPSettings, MUST be unique across the device, defaults to ‘VRFNAME-BGPSettings’

  • description (str, optional) – Description for the BGPSettings, defaults to None

  • router_id (str, optional) – A router ID for the BGP process, defaults to None

  • vrf (str, optional) – Name of the VRF to configure BGP in, defaults to ‘Global’

  • af (int, optional) – BGP Address-Family to use, should be either [4, 6], defaults to 4

  • auto_summary (bool, optional) – Automatically summarise subnet routes to network routes, defaults to False

  • neighbours (list, optional) – Neighbours to add to the BGP process, each neighbour in the list should be a dict in format {“remoteAs”: “65001”, “activate”: True, “ipv4Address”: “192.168.1.1”}, defaults to []

  • networks (list, optional) – Names of NetworkObjects to add to as networks into the BGP, defaults to []

  • default_originate (bool, optional) – Enable or disable default originate for BGP, defaults to False

Returns

The BGPSettings object instance created

Return type

dict

OSPF

class firepyer.Fdm
get_ospf_settings(vrf='Global') → List[dict]

Get the OSPF settings for a specifc VRF or the default (Global)

Parameters

vrf (str, optional) – Name of a VRF to get the OSPF settings, defaults to ‘Global’

Returns

List of all OSPFSettings objects, one per process ID

Return type

List[dict]

>>> fdm.get_ospf_settings()
[{'areas': [{'areaId': '0',
             'areaNetworks': [{'ipv4Network': {'id': '00f7b297-4d44-11eb-9e04-13721b05d633',
                                               'name': 'any-ipv4',
                                               'type': 'networkobject',
                                               'version': 'kxd2dzxm2gtwn'},
                               'tagInterface': None,
                               'type': 'areanetwork'}],
             'areaRanges': [],
             'areaType': None,
             'authentication': None,
             'defaultCost': None,
             'filterList': [],
             'type': 'area',
             'virtualLinks': []}],
  'description': '',
  'filterRules': [],
  'id': '2edf8a2a-7948-11eb-b948-7146721ce7c1',
  'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/virtualrouters/42e95fbf-fd5a-42bf-a95f-bffd5a42bfd6/ospf/2edf8a2a-7948-11eb-b948-7146721ce7c1'},
  'logAdjacencyChanges': {'logType': 'DETAILED', 'type': 'logadjacencychanges'},        
  'name': 'OSPF-Settings',
  'neighbors': [],
  'processConfiguration': {'administrativeDistance': {'external': 110,
                                                      'interArea': 110,
                                                      'intraArea': 110,
                                                      'type': 'administrativedistance'},
                           'defaultInformationOriginate': None,
                           'ignoreLsaMospf': False,
                           'nsfGracefulRestart': None,
                           'rfc1583Compatible': None,
                           'routerId': '192.168.133.7',
                           'timers': {'floodPacing': 33,
                                      'lsaArrival': 1000,
                                      'lsaGroup': 240,
                                      'lsaThrottleTimer': {'initialDelay': 0,
                                                           'maximumDelay': 5000,        
                                                           'minimumDelay': 5000,        
                                                           'type': 'lsathrottletimer'}, 
                                      'retransmission': 66,
                                      'spfThrottleTimer': {'initialDelay': 5000,
                                                           'maximumWaitTime': 10000,
                                                           'minimumHoldTime': 10000,
                                                           'type': 'spfthrottletimer'},
                                      'type': 'timers'},
                           'type': 'processconfiguration'},
  'processId': '1',
  'redistributeProtocols': [],
  'summaryAddresses': [],
  'type': 'ospf',
  'version': 'bkgiho4cwbm4l'}]

VRFs

class firepyer.Fdm
get_vrfs(name='', must_find: bool = False)

Gets all VRFs or a single VRF if a name is provided

Parameters
  • name (str, optional) – The name of a VRF to find, defaults to ‘’

  • must_find (bool, optional) – Specifies if an exception should be raised if the resource isn’t found, defaults to False

Returns

A list of all VRFs if no name is provided, or a dict of the single VRF with the given name

Return type

list|dict

>>> fdm.get_vrfs()
[{'description': "Customer A's VRF",
  'id': '67e4d858-503d-11eb-aab5-2921a41f8ca3',
  'interfaces': [{'hardwareName': 'GigabitEthernet0/2',
                  'id': 'aeb5b238-4d44-11eb-9e04-cd44159d2943',
                  'name': 'customer_a',
                  'type': 'physicalinterface',
                  'version': 'nh7piq3rw7pzs'}],
  'isSystemDefined': False,
  'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/virtualrouters/67e4d858-503d-11eb-aab5-2921a41f8ca3'},
  'name': 'Customer-A',
  'type': 'virtualrouter',
  'version': 'crdwtc44cg5pu'},
 {'description': "Customer B's VRF",
  'id': '7360254c-503d-11eb-aab5-41ec0935f001',
  'interfaces': [{'hardwareName': 'GigabitEthernet0/3',
                  'id': 'afb288c9-4d44-11eb-9e04-41c0f86d8474',
                  'name': 'customer_b',
                  'type': 'physicalinterface',
                  'version': 'ocdhtp76zpfzz'}],
  'isSystemDefined': False,
  'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/virtualrouters/7360254c-503d-11eb-aab5-41ec0935f001'},
  'name': 'Customer-B',
  'type': 'virtualrouter',
  'version': 'nl7onsmfqdujm'},
 {'description': 'This is a Global Virtual Router',
  'id': '42e95fbf-fd5a-42bf-a95f-bffd5a42bfd6',
  'interfaces': [{'hardwareName': 'Management0/0',
                  'id': 'b0b5a0ea-4d44-11eb-9e04-43089048338b',
                  'name': 'diagnostic',
                  'type': 'physicalinterface',
                  'version': 'inmqiea7woymm'},
                 {'hardwareName': 'GigabitEthernet0/1',
                  'id': 'ad6a9497-4d44-11eb-9e04-63d0b1958967',
                  'name': 'inside',
                  'type': 'physicalinterface',
                  'version': 'eqotynhtlcuyf'},
                 {'hardwareName': 'GigabitEthernet0/0',
                  'id': '8d6c41df-3e5f-465b-8e5a-d336b282f93f',
                  'name': 'outside',
                  'type': 'physicalinterface',
                  'version': 'h4kqp4iu2yvff'}],
  'isSystemDefined': True,
  'links': {'self': 'https://192.168.133.7/api/fdm/latest/devices/default/routing/virtualrouters/42e95fbf-fd5a-42bf-a95f-bffd5a42bfd6'},
  'name': 'Global',
  'type': 'virtualrouter',
  'version': 'cna3vbajed6et'}]