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

Les Pritchard les.pritchard at gmail.com
Thu Mar 6 15:35:50 UTC 2014


Hi Ben,

Would the gateway of 1.1.1.1 only be available via your wlan? If you added
a static route for the destination IP as going via 1.1.1.1 that it should
take that route when your wifi is connected. The only issue is that when
you don't have your wifi connected it may route to your destination IP via
the eth, would that be an issue?

Les


On 6 March 2014 14:25, Ben Arnold <BenArnold at fsfe.org> wrote:

> 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
>
> _______________________________________________
> Chester mailing list
> Chester at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/chester
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/chester/attachments/20140306/61f12c62/attachment.html>


More information about the Chester mailing list