Greetings Gabor, : If I have a rule that matches the source address and points to the : proper table. Then how the src addr is selected? I mean, I thought that : the src addr is selected by first determining the outgoing interface. : But for that a routing table must be looked up. So I'm confused. Does : it first checks table main then goes back to check the rules and then : the table pointed at by the matching rule? Routing decisions with RPDB are made as follows: 1. begin with lowest numbered rule in rules 2. if match, check specified routing table (or use rule type) 3. if routing table has route, then that is a termination point 4. if routing table has no route, resume searching in rules (goto 2.) Note also that if the application has not requested that the socket be bound to a particular IP, the linux IP stack will select an address from the src parameter on the route, or the local subnet. More detailed rules for IP address selection are available here [0]. For more discussion on route and source address selection, see also [1], which should still be accurate, though it has not been updated in over a year. -Martin [0] http://linux-ip.net/gl/ip-cref/node155.html [1] http://linux-ip.net/html/routing-selection.html -- Martin A. Brown --- SecurePipe, Inc. --- mabrown@xxxxxxxxxxxxxx - : send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html