Manage Interfaces

Describes how to send a request to the interface
PAN-OS supports the openconfig-interfaces model which enables you to manage interfaces from your client.
To set the physical interface description and logical interface description use three colons as a separator.
The following examples configure interfaces.

Basics of Setting an Interface

The example shows a gNMI call that sets a description node for the ethernet1/1:
gnmic -a 10.1.1.1:9339 -ca ca.pem -key client.key -cert client.pem -u username -p Password set --update /interfaces/interface[name=ethernet1/1]/config/description:::string:::This-is-a-test-description!
A successful response returns:
{ "timestamp": 1614057808127750767, "time": "2021-02-22T21:23:28.127750767-08:00", "results": [ { "operation": "UPDATE", "path": "interfaces/interface[name=ethernet1/1]/config/description" } ] }

Setting the IP Address of an Interface

The example below shows a gNMI set call that sets an ipv4 address for interface ethernet1/2:
gnmic -a 10.1.1.1:9339 -ca ca.pem -key client.key -cert client.pem -u username -p Password set --update /interfaces/interface[name=ethernet1/2]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=76.76.76.1]/config/prefix-length:::int:::24
To set the ipv4 address of the main interface specify an interface at subindex zero such as
subinterfaces/subinterface[index=0]
.
This works for every interface type except loopback interfaces, although loopback interfaces still support non-zero subinterface indexes.
A successful response returns:
{ "timestamp": 1614059786636982095, "time": "2021-02-22T21:56:26.636982095-08:00", "results": [ { "operation": "UPDATE", "path": "interfaces/interface[name=ethernet1/2]/subinterfaces/subinterface[index=0]/ipv4/addresses/address[ip=76.76.76.1]/config/prefix-length" } ] }
The above commands as shown in the user interface:

Retrieving Interfaces

The example below shows a gNMI get call that retrieves interfaces:
gnmic -a 10.1.1.1:9339 -ca ca.pem -key client.key -cert client.pem -u username -p password get --path /interfaces/interface[name=*]
Below is an example response as standard output from the gNMI client with the configuration statements configured above.
[ { "timestamp": 1614061161569003598, "time": "2021-02-22T22:19:21.569003598-08:00", "updates": [ { "Path": "interfaces", "values": { "interfaces": { "interface": [ { "config": { "description": "this-is-a-test-description!", "enabled": true, "loopback-mode": false, "mtu": 1500, "name": "ethernet1/1", "tpid": "openconfig-vlan-types:TPID_0X8100", "type": "iana-if-type:ethernetCsmacd" }, "openconfig-if-ethernet:ethernet": { "config": { "auto-negotiate": true, "enable-flow-control": false, "mac-address": "00:50:56:9a:27:38", "port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN" }, "state": { "auto-negotiate": true, "enable-flow-control": false, "hw-mac-address": "00:50:56:9a:27:38", "mac-address": "00:50:56:9a:27:38", "negotiated-duplex-mode": "FULL", "negotiated-port-speed": "openconfig-if-ethernet:SPEED_10GB", "port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN" } }, "openconfig-interfaces:hold-time": { "config": { "down": 0, "up": 0 }, "state": { "down": 0, "up": 0 } }, "openconfig-interfaces:name": "ethernet1/1", "state": { "admin-status": "UP", "counters": { "carrier-transitions": "0", "in-broadcast-pkts": "0", "in-discards": "0", "in-errors": "0", "in-fcs-errors": "0", "in-multicast-pkts": "0", "in-octets": "243894051", "in-pkts": "3118108", "in-unicast-pkts": "3118089", "in-unknown-protos": "0", "last-clear": "0", "out-broadcast-pkts": "0", "out-discards": "0", "out-errors": "0", "out-multicast-pkts": "0", "out-octets": "0", "out-pkts": "0", "out-unicast-pkts": "0" }, "description": "this-is-a-test-description!", "enabled": true, "ifindex": 16, "last-change": "0", "logical": false, "loopback-mode": false, "mtu": 1500, "name": "ethernet1/1", "oper-status": "UP", "tpid": "openconfig-vlan-types:TPID_0X8100", "type": "iana-if-type:ethernetCsmacd" } }, { "config": { "description": "", "enabled": true, "loopback-mode": false, "mtu": 1500, "name": "ethernet1/2", "tpid": "openconfig-vlan-types:TPID_0X8100", "type": "iana-if-type:ethernetCsmacd" }, "openconfig-if-ethernet:ethernet": { "config": { "auto-negotiate": true, "enable-flow-control": false, "mac-address": "ba:db:ad:ba:db:02", "port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN" }, "state": { "auto-negotiate": true, "enable-flow-control": false, "hw-mac-address": "ba:db:ad:ba:db:02", "mac-address": "ba:db:ad:ba:db:02", "negotiated-port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN", "port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN" } }, "openconfig-interfaces:hold-time": { "config": { "down": 0, "up": 0 }, "state": { "down": 0, "up": 0 } }, "openconfig-interfaces:name": "ethernet1/2", "openconfig-interfaces:subinterfaces": { "subinterface": [ { "config": { "description": "", "enabled": true, "index": 0 }, "index": 0, "openconfig-if-ip:ipv4": { "addresses": { "address": [ { "config": { "ip": "76.76.76.1", "prefix-length": 24 }, "ip": "76.76.76.1", "state": { "ip": "76.76.76.1", "origin": "STATIC", "prefix-length": 24 } } ] }, "config": { "dhcp-client": false, "enabled": true, "mtu": 1500 }, "proxy-arp": { "config": { "mode": "DISABLE" }, "state": { "mode": "DISABLE" } }, "state": { "dhcp-client": false, "enabled": true, "mtu": 1500 } }, "openconfig-if-ip:ipv6": { "config": { "dhcp-client": false, "dup-addr-detect-transmits": 0, "enabled": false, "mtu": 1500 }, "router-advertisement": { "config": { "interval": 600, "lifetime": 1800, "suppress": true }, "state": { "interval": 600, "lifetime": 1800, "suppress": true } }, "state": { "dhcp-client": false, "dup-addr-detect-transmits": 0, "enabled": false, "mtu": 1500 } }, "state": { "admin-status": "UP", "counters": { "carrier-transitions": "0", "in-broadcast-pkts": "0", "in-discards": "0", "in-errors": "0", "in-fcs-errors": "0", "in-multicast-pkts": "0", "in-octets": "0", "in-pkts": "0", "in-unicast-pkts": "0", "in-unknown-protos": "0", "last-clear": "0", "out-broadcast-pkts": "0", "out-discards": "0", "out-errors": "0", "out-multicast-pkts": "0", "out-octets": "0", "out-pkts": "0", "out-unicast-pkts": "0" }, "description": "", "enabled": true, "ifindex": 17, "index": 0, "last-change": "0", "logical": true, "name": "ethernet1/2.0", "oper-status": "DOWN" } } ] }, "state": { "admin-status": "UP", "counters": { "carrier-transitions": "0", "in-broadcast-pkts": "0", "in-discards": "0", "in-errors": "0", "in-fcs-errors": "0", "in-multicast-pkts": "0", "in-octets": "0", "in-pkts": "0", "in-unicast-pkts": "0", "in-unknown-protos": "0", "last-clear": "0", "out-broadcast-pkts": "0", "out-discards": "0", "out-errors": "0", "out-multicast-pkts": "0", "out-octets": "0", "out-pkts": "0", "out-unicast-pkts": "0" }, "description": "", "enabled": true, "ifindex": 17, "last-change": "0", "logical": false, "loopback-mode": false, "mtu": 1500, "name": "ethernet1/2", "oper-status": "DOWN", "tpid": "openconfig-vlan-types:TPID_0X8100", "type": "iana-if-type:ethernetCsmacd" } } } ] } } } ] } ]

Recommended For You