<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Policy-Based-Routing on vlan51</title><link>https://vlan51.com/tags/policy-based-routing/</link><description>Recent content in Policy-Based-Routing on vlan51</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Mon, 01 Jan 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://vlan51.com/tags/policy-based-routing/index.xml" rel="self" type="application/rss+xml"/><item><title>Policy Based Routing (PBR) on HPE Aruba ArubaOS-Switch</title><link>https://vlan51.com/aruba-provision/policy-based-routing/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://vlan51.com/aruba-provision/policy-based-routing/</guid><description>&lt;p&gt;How to configure Policy Based Routing (PBR) on HPE Aruba ArubaOS-Switch. Applies to the 3800, 5400zl v2, and 8200 series. PBR can only be applied &lt;strong&gt;inbound&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;Three components: a &lt;strong&gt;class&lt;/strong&gt; to match traffic, a &lt;strong&gt;policy&lt;/strong&gt; to define the action, and a &lt;strong&gt;VLAN/port&lt;/strong&gt; to apply it.&lt;/p&gt;&#10;&lt;h2 id="scenario"&gt;Scenario &lt;a class="anchor" href="#scenario" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Traffic from &lt;code&gt;192.168.10.0/24&lt;/code&gt; to &lt;code&gt;10.0.0.0/24&lt;/code&gt; uses gateway &lt;code&gt;2.2.2.1&lt;/code&gt;. All other traffic uses &lt;code&gt;1.1.1.1&lt;/code&gt;.&lt;/p&gt;&#10;&lt;figure&gt;&#10; &lt;a href="https://vlan51.com/images/provision-pbr-topology.png" target="_blank" rel="noopener"&gt;&lt;img src="https://vlan51.com/images/provision-pbr-topology.png" alt="PBR topology — local and internet breakout" loading="lazy" decoding="async"&gt;&lt;/a&gt;&lt;figcaption&gt;PBR topology — local and internet breakout&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&lt;h2 id="class-configuration"&gt;Class configuration &lt;a class="anchor" href="#class-configuration" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="code"&gt;&#10; &lt;div class="code-bar"&gt;&lt;span&gt;cli&lt;/span&gt;&lt;button class="copy" type="button" aria-label="Copy to clipboard"&gt;Copy&lt;/button&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;class ipv4 &amp;#34;CLASS-192.168-LOCAL-BREAKOUT&amp;#34;&#10; 5 match ip 192.168.10.0 0.0.0.255 10.0.0.0 0.0.0.255&#10; exit&#10;&#10;class ipv4 &amp;#34;CLASS-192.168-INTERNET-BREAKOUT&amp;#34;&#10; 5 match ip 192.168.10.0 0.0.0.255 0.0.0.0 255.255.255.255&#10; exit&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;h2 id="policy-configuration"&gt;Policy configuration &lt;a class="anchor" href="#policy-configuration" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="code"&gt;&#10; &lt;div class="code-bar"&gt;&lt;span&gt;cli&lt;/span&gt;&lt;button class="copy" type="button" aria-label="Copy to clipboard"&gt;Copy&lt;/button&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;policy pbr &amp;#34;POLICY-INTERNET-BREAKOUT&amp;#34;&#10; 5 class ipv4 &amp;#34;CLASS-192.168-LOCAL-BREAKOUT&amp;#34;&#10; action ip next-hop 2.2.2.1&#10; exit&#10; 6 class ipv4 &amp;#34;CLASS-192.168-INTERNET-BREAKOUT&amp;#34;&#10; action ip next-hop 1.1.1.1&#10; exit&#10; exit&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;h2 id="apply-to-vlan-interface"&gt;Apply to VLAN interface &lt;a class="anchor" href="#apply-to-vlan-interface" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="code"&gt;&#10; &lt;div class="code-bar"&gt;&lt;span&gt;cli&lt;/span&gt;&lt;button class="copy" type="button" aria-label="Copy to clipboard"&gt;Copy&lt;/button&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;vlan 10&#10; name &amp;#34;192.168.10.0-VLAN&amp;#34;&#10; ip address 192.168.10.254 255.255.255.0&#10; service-policy &amp;#34;POLICY-INTERNET-BREAKOUT&amp;#34; in&#10; exit&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;h2 id="important-locally-connected-networks"&gt;Important: locally connected networks &lt;a class="anchor" href="#important-locally-connected-networks" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;If other VLANs are on the same switch, PBR will break inter-VLAN routing because it overrides the routing table for matched traffic. Fix this by pointing the local class next-hop at &lt;strong&gt;the switch&amp;rsquo;s own IP&lt;/strong&gt;:&lt;/p&gt;</description></item><item><title>Policy Based Routing (PBR) on HPE Comware v7</title><link>https://vlan51.com/comware-v7/policy-based-routing/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://vlan51.com/comware-v7/policy-based-routing/</guid><description>&lt;p&gt;How to configure Policy Based Routing (PBR) on HPE Comware v7. Traffic is matched by ACLs and redirected to an alternative next-hop, overriding the routing table.&lt;/p&gt;&#10;&lt;h2 id="scenario"&gt;Scenario &lt;a class="anchor" href="#scenario" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The setup is identical to the &lt;a href="https://vlan51.com/aruba-provision/policy-based-routing/"&gt;ArubaOS-Switch PBR guide&lt;/a&gt;. The switch (&lt;code&gt;.254&lt;/code&gt;) has a default gateway of &lt;code&gt;2.2.2.1&lt;/code&gt;.&lt;/p&gt;&#10;&lt;figure&gt;&#10; &lt;a href="https://vlan51.com/images/provision-pbr-topology.png" target="_blank" rel="noopener"&gt;&lt;img src="https://vlan51.com/images/provision-pbr-topology.png" alt="PBR topology: local breakout via the default gateway, internet via the firewall at 1.1.1.1" loading="lazy" decoding="async"&gt;&lt;/a&gt;&lt;figcaption&gt;PBR topology: local breakout via the default gateway, internet via the firewall at 1.1.1.1&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&lt;p&gt;From &lt;code&gt;192.168.10.0/24&lt;/code&gt;: internal traffic (to &lt;code&gt;10.0.0.0/8&lt;/code&gt; or &lt;code&gt;192.168.0.0/16&lt;/code&gt;) uses the normal routing table, internet traffic is sent to &lt;code&gt;1.1.1.1&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Policy Based Routing Within a VRF/VPN-Instance on HPE Comware v7</title><link>https://vlan51.com/comware-v7/policy-based-routing-vrf/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://vlan51.com/comware-v7/policy-based-routing-vrf/</guid><description>&lt;p&gt;How to configure PBR within a VRF/VPN-Instance on HPE Comware v7. Useful in multi-tenant environments where traffic must be steered within an isolated routing domain.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;PBR within a VRF is only supported on Comware v7 — not Comware v5.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Only a few changes are needed compared with &lt;a href="https://vlan51.com/comware-v7/policy-based-routing/"&gt;PBR outside a VRF&lt;/a&gt;: the VPN-Instance has to be referenced in the next-hop and in the ACL rules. A VPN-Instance is Comware&amp;rsquo;s name for a VRF.&lt;/p&gt;</description></item></channel></rss>