title: How do I correctly use named tables with 'ip route'
body: <p>I'm using this on my server to route any traffic to certain ip over a specific interface</p>
  
  <pre><code>ip route add 80.100.141.27/32 via 167.99.208.1 dev eth0 src 10.18.0.10
  </code></pre>
  
  <p>This works great, traffic to 80.100.141.27 will go over 10.18.0.10</p>
  
  <p>Now to organise these rules I'm thinking I could use named tables.</p>
  
  <p>First I create a new table called 'table-name'</p>
  
  <pre><code>    - name: create named ip route table
        lineinfile:
          path: /etc/iproute2/rt_tables
          line: '200 table-name'
          create: yes
        tags: ip_route
  </code></pre>
  
  <p>Then I can add rules as follows</p>
  
  <pre><code>ip route add table table-name 80.100.141.27/32 via 167.99.208.1 dev eth0 src 10.18.0.10
  </code></pre>
  
  <p>Rules are now added to this table</p>
  
  <pre><code>ip route show table table-name
  </code></pre>
  
  <p>However the rules are not active. Traffic does not go over the specified route.</p>