How do we set a default gateway?

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Please sign in to see details of an important advisory in our Customer Advisories area.
Palo Alto Networks Approved
Palo Alto Networks Approved
Community Expert Verified
Community Expert Verified

How do we set a default gateway?

L0 Member

Simple question "How do we set a default gateway?"


Community Team Member

Hi @ukmercenary ,


Default gateway for what exactly ? (mgmt ? dataplane ?)


For your management interface it's part of the system IP-address configuration command.  Here's an example :

admin@PA-200# set deviceconfig system ip-address netmask default-gateway dns-setting servers primary

It's explained in this article:

Getting Started: Setting Up Your Firewall 


For your dataplane interfaces you can check the following article:

Getting Started: Layer 3, NAT, and DHCP 


Note that if you don't know a specific CLI command you can use the following command to find existing command options :


admin@PA-200# find command keyword default-gateway

This will return all the existing CLI commands containing 'default-gateway'


I hope this helps,


LIVEcommunity team member, CISSP
Please help out other users and “Accept as Solution” if a post helps solve your problem !

Read more about how and why to accept solutions.

L7 Applicator


From the GUI.

In the virtual router, just add a static route destination   Next hop. (Gateway address)

L0 Member

I utilized the full command "

 set deviceconfig system ip-address netmask default-gateway dns-setting servers primary"

on the command line with a console cable and it cut if off after the netmask 4 digits then placed the rest of the statement "default-gateway...... & dns ontop of that line.  So I could only set the ip nothing else.  Has any one experienced this?  It is a PA 220.  Is there a way around it so I can add the default gateway and dns by themselves?


  • 3 replies
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 LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!