PAN-OS BGP Route Redistribution for PCNSE Candidates

Welcome PCNSE candidates! This guide focuses on a critical networking topic for the Palo Alto Networks Certified Network Security Engineer exam: BGP Route Redistribution . Understanding how to effectively and safely redistribute routes into BGP on a PAN-OS firewall is essential for controlling network reachability and implementing traffic engineering policies.

Route redistribution is the process of taking routes learned via one routing source (like OSPF, RIP, static routes, or connected interfaces) and advertising them into another routing protocol, in this case, BGP. On a PAN-OS firewall, this is commonly done to announce internal network segments or specific static routes to external BGP peers, such as ISPs or partner networks.

This article leverages information primarily from the Palo Alto Networks official documentation and knowledge base, focusing on practical configuration, potential pitfalls, and exam-relevant tips.

PCNSE candidates should focus on understanding the *purpose*, *configuration steps*, *filtering mechanisms*, and the *impact of attribute manipulation* during redistribution. Expect scenario-based questions testing these areas.

Core Concepts: What is BGP Redistribution and Why Use It?

What is Route Redistribution?

At its core, route redistribution involves teaching one routing domain about routes known by another. Imagine you have internal networks running OSPF, some critical servers reached via static routes, and you need your internet service providers (ISPs), who speak BGP with you, to know how to reach these networks. Redistribution is the bridge.

Why Redistribute Routes into BGP on PAN-OS?

Common use cases include:

  1. Advertising Internal Networks: Making internal subnets (learned via OSPF, connected interfaces, etc.) reachable from the outside world via your BGP-speaking ISPs.
  2. Announcing Specific Services: Advertising static routes for specific publicly accessible services hosted behind the firewall.
  3. Multi-homing & Traffic Engineering: Controlling how external networks reach your internal resources when you have multiple BGP connections (e.g., primary/backup ISP links). This is achieved by manipulating BGP attributes during redistribution.
  4. Replacing Default Routes: Instead of relying solely on default routes from ISPs, advertise your specific public IP ranges via BGP for more granular control and redundancy.
Mutual Redistribution Warning: Redistributing routes in both directions between two protocols (e.g., BGP into OSPF *and* OSPF into BGP) without careful filtering can create routing loops and instability. While redistributing *from* BGP *into* an IGP is less common at the edge, be aware of the risks. The primary focus here is redistribution *into* BGP.

Sequence of a route being redistributed into BGP.

Core Concepts: PAN-OS Components for BGP Redistribution

In PAN-OS, BGP redistribution is configured within the Virtual Router (VR) settings. The key component is the Redistribution Profile .

Virtual Router (VR)

The VR is the fundamental routing instance on the firewall. All routing protocols (BGP, OSPF, RIP, Static) operate within the context of a VR. Redistribution rules bridge these protocols *within the same VR*.

Redistribution Profile

This is the central object for controlling redistribution into BGP (and other protocols). You create one or more profiles within the VR.

Location: Network > Virtual Routers > (Select your VR) > Redistribution Profiles

Key elements of a Redistribution Profile:

Know the location (VR > Redistribution Profiles), the meaning of Priority (lower = higher priority), the Filter options, and the key BGP attributes you can set (Origin, MED, Local Pref, Community, AS Path).

Configuration: Creating a Redistribution Profile

Let's walk through creating a basic Redistribution Profile to advertise a specific static route into BGP.

Scenario

You have a static route configured in your VR for `172.16.100.0/24` pointing to an internal server. You want to advertise this route to your BGP peers (ISPs).

Steps:

  1. Navigate to the Virtual Router: Go to Network > Virtual Routers and click on the name of the VR where your BGP instance and static route reside.
  2. Go to Redistribution Profiles: Select the Redistribution Profiles tab on the left.
  3. Add a New Profile: Click the Add button at the bottom.
  4. Configure Basic Settings:
    • Name: Enter a descriptive name, e.g., `Redist-Static-WebServer-to-BGP`.
    • Priority: Assign a priority. For specific advertisements, a mid-range priority like `100` might be suitable unless you need it to override others. Lower numbers are higher priority.
    • Action: Select `redist` (Allow).
  5. Configure Filters:
    • Filter Type: Select `Static` from the dropdown.
    • Address Based Filter: Click Add .
      • Select "Address Objects" or "IP Prefixes".
      • If using prefixes, enter `172.16.100.0/24`. You could also create an Address Object for this network and select it.
      • Set Match Type to `Exact` if you only want this specific prefix, or `Contains` if it's part of a larger aggregate you might define elsewhere (less common for specific static routes). Stick with `Exact` for this scenario.
  6. Configure BGP Specific Settings (Optional but Recommended):
    • Expand the BGP section.
    • Set Origin: Choose `IGP` or `Incomplete`. `IGP` (i) generally indicates the route originated within your AS. `Incomplete` (?) often implies redistribution. Check Palo Alto defaults and best practices; `IGP` is often preferred over `Incomplete` if possible.
    • Set Metric (MED): If you have multiple BGP peers and want to influence incoming traffic, set a MED value here (e.g., `100` for primary, `200` for backup).
    • Set Local Preference: If you learn routes from multiple internal sources and want to prefer this path outbound *within your AS*, set a higher Local Preference (e.g., `150`). Default is often `100`.
    • Set Community: Add any communities if needed for signaling (e.g., `no-export`).
  7. Click OK: Save the Redistribution Profile configuration.
  8. Commit: Commit the changes to the firewall ( Commit > Commit ).
After committing, verify the route is being advertised using CLI commands like show routing protocol bgp redist-profile and check neighbor advertisements: show routing protocol bgp neighbor advertised-routes .

Flowchart: Creating a Basic Redistribution Profile.

Configuration: The Critical Role of Filtering

Filtering is arguably the most important aspect of route redistribution. Without proper filtering, you risk:

How Filtering Works in PAN-OS Redistribution Profiles:

  1. Priority Matters First: Profiles are checked in order of priority (lowest number first).
  2. Match Criteria: Within a profile, the firewall checks if a route existing in the VR's RIB matches the Filter Type (e.g., OSPF Ext-2) and the Address Based Filter (e.g., prefix list).
  3. Action Taken:
    • If a match occurs and the Action is redist , the route is marked for redistribution (with specified attributes), and no further profiles are checked for this route .
    • If a match occurs and the Action is no-redist , the route is explicitly blocked from redistribution, and no further profiles are checked for this route .
    • If a route doesn't match any profile, it is not redistributed by default . There is no implicit "permit all".

Filtering Best Practices:

Example: Blocking RFC1918 and Allowing Specifics

  1. Profile 1 (Block Private):
    • Name: `Block-RFC1918-to-BGP`
    • Priority: `10`
    • Action: `no-redist`
    • Filter Type: `Static`, `Connect`, `OSPF` (add rules for each source type)
    • Address Based Filter: Add prefixes `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` (use `Contains` match type).
  2. Profile 2 (Allow Specific Static):
    • Name: `Redist-Static-WebServer-to-BGP`
    • Priority: `100`
    • Action: `redist`
    • Filter Type: `Static`
    • Address Based Filter: Prefix `172.16.100.0/24` (use `Exact` match type).
  3. Profile 3 (Allow Specific OSPF Internal):
    • Name: `Redist-OSPF-Internal-to-BGP`
    • Priority: `110`
    • Action: `redist`
    • Filter Type: `OSPF` (Select Intra-Area, Inter-Area)
    • Address Based Filter: Add specific public prefixes learned via OSPF (e.g., `203.0.113.0/25`).

In this setup, any route matching the RFC1918 ranges will hit Profile 1 first and be blocked. Only non-private routes will be considered by Profile 2 and 3.

Expect questions testing the logic of multiple redistribution profiles with different priorities and filter rules. Understand that processing stops once a route matches a profile (either allow or deny). The default is deny if no profile matches.

State Diagram: Route Processing Through Example Redistribution Profiles.

Configuration: Setting BGP Attributes During Redistribution

Simply advertising routes isn't always enough. You often need to influence how those routes are treated by BGP peers (affecting incoming traffic) or how your own network prefers paths (affecting outgoing traffic). Redistribution profiles are where you set the *initial* BGP attributes for these routes.

Key attributes configurable within the Redistribution Profile's BGP section:

Attributes set in the Redistribution Profile are applied *as the route is injected into the BGP process*. These can potentially be overridden later by BGP Export policies applied to specific BGP peers, but the Redistribution Profile sets the baseline.

Example: Setting MED and Community

In the `Redist-Static-WebServer-to-BGP` profile (Priority 100):
  • Go to the BGP tab within the profile.
  • Set Metric (MED) to `150`.
  • Under Set Community Type , choose `Standard`.
  • Under Set Community Action , choose `Append`.
  • Under Set Community Value , enter `no-export`.
  • Click OK and Commit.

Now, when `172.16.100.0/24` is advertised via BGP, it will carry a MED of 150 and the `no-export` community.

Traffic Engineering: Overview with Redistribution

Traffic Engineering (TE) in the context of BGP redistribution on PAN-OS primarily involves manipulating BGP path attributes for routes you *originate* (or inject via redistribution) to influence path selection, both for incoming and outgoing traffic.

Goals of BGP Traffic Engineering:

How Redistribution Enables TE:

When you redistribute routes (e.g., your public IP space announced via static routes) into BGP, the PAN-OS firewall becomes the point of origin for these routes in the BGP world. This gives you the power to set the initial BGP attributes:

Focus on how AS Path Prepending and MED set during redistribution influence *incoming* traffic. Understand that Local Preference primarily influences *outgoing* traffic and is more commonly set on *incoming* BGP advertisements (Import Policy) rather than during redistribution *to* eBGP peers.

Traffic Engineering using MED and AS Path Prepending set during redistribution to influence inbound traffic.

Traffic Engineering: Using Attributes (MED, LP, AS_PATH)

Let's dive deeper into how specific attributes set during redistribution achieve TE goals.

1. Influencing Inbound Traffic (How others reach you)

2. Influencing Outbound Traffic (How you reach others)

For the exam, associate:
  • MED -> Incoming Traffic Preference (Neighbor Choice), Lower = Better
  • AS Path Prepending -> Incoming Traffic De-preferencing (Global Choice), Longer = Worse
  • Local Preference -> Outgoing Traffic Preference (Your AS Choice), Higher = Better (Mainly via Import Policy)
Remember that these attributes are set *initially* by the redistribution profile but can potentially be modified by BGP Export policies later in the process.

Traffic Engineering: Redistribution Examples

Scenario 1: Primary/Backup ISPs using MED

Goal: Announce prefix `203.0.113.0/24` (static route) to ISP A (Primary) and ISP B (Backup). Prefer incoming traffic via ISP A.

Challenge: A single redistribution profile applies the same attributes initially. We need peer-specific adjustments, typically via Export Rules.

Approach (Conceptual - using Export Rules):

  1. Redistribution Profile (`Redist-MyPrefix-to-BGP`):
    • Priority: 100
    • Action: `redist`
    • Filter Type: `Static`
    • Filter: `203.0.113.0/24` (Exact)
    • BGP Settings: Set Origin `IGP`, Set MED `100` (Baseline/Primary MED)
  2. BGP Export Rule (`Export-Rule-Increase-MED-for-ISP-B`):
    • Navigate to: Network > Virtual Routers > [Your VR] > BGP > Export
    • Create a rule applied to the Peer Group/Peer for ISP B.
    • Match: Match the prefix `203.0.113.0/24`.
    • Action: Modify attributes -> Set MED `200`.

Result: ISP A receives the route with MED 100. ISP B receives the route with MED 200 (overridden by Export Rule). ISP B should prefer the path via ISP A (assuming other attributes are equal).

While redistribution sets the initial attributes, remember that BGP Export Rules (applied per-neighbor or per-peer-group) are often necessary for peer-specific traffic engineering like setting different MEDs or AS Path Prepending for the *same* redistributed prefix.

Scenario 2: Primary/Backup ISPs using AS Path Prepending

Goal: Announce prefix `203.0.113.0/24` (static route) to ISP A (Primary) and ISP B (Backup). Strongly discourage incoming traffic via ISP B.

Approach (Conceptual - using Export Rules):

  1. Redistribution Profile (`Redist-MyPrefix-to-BGP`):
    • Priority: 100
    • Action: `redist`
    • Filter Type: `Static`
    • Filter: `203.0.113.0/24` (Exact)
    • BGP Settings: Set Origin `IGP`. (No prepending here initially).
  2. BGP Export Rule (`Export-Rule-Prepend-AS-for-ISP-B`):
    • Navigate to: Network > Virtual Routers > [Your VR] > BGP > Export
    • Create a rule applied to the Peer Group/Peer for ISP B.
    • Match: Match the prefix `203.0.113.0/24`.
    • Action: Modify attributes -> AS Path Prepend -> Enter your ASN, Number of times: `3`.

Result: ISP A receives the route with AS Path `[YourASN]`. ISP B receives the route with AS Path `[YourASN] [YourASN] [YourASN] [YourASN]` (or similar, depending on how prepend count works). The path via ISP B is significantly longer and less preferred globally.

Traffic engineering is complex. Always verify results using `show routing protocol bgp neighbor advertised-routes` on your firewall and, if possible, check what the peer is actually receiving (`show ip bgp neighbor routes` on Cisco, or equivalent). Don't assume your changes had the desired effect without verification.

PCNSE Exam Focus: BGP Redistribution Tips & Tricks

Here are key takeaways and potential exam pitfalls related to PAN-OS BGP Redistribution:

Remember: **P**riority **F**irst, **F**ilter **S**econd, **A**ttributes **T**hird! (Check Profile **P**riority -> Check **F**ilter Match -> Apply **A**ction & **A**ttributes)

PCNSE Style Quiz: BGP Redistribution

Test your knowledge with these 20 questions covering PAN-OS BGP redistribution concepts.

1. Where in the PAN-OS GUI are BGP Redistribution Profiles configured?

2. A PAN-OS firewall has two Redistribution Profiles. Profile A has priority 50 and action 'no-redist'. Profile B has priority 100 and action 'redist'. Both profiles match the static route 10.1.1.0/24. What happens to this route?

3. What is the primary purpose of setting the MED (Multi-Exit Discriminator) attribute during redistribution?

4. If a route exists in the firewall's routing table but does NOT match any configured Redistribution Profile within the Virtual Router, what happens?

5. Which BGP attribute is typically used to make a path less desirable to ALL BGP peers by artificially increasing its length?

6. When redistributing an OSPF route into BGP, what is the default BGP Origin code typically assigned by many systems (including potentially PAN-OS, though verification is needed)?

7. Which filtering component within a Redistribution Profile specifies the source protocol or type, such as Static, OSPF Intra-Area, or Connected?

8. You want to ensure that internal RFC1918 addresses (e.g., 10.0.0.0/8) learned via OSPF are NEVER advertised to your external BGP peers. What is the BEST approach using Redistribution Profiles?

9. Which BGP attribute influences outbound path selection within your own AS and is typically set using BGP *Import* policies on learned routes?

10. What does the BGP community 'no-export' typically signal to a BGP peer?

11. Which CLI command helps verify the routes that a specific Redistribution Profile has potentially matched and marked for redistribution?

12. To apply different BGP attributes (like MED) to the *same* redistributed prefix when advertising it to *different* eBGP peers, which PAN-OS feature is typically required in addition to the Redistribution Profile?

13. In the BGP Path Selection process, which Origin code is generally preferred over the others?

14. You configure a Redistribution Profile to redistribute a static route 198.51.100.0/24. You commit the change, but the route is not advertised to your BGP peer. What is a likely first troubleshooting step?

15. What does setting the "Address Based Filter" Match Type to `Exact` in a Redistribution Profile achieve?

16. Redistributing routes from which source type requires specifying sub-types like Intra-Area, Inter-Area, Ext-1, or Ext-2 within the Redistribution Profile filter?

17. Which CLI command is essential for verifying exactly which routes were successfully advertised to a specific BGP neighbor after redistribution and export policies were applied?

18. You are redistributing connected routes into BGP. Which specific setting within the Redistribution Profile allows you to add a BGP community tag to these routes?

19. What is a potential major risk of configuring mutual redistribution (e.g., OSPF into BGP and BGP into OSPF) without extremely careful filtering?

20. When configuring a Redistribution Profile filter using "Address Objects", what type of object should you select or create?