title: Route traffic through different interfaces - Osx
body: <p>I'm trying to add a static route to my OsX Maverick system in order to route specific traffic addressed to a specific device through the LAN device rather than the WiFi one.</p>
  
  <p>The device is inside my LAN, but given that it's a NAS I'd prefer to route traffic using the cable connection to gain maximum speed.</p>
  
  <p>Unfortunately I've the need to maintain the two connections alive, I can't turn off the WiFi.</p>
  
  <p>This is my <code>netestat -rn</code> output:</p>
  
  <pre><code>Internet:
  Destination        Gateway            Flags        Refs      Use   Netif Expire
  default            192.168.20.1       UGSc          316        0     en1
  default            192.168.20.1       UGScI           2        0     en0
  default            link#7             UCSI            1        0   vlan0
  127                127.0.0.1          UCS             0        0     lo0
  127.0.0.1          127.0.0.1          UH             12     1152     lo0
  169.254            link#5             UCS             1        0     en1
  169.254.223.23     127.0.0.1          UHS             1        2     lo0
  169.254.255.255    link#5             UHRLSW          1       77     en1     14
  192.168.20         link#5             UCS             5        0     en1
  192.168.20         link#4             UCSI            2        0     en0
  192.168.20.1       0:17:c5:73:7e:8    UHLWIir         2        5     en0   1144
  192.168.20.1       0:17:c5:73:7e:8    UHLWIir       313       24     en1   1144
  192.168.20.105     0:d0:b8:e:15:34    UHLWI           0      109     en1    633
  192.168.20.109     0:40:8c:a6:74:f8   UHLWI           0       19     en1    561
  192.168.20.113     127.0.0.1          UHS             1       26     lo0
  192.168.20.218     127.0.0.1          UHS             0       17     lo0
  192.168.20.255     ff:ff:ff:ff:ff:ff  UHLWbI          0       48     en1
  239.255.255.250    1:0:5e:7f:ff:fa    UHmLWI          0        2   vlan0
  </code></pre>
  
  <p>My interest is to route the 192.168.26.105 traffic through en0. 
  I've executed the command <code>sudo route -n add 192.168.20.105 -interface en0</code> in order to obtain the desired result. In this case it seems to route correctly packets through <code>en0</code> device, despite when I try to connect it using <code>samba share</code> I cannot get the access.</p>
  
  <p>Under <code>System Preferences -&gt; Network</code> the WiFi device has an higher position in the devices order.</p>
  
  <p>Can I achieve my objectieve without changing the order of the devicese?</p>
  
  <p>Thanks</p>