title: How to monitor routing decision on a linux router
body: <p>I have a linux server that realizes the routing between my local network and my two Internet connections (on 2 physical network cards).</p>
  
  <p>I have configured my server : </p>
  
  <p>1) With iptables, I use PREROUTING rules on the table mangle to mark packets from my local area:</p>
  
  <ul>
  <li>If no mark, routing use the default table</li>
  <li>If mark = x0001, routing use the specific table x0001</li>
  </ul>
  
  <p>2) With iptables, I use FORWARD rules on the table filter to forward trafic from my local area to the internet cards </p>
  
  <p>3) With "ip route" command, I constuct two tables of routing with different gateway</p>
  
  <p>This configuration works perfectly since many months. </p>
  
  <p>Today, I have a user who switches alternately of internet connections. 
  I have logged the PREROUTING rules on iptables and I see that packets from this user, are already marked x0001 regardless of situations. </p>
  
  <p>My conclusion : this packets should be used the same routing table so the same gateway and I think there is error during the routing decision</p>
  
  <p>How can I monitor the routing decision ? 
  What is the process that takes this routing decision ? Is it iptables ? </p>
  
  <p>Thanks for your help. </p>