PBR (Policy-Based Routing)
See also: Routing and PBR basics, Multi-WAN
PBR is a technique used to make routing decisions based on policies set by the network administrator. There are different methods to implement PBR with their own pros and cons, and some methods can be more suitable than others depending on your goal.
Solutions
PBR app
See also: PBR app
PBR app helps overcome routing issues for the following scenarios:
- Utilize split tunneling to route your traffic to VPN/WAN selectively for some of hosts/subnets/domains.
- Implement port forwarding on the WAN interface when traffic is routed to VPN by default.
- Run VPN server and client simultaneously and route traffic to the VPN client.
- Provide web interface to manage routing policies.
PBR with netifd
See also: PBR with netifd
PBR with netifd helps to utilize different routing tables to route traffic to a specific interface based on traffic parameters like ingress/egress interface, source/destination address, firewall mark, etc.:
- Relies on the built-in netifd functionality and requires no extra software installation.
- Suitable for managed and unmanaged interfaces declared in the network configuration.
- Works well with interfaces, subnets, IP addresses and ports, but not domains.
mwan3
See also: mwan3
mwan3 provides load balancing and failover with multiple WAN interfaces.
shunt
See also: shunt
shunt routes traffic to a policy interface by client address, MAC, ingress device, destination, port or domain, independent of the DNS backend:
- Learns domain addresses by passively observing DNS answers on the LAN, so it works with dnsmasq, unbound, AdGuard Home or any other resolver, wildcards included.
- Supports large domain and address lists from files, a per-policy killswitch and transparent proxy targets.
- Runs beside pbr and mwan3 with its own nftables table and disjoint marks, so policies can be migrated one at a time.
- Provides a LuCI based web interface to manage routing policies.
- Provides a pbr2shunt migration tool, see pbr2shunt