Adding address objects and tagging them via CLI.

Reply
Highlighted
L2 Linker

Adding address objects and tagging them via CLI.

In my network we tag certain IP addresses for various reasons on our Palo Alto's. Sometimes we will get a large batch of these that need to be done and manually creating an address object and then tagging it via the GUi can be time consuming (to say the least).

 

I'm wondering if there is a way to add these object groups and tag them via the CLI.

 

I'm running a Panorama with an HA pair of physical boxes if that makes a difference.

 

Thanks.


Accepted Solutions
Highlighted
L2 Linker

I ended up using this method:

 

set cli config-output-format set
configure

set device-group <device_group_name > address < address_object_name> ip-netmask <ip_address/netmask>
set device-group < device_group_name> address < adsdress_object_name > tag <tag_name>

 

Thanks!

View solution in original post


All Replies
Highlighted
Community Team Member

Hi @Gareth.Doyle,

 

I think you want to use the set address / address-group commands in CLI (in configuration mode) :

 

 

> configure

# set address
# set address <name> tag  [ <tag1> <tag2>... ]
# set address-group <name> tag  [ <tag1> <tag2>... ]

 

Hope this helps !

-Kiwi.

Highlighted
L7 Applicator

Have you considered using API to inject these IPs in tagged dynamic objects?

 

Register IP Addresses and Tags Dynamically

 

Sample API workflow for Dynamic Address Objects

Tom Piens - PANgurus.com
Find my book at amazon.com/dp/1789956374
Highlighted
L3 Networker

Like this

 

 

set vsys vsys1 address <address object> tag <tag> ip-netmask x.x.x.x/32

And if you want to add it to a group

 

set address-group <address group> <address object>

 

Highlighted
L2 Linker

I ended up using this method:

 

set cli config-output-format set
configure

set device-group <device_group_name > address < address_object_name> ip-netmask <ip_address/netmask>
set device-group < device_group_name> address < adsdress_object_name > tag <tag_name>

 

Thanks!

View solution in original post

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!