[plug] Dual routes

Matt Kemner zombie at penguincare.com.au
Fri Dec 10 12:26:28 WST 2004


Hi Nigel

> Telstra have put me on their test to see how far they can extend ADSL.
> So while I am finally enjoying a decent Internet connection I would like
> to route certain protocols (ssh,nntp) out over my old dial-up connection
>
> I have installed/ran routed and have the following in my route table;

routed is for propagating (and learning) your routes via RIP. It won't do
what you are trying to achieve.

The simplest way is to add specific routes for your NNTP server, and the
hosts you want to ssh to.

eg: route add news.ii.net gw 203.59.14.16

If you really want to route based on protocol you will need to do policy
routing. Make sure you have support for that in your kernel and then you
can do trickery such as:

# mark all packets outbound to port 22 with FWMARK id "1234"
 iptables -t mangle -A OUTPUT -p tcp --dport 22 -j MARK --set-mark 1234
# Send all packets marked with "1234" to routing table 1
 ip rule add fwmark 1234 table 1
# Add a different default route to routing table 1
 ip route add 0/0 table 1 via 203.59.14.16

I just tested this, and it works for me.

Hope this helps

Regards,

 - Matt




More information about the plug mailing list