Difference between revisions of "Policy Based Routing"
(49 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
==Introduction== | ==Introduction== | ||
---- | ---- | ||
− | Policy-based routing (PBR) is a technique used in computer networking to direct network packets based on defined criteria beyond the standard destination-based routing. Unlike traditional routing, which forwards packets solely based on their destination address, PBR allows | + | Policy-based routing (PBR) is a technique used in computer networking to direct network packets based on defined criteria beyond the standard destination-based routing. Unlike traditional routing, which forwards packets solely based on their destination address, PBR allows to customize routing decisions according to various factors. |
− | With policy-based routing | + | With policy-based routing can implement specific rules or policies to dictate the path that packets should take through the network. This flexibility enables organizations to optimize traffic flow, prioritize certain types of traffic, enforce security measures, and manage network resources more efficiently. |
==Prerequisites & Topology== | ==Prerequisites & Topology== | ||
Line 13: | Line 13: | ||
'''Before proceeding with the confuration, ensure that all requirements are met:''' | '''Before proceeding with the confuration, ensure that all requirements are met:''' | ||
− | # Before starting you need to have 3 different WAN connections. In this case we are going to use: '''Wi-fi WAN''', '''Wired WAN''' and '''Mobile WAN'''. | + | # Before starting you need to have 3 different WAN connections. In this case we are going to use: '''Wi-fi WAN''', '''Wired WAN''' and '''Mobile WAN'''.These interfaces have to be preconfigured. |
− | [[File: | + | [[File:PBR_MAIN_IMG.png|border|class=tlt-border|center]] |
==Configuration== | ==Configuration== | ||
Line 28: | Line 28: | ||
====Port based VLAN==== | ====Port based VLAN==== | ||
---- | ---- | ||
− | Add new VLANs by clicking [[File:Add Button.png| | + | Add new VLANs by clicking [[File:Add Button.png|40x70px]] and Make following changes: |
# VLAN ID: '''1''' | lan1: '''Untagged''' | Lan2: '''Off''' | Lan3: '''Off''' | lan4: '''Untagged''' | Wan: '''Off''' | # VLAN ID: '''1''' | lan1: '''Untagged''' | Lan2: '''Off''' | Lan3: '''Off''' | lan4: '''Untagged''' | Wan: '''Off''' | ||
Line 35: | Line 35: | ||
− | [[File:PBR_VLAN.png|border|class=tlt-border|center| | + | [[File:PBR_VLAN.png|border|class=tlt-border|center|1000x243px]] |
===Configuring Different LAN Networks=== | ===Configuring Different LAN Networks=== | ||
---- | ---- | ||
− | ==== | + | Open router’s '''WebUI → Network → LAN''' click [[File:Pencil2.png]]on current available LAN interface configuration: |
+ | |||
+ | ====LAN1 General Settings==== | ||
+ | ---- | ||
+ | Make the following changes: | ||
+ | # Enter Name : '''LAN_VLAN_ETH0''' | ||
+ | [[File:PBS LAN1 NAME.png|border|class=tlt-border|center]] | ||
+ | |||
+ | ====LAN1 Physical Settings==== | ||
+ | ---- | ||
+ | Make the following changes: | ||
+ | # Select Interface : '''eth0''' | ||
+ | [[File:PBS LAN1 PHYSICAL.png|border|class=tlt-border|center]] | ||
+ | ---- | ||
+ | |||
+ | Add new LAN netwrok by clicking [[File:Add Button.png|40x70px]] and Make following changes: | ||
+ | |||
+ | ====LAN2 General Settings==== | ||
+ | ---- | ||
+ | Make the following changes: | ||
+ | # Enable Interface: '''on''' | ||
+ | # Enter Name : '''LAN_VLAN_3''' | ||
+ | # Enter IPV4 address: '''192.168.3.1''' | ||
+ | # Select IPV4 netmask: '''255.255.255.0''' | ||
+ | # Enable DHCPv4: '''on''' | ||
+ | [[File:PBS LAN3 GENERAL.png|border|class=tlt-border|center]] | ||
+ | ====LAN2 Physical Settings==== | ||
+ | ---- | ||
+ | Make the following changes: | ||
+ | # Select Interface : '''eth0.3''' | ||
+ | |||
+ | [[File:PBS LAN3 PHYSICAL.png|border|class=tlt-border|center]] | ||
+ | ---- | ||
+ | |||
+ | Add new LAN netwrok by clicking [[File:Add Button.png|40x70px]] and Make following changes: | ||
+ | |||
+ | ====LAN3 General Settings==== | ||
+ | ---- | ||
+ | Make the following changes: | ||
+ | # Enable Interface: '''on''' | ||
+ | # Enter Name : '''LAN_VLAN_5''' | ||
+ | # Enter IPV4 address: '''192.168.5.1''' | ||
+ | # Select IPV4 netmask: '''255.255.255.0''' | ||
+ | # Enable DHCPv4: '''on''' | ||
+ | [[File:PBS LAN5 GENERAL.png|border|class=tlt-border|center]] | ||
+ | ====LAN3 Physical Settings==== | ||
---- | ---- | ||
+ | Make the following changes: | ||
+ | # Select Interface : '''eth0.5''' | ||
+ | [[File:PBS LAN5 PHYSICAL.png|border|class=tlt-border|center]] | ||
+ | |||
+ | After configuring all LAN interfaces the end result should look something like this: | ||
+ | [[File:PBS LAN_CON.png|border|class=tlt-border|center| 1000x400px]] | ||
− | ===Configuring | + | ===Configuring Policy Based Routing=== |
+ | ---- | ||
+ | Open WebUI → Network → Routing → Policy based routing → Add new instance and create new instances for each available WAN in this case Wi-Fi WAN, Wired-WAN and Mobile: | ||
+ | |||
+ | ====Creating Wifi Wan Routing Table==== | ||
+ | ---- | ||
+ | Add new instance: | ||
+ | # Enter ID: '''1''' | ||
+ | # Enter New configuration name: '''WifiWan''' | ||
+ | [[File:PBR IMAGE WIFI.png|border|class=tlt-border|center|1000x300px]] | ||
+ | click [[File:Add Button.png|40x70px]] in the new window make following changes: | ||
+ | |||
+ | =====Static IPv4 Routes===== | ||
+ | ---- | ||
+ | click [[File:Add Button.png|40x70px]] and aplly this to the route: | ||
+ | #Select Interface: '''WifiWan''' | Enter Target: ''''0.0.0.0''' | Enter IPv4-Netmask: '''0.0.0.0''' | Enter IPv4-Gateway: '''192.168.100.1''' | ||
+ | [[File:PBR_P_ROUTE_1.png|border|class=tlt-border|center|1000x300px]] | ||
+ | |||
+ | ====Creating Wired Wan Routing Table==== | ||
+ | ---- | ||
+ | Add new instance: | ||
+ | # Enter ID: '''3''' | ||
+ | # Enter New configuration name: '''WiredWan''' | ||
+ | [[File:PBS_WAN_ROUTE1.png|border|class=tlt-border|center|1000x300px]] | ||
+ | click [[File:Add Button.png|40x70px]] in the new window make following changes: | ||
+ | =====Static IPv4 Routes===== | ||
+ | ---- | ||
+ | click [[File:Add Button.png|40x70px]] and aplly this to the route: | ||
+ | #Select Interface: '''wan''' | Enter Target: ''''0.0.0.0''' | Enter IPv4-Netmask: '''0.0.0.0''' | Enter IPv4-Gateway: '''192.168.3.1''' | ||
+ | [[File:PBR_P_ROUTE_2.png|border|class=tlt-border|center|1000x300px]] | ||
+ | |||
+ | ====Creating Mobile Wan Routing Table==== | ||
+ | ---- | ||
+ | |||
+ | Add new instance: | ||
+ | # Enter ID: '''5''' | ||
+ | # Enter New configuration name: '''MwWan''' | ||
+ | [[File:PBR_MOBILE_1.png|border|class=tlt-border|center|1000x300px]] | ||
+ | |||
+ | click [[File:Add Button.png|40x70px]] in the new window make following changes: | ||
+ | =====Static IPv4 Routes===== | ||
+ | |||
+ | ---- | ||
+ | click [[File:Add Button.png|40x70px]] and aplly this to the route: | ||
+ | #Select Interface:'''mob1s1a1''' | Enter Target: ''''0.0.0.0''' | Enter IPv4-Netmask: '''0.0.0.0''' | ||
+ | [[File:PBS_TABLES_WAN.png|border|class=tlt-border|center|1000x300px]] | ||
+ | ====Creating Routing Rules for IPv4==== | ||
+ | ---- | ||
+ | =====Routing Rules for IPv4===== | ||
+ | ---- | ||
+ | By clicking [[File:Add Button.png|40x70px]] create 3 rules under '''Routing Rules for IPv4''' tab apply these changes to the rules: | ||
+ | ======Policy Rule 1====== | ||
+ | ---- | ||
+ | # Enter Priority: '''1''' | ||
+ | # Select Incoming interface: '''LAN_VLAN_ETH0''' | ||
+ | # Select Outgoing interface: '''None''' | ||
+ | # Select Matched Traffic Action: '''Lookup Table''' | ||
+ | # Lookup Table: '''WifiWAN(1)''' | ||
+ | |||
+ | [[File:POLICY_RULE_11.png|border|class=tlt-border|center]] | ||
+ | |||
+ | ======Policy Rule 2====== | ||
+ | ----- | ||
+ | # Enter Priority: '''1''' | ||
+ | # Select Incoming interface: '''LAN_VLAN_3''' | ||
+ | # Select Outgoing interface: '''None''' | ||
+ | # Select Matched Traffic Action: '''Lookup Table''' | ||
+ | # Lookup Table: '''WiredWan(3)''' | ||
+ | [[File:POLICY_RULE_2.png|border|class=tlt-border|center]] | ||
+ | ======Policy Rule 3====== | ||
+ | ---- | ||
+ | # Enter Priority: '''1''' | ||
+ | # Select Incoming interface: '''LAN_VLAN_5''' | ||
+ | # Select Outgoing interface: '''None''' | ||
+ | # Select Matched Traffic Action: '''Lookup Table''' | ||
+ | # Lookup Table: '''MWan(5)''' | ||
+ | [[File:POLICY_RULE_3.png|border|class=tlt-border|center]] | ||
+ | |||
+ | '''NOTE: Delete all Autimatic or unrelated routing rules''' | ||
+ | |||
+ | ===Configuration testing=== | ||
+ | ---- | ||
+ | |||
+ | Connect end device to physical port that is assingned to different routing policy. Open cmd and run this command: '''traceroute 8.8.8.8''', three physical ports that we assigned to diffrent Vlans route to 8.8.8.8 should be dispayed using different gateways. | ||
+ | |||
+ | |||
+ | ====LAN1 Test Result==== | ||
+ | ---- | ||
+ | ====LAN2 Test Result==== | ||
+ | ---- | ||
+ | ====LAN3 Test Result==== | ||
---- | ---- |
Revision as of 15:24, 21 June 2024
The information on this page is updated in accordance with the 00.07.07.1 firmware version .
Introduction
Policy-based routing (PBR) is a technique used in computer networking to direct network packets based on defined criteria beyond the standard destination-based routing. Unlike traditional routing, which forwards packets solely based on their destination address, PBR allows to customize routing decisions according to various factors.
With policy-based routing can implement specific rules or policies to dictate the path that packets should take through the network. This flexibility enables organizations to optimize traffic flow, prioritize certain types of traffic, enforce security measures, and manage network resources more efficiently.
Prerequisites & Topology
Before proceeding with the confuration, ensure that all requirements are met:
- Before starting you need to have 3 different WAN connections. In this case we are going to use: Wi-fi WAN, Wired WAN and Mobile WAN.These interfaces have to be preconfigured.
Configuration
If you're having trouble finding this page or some of the parameters described here on your device's WebUI, you should turn on "Advanced WebUI" mode. You can do that by clicking the "Advanced" button, located at the top of the WebUI.
Configuring VLANs
Open router‘s WebUI and navigate to Network → VLAN → Port Based configuration:
Port based VLAN
Add new VLANs by clicking and Make following changes:
- VLAN ID: 1 | lan1: Untagged | Lan2: Off | Lan3: Off | lan4: Untagged | Wan: Off
- VLAN ID: 3 | lan1: Off | Lan2: Untagged | Lan3: Off | lan4: Off | Wan: Off
- VLAN ID: 5 | lan1: Off | Lan2: Off | Lan3: Untagged | lan4: Off | Wan: Off
Configuring Different LAN Networks
Open router’s WebUI → Network → LAN click on current available LAN interface configuration:
LAN1 General Settings
Make the following changes:
- Enter Name : LAN_VLAN_ETH0
LAN1 Physical Settings
Make the following changes:
- Select Interface : eth0
Add new LAN netwrok by clicking and Make following changes:
LAN2 General Settings
Make the following changes:
- Enable Interface: on
- Enter Name : LAN_VLAN_3
- Enter IPV4 address: 192.168.3.1
- Select IPV4 netmask: 255.255.255.0
- Enable DHCPv4: on
LAN2 Physical Settings
Make the following changes:
- Select Interface : eth0.3
Add new LAN netwrok by clicking and Make following changes:
LAN3 General Settings
Make the following changes:
- Enable Interface: on
- Enter Name : LAN_VLAN_5
- Enter IPV4 address: 192.168.5.1
- Select IPV4 netmask: 255.255.255.0
- Enable DHCPv4: on
LAN3 Physical Settings
Make the following changes:
- Select Interface : eth0.5
After configuring all LAN interfaces the end result should look something like this:
Configuring Policy Based Routing
Open WebUI → Network → Routing → Policy based routing → Add new instance and create new instances for each available WAN in this case Wi-Fi WAN, Wired-WAN and Mobile:
Creating Wifi Wan Routing Table
Add new instance:
- Enter ID: 1
- Enter New configuration name: WifiWan
click in the new window make following changes:
Static IPv4 Routes
click and aplly this to the route:
- Select Interface: WifiWan | Enter Target: '0.0.0.0 | Enter IPv4-Netmask: 0.0.0.0 | Enter IPv4-Gateway: 192.168.100.1
Creating Wired Wan Routing Table
Add new instance:
- Enter ID: 3
- Enter New configuration name: WiredWan
click in the new window make following changes:
Static IPv4 Routes
click and aplly this to the route:
- Select Interface: wan | Enter Target: '0.0.0.0 | Enter IPv4-Netmask: 0.0.0.0 | Enter IPv4-Gateway: 192.168.3.1
Creating Mobile Wan Routing Table
Add new instance:
- Enter ID: 5
- Enter New configuration name: MwWan
click in the new window make following changes:
Static IPv4 Routes
click and aplly this to the route:
- Select Interface:mob1s1a1 | Enter Target: '0.0.0.0 | Enter IPv4-Netmask: 0.0.0.0
Creating Routing Rules for IPv4
Routing Rules for IPv4
By clicking create 3 rules under Routing Rules for IPv4 tab apply these changes to the rules:
Policy Rule 1
- Enter Priority: 1
- Select Incoming interface: LAN_VLAN_ETH0
- Select Outgoing interface: None
- Select Matched Traffic Action: Lookup Table
- Lookup Table: WifiWAN(1)
Policy Rule 2
- Enter Priority: 1
- Select Incoming interface: LAN_VLAN_3
- Select Outgoing interface: None
- Select Matched Traffic Action: Lookup Table
- Lookup Table: WiredWan(3)
Policy Rule 3
- Enter Priority: 1
- Select Incoming interface: LAN_VLAN_5
- Select Outgoing interface: None
- Select Matched Traffic Action: Lookup Table
- Lookup Table: MWan(5)
NOTE: Delete all Autimatic or unrelated routing rules
Configuration testing
Connect end device to physical port that is assingned to different routing policy. Open cmd and run this command: traceroute 8.8.8.8, three physical ports that we assigned to diffrent Vlans route to 8.8.8.8 should be dispayed using different gateways.