[an error occurred while processing this directive]

Static | Networking | Services | Setups | [an error occurred while processing this directive]


Policy-Based Routing

The purpose of Policy-Based Routing (Source-Based Routing) is to make sure any reply packets to a client are sent from the same interface that received the request which may not be the system default. Thus the client "sees" the response from the IP it sent to rather than some other IP the server could also be configured to have.

The "trick" to this type of routing is based on

  1. When a host is originating a network connection, the outgoing packet's "from address" is assigned after the routing rules have been applied based on the outgoing interface.
  2. When a host is replying to a client (source) connection, the outgoing packet's "from address" is assigned before the routing rules are applied by switching the sender and receiver address lines in the originating packet's header.

A routing rule can be created to use the "from address" setting to redirect the kernel to use a custom routing table; who's only route enty (default) is via the interface that the source connected via.