Skip to content

Commit

Permalink
feat(panos/network): Advanced routing engine (#539)
Browse files Browse the repository at this point in the history
* Start work on Logical Router

* Add interfaces and admin distances for logical router

* Add static routes for VRF

* Add BFD profile

* Fix BFD profile

* Assign BFD profile to static route

* Update commits

* Static IPv6 route

* BGP auth and timer profiles

* BGP address family - IPv4 unicast

* BGP address family - finish IPv4 unicast

* BGP address family - IPv4 multicast and IPv6 unicast

* BGP dampening profile

* BGP redistribution profile

* BGP filtering (without filter lists and maps)

* OSPF timers and auth

* Fix pytest issues

* New class for OSPF redistribution profile

* Extend class for OSPF redistribution profile

* Finish OSPF redistribution profile

* OSPFv3 authentication profile

* OSPFv3 timer profiles

* OSPFv3 redistribution profile

* Filter Access List - IPv4

* Filter Access List - IPv6

* Filter Prefix List

* Filter AS-Path Access List

* Filter Community List

* Filter BGP Route-Maps

* Filter BGP Route-Maps Redistribution (without from-protocol , to-protocol)

* BGP settings, BGP peer and peer group

* OSPF (without area)

* OSPF area

* Add RIB filters for logical router

* Add ECMP for logical router

* Add extended ECMP configuration

* Add OSPF area range

* Add OSPF area interface

* Add OSPF area virtual link

* Configure OPSFv3 on logical router

* Add OSPFv3 with virutal link, range, interface for area

* Format code

* Add class for AdvancedRoutingEngine

* Fix ValueError: not enough values to unpack (expected 2, got 1)

* Simple test for logical router with VRF

* Add template of logical route and test for BGP peer group

* Test BGP auth profile

* Add test for advanced routing engine

* Test VRF static routes and BGP peer

* Tests for routing profiles for BGP

* Test for ARE OSPF

* Extend logical router skeleton used in tests

* Tests for routing profiles for OSPF

* Add tests for other routing profiles

* Fix format issues

* Update TODO with details what to implement

* Format code

* Format code with poetry and Python 3.8
  • Loading branch information
sebastianczech authored Feb 7, 2024
1 parent 0bd3c05 commit 173bb8a
Show file tree
Hide file tree
Showing 6 changed files with 4,558 additions and 4 deletions.
34 changes: 34 additions & 0 deletions panos/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ class Vsys(VersionedPanObject):
"network.VlanInterface",
"network.Vlan",
"network.VirtualRouter",
"network.LogicalRouter",
"network.Vrf",
"network.VirtualWire",
"network.Layer2Subinterface",
"network.Layer3Subinterface",
Expand Down Expand Up @@ -397,6 +399,38 @@ def _setup(self):
self._params = tuple(params)


class AdvancedRoutingEngine(VersionedPanObject):
"""
Note: This is valid for PANS-OS 10.2+.
Args:
enable (bool): Enable advanced routing engine
"""

NAME = None
ROOT = Root.DEVICE
CHILDTYPES = ()

def _setup(self):
# xpaths
self._xpaths.add_profile(value="/deviceconfig/setting")

# params
params = []

params.append(
VersionedParamPath(
"enable",
default=False,
vartype="yesno",
path="advance-routing",
)
)

self._params = tuple(params)


class LogSettingsSystem(VersionedPanObject):
"""Firewall or Panorama device log settings system
Expand Down
3 changes: 3 additions & 0 deletions panos/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Firewall(PanDevice):
"device.Vsys",
"device.VsysResources",
"device.SystemSettings",
"device.AdvancedRoutingEngine",
"device.LogSettingsSystem",
"device.LogSettingsConfig",
"device.PasswordProfile",
Expand Down Expand Up @@ -104,6 +105,8 @@ class Firewall(PanDevice):
"network.Layer3Subinterface",
"network.Vlan",
"network.VirtualRouter",
"network.LogicalRouter",
"network.Vrf",
"network.ManagementProfile",
"network.VirtualWire",
"network.IkeGateway",
Expand Down
Loading

0 comments on commit 173bb8a

Please sign in to comment.