Skip to main content

Ethernet Interface Models

Overview

The Ethernet Interface models provide structured validation for ethernet interface configuration in Palo Alto Networks' Strata Cloud Manager. These models support Layer 2, Layer 3, and TAP modes with strict oneOf validation.

Models

  • EthernetInterfaceCreateModel: For creating new ethernet interfaces
  • EthernetInterfaceUpdateModel: For updating existing interfaces (includes id)
  • EthernetInterfaceResponseModel: Response model from API operations
  • EthernetLayer2: Layer 2 mode configuration
  • EthernetLayer3: Layer 3 mode configuration
  • EthernetTap: TAP mode configuration

All models use extra="forbid" to reject undefined fields.

Important: Naming Convention

Ethernet interface names in SCM must start with $ (dollar sign) as they are variable references. The default_value field specifies the physical interface assignment.

# Correct usage
name="$wan-interface" # Variable name (required $ prefix)
default_value="ethernet1/1" # Physical interface assignment

Model Attributes

EthernetInterfaceBaseModel

AttributeTypeRequiredDefaultDescription
namestrYesNoneVariable name (must start with $, max 63 chars)
default_valuestrNoNonePhysical interface (e.g., ethernet1/1)
commentstrNoNoneDescription (max 1023 chars)
link_speedstrNo"auto"Link speed (auto/10/100/1000/10000/40000/100000)
link_duplexstrNo"auto"Duplex (auto/half/full)
link_statestrNo"auto"State (auto/up/down)
poePoeConfigNoNonePower over Ethernet config
layer2EthernetLayer2No*NoneLayer 2 mode configuration
layer3EthernetLayer3No*NoneLayer 3 mode configuration
tapEthernetTapNo*NoneTAP mode configuration
folderstrNo**NoneFolder container
snippetstrNo**NoneSnippet container
devicestrNo**NoneDevice container

* Only one mode can be configured (oneOf validation) ** Exactly one container required for create operations

EthernetLayer2

AttributeTypeRequiredDefaultDescription
vlan_tagstrNoNoneVLAN tag (1-4096)
lldpLldpConfigNoNoneLLDP configuration

EthernetLayer3

AttributeTypeRequiredDefaultDescription
ipList[StaticIp]No*NoneStatic IP addresses
dhcp_clientDhcpClientNo*NoneDHCP client configuration
pppoePppoeConfigNo*NonePPPoE configuration
mtuintNo1500MTU (576-9216)
interface_management_profilestrNoNoneManagement profile
arpList[ArpEntry]NoNoneStatic ARP entries
ddns_configDdnsConfigNoNoneDynamic DNS config

* Only one IP mode can be configured (oneOf validation)

Model Validators

Interface Mode Validation

Ensures only one of layer2, layer3, or tap is configured:

@model_validator(mode="after")
def validate_interface_mode(self) -> "EthernetInterfaceBaseModel":
modes = [self.layer2, self.layer3, self.tap]
configured = [m for m in modes if m is not None]
if len(configured) > 1:
raise ValueError("Only one interface mode allowed")
return self

IP Mode Validation (Layer3)

Ensures only one of ip, dhcp_client, or pppoe is configured:

@model_validator(mode="after")
def validate_ip_mode(self) -> "EthernetLayer3":
modes = [self.ip, self.dhcp_client, self.pppoe]
configured = [m for m in modes if m is not None]
if len(configured) > 1:
raise ValueError("Only one IP addressing mode allowed")
return self

Usage Examples

Layer 3 with Static IP

from scm.models.network import EthernetInterfaceCreateModel

interface = EthernetInterfaceCreateModel(
name="$wan-interface",
default_value="ethernet1/1",
layer3={
"ip": [{"name": "192.168.1.1/24"}],
"mtu": 1500
},
folder="Interfaces"
)
payload = interface.model_dump(exclude_unset=True)

Layer 3 with DHCP

interface = EthernetInterfaceCreateModel(
name="$dhcp-interface",
default_value="ethernet1/2",
layer3={
"dhcp_client": {
"enable": True,
"create_default_route": True
}
},
folder="Interfaces"
)

Layer 2 with VLAN

interface = EthernetInterfaceCreateModel(
name="$layer2-interface",
layer2={
"vlan_tag": "100",
"lldp": {"enable": True}
},
folder="Interfaces"
)

TAP Mode

interface = EthernetInterfaceCreateModel(
name="$tap-interface",
tap={},
folder="Interfaces"
)