Route traffic (smtp) through specific network interface

The problem; need to force connections to the gmail smtp servers through a mobile broadband modem rather than the main system NIC. The solution; use the route command to add a new persistent route to the IP routing tables for your machine;

route -p add mask XXX.XXX.XXX.XXX metric 1 if 14


  • is the gmail smtp server
  • XXX.XXX.XXX.XXX is the default gatway for the connection you want to route the traffic through
  • if 14 is the id of the NIC you want to use

See this article for more details

%d bloggers like this: