policy routing
also: PBR, policy-based routing, source-based routing
A networking feature that directs packets to different routes based on rules other than just the destination IP address, such as source IP, protocol, or port.
Policy routing allows administrators to make routing decisions based on multiple criteria beyond the standard destination-based lookup. Instead of using only the destination address to choose a route, policy routing evaluates rules that can match source IP, destination IP, protocol type, port numbers, and other packet attributes.
In Linux, policy routing is implemented through the ip rule and ip route commands. Rules are processed in order, and matching packets are directed to specific routing tables. For example, you could configure all traffic from a specific subnet to use a particular gateway, or route packets from one department through a different ISP connection than packets from another department.
A practical example: ip rule add from 192.168.1.0/24 table 100 directs all packets from that subnet to use routing table 100, which may have different routes than the main table. This is commonly used in multi-homed systems, load balancing, and traffic engineering.