PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
340 stars 168 forks source link

Unable to create virtual wire subinterface in palo alto fw. #460

Closed kanagasivan closed 2 years ago

kanagasivan commented 2 years ago

https://pan-os-python.readthedocs.io/en/latest/_modules/panos/network.html#AbstractSubinterface

Team kindly suggest how to add virtual wire subinterface in palo alto firewall.

welcome-to-palo-alto-networks[bot] commented 2 years ago

:tada: Thanks for opening your first issue here! Welcome to the community!

shinmog commented 2 years ago
from panos.firewall import Firewall
from panos.network import EthernetInterface, Layer2Subinterface

fw = Firewall(..........)

eth = EthernetInterface('ethernet1/1', mode='virtual-wire')
fw.add(eth)

l2 = Layer2Subinterface('ethernet1/1.2', 2)
eth.add(l2)

l2.create()
kanagasivan commented 2 years ago

Thanks for the update. But the interface type should be "virtual-wire" when i executed this script interface type is changed to "Layer2" Interface.