[Chester LUG] Routing a specific IP through a non-default interface

Ben Arnold BenArnold at fsfe.org
Thu Mar 6 14:25:50 UTC 2014


Hi all,


I have a system with a default Ethernet connection, through which all
network traffic should go -- it'll be an internal-only network -- and is
set-up correctly as any other. I want one specific host (say,
222.222.222.222) through another interface (wlan0, gateway of 1.1.1.1) that
may or may not be up and connected.

I've read that this would be possible by creating a second routing table
for the wifi connection, which has 1.1.1.1 listed as that default gateway
and create a rule that applies the specific IP to that routing table.
Having added "1 wifi" to /etc/iproute2/rt_tables, how can I correct the
following, and are there any other considerations that mean it's not that
simple?

    ip route add default via 1.1.1.1 dev wlan0 table wifi
    ip rule add from 222.222.222.222 table wifi
    ip rule add to 222.222.222.222 table wifi

As I've said before my routing knowledge is as strong as a chocolate
teapot, I really must get reading and some spare kit...


Much obliged,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/chester/attachments/20140306/3ea61f34/attachment.html>


More information about the Chester mailing list