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

Les Pritchard les.pritchard at gmail.com
Thu Mar 6 16:17:58 UTC 2014


Sorry, thinking about it I should say if it's a single host you want to
contact that way this is how you should really do it:
route add 222.222.222.222 gw 1.1.1.1

Much simpler


On 6 March 2014 16:15, Les Pritchard <les.pritchard at gmail.com> wrote:

> Have you tried just doing something like this?
>
> route add -net 222.222.222.222 netmask 255.255.255.255 gw 1.1.1.1
> If you're going for a whole range of IPs via there, you'd just need to
> alter the subnet mask
>
> If that works then you'll just need to add it to your interfaces file
> prefixing it with 'post-up'
>
>
> On 6 March 2014 16:12, Ben Arnold <BenArnold at fsfe.org> wrote:
>
>> Afternoon Les,
>>
>>
>> On 6 March 2014 15:35, you wrote:
>>
>>> 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?
>>>
>>
>> Yes, 1.1.1.1 is only available through the wlan0.
>>
>> I should probably mention that the first command fails; "No such process"
>> it complains when adding a second gateway and specifying an interface,
>> which I believe is because the "via 1.1.1.1" doesn't know *how* to go via
>> that IP.
>>
>>
>> Cheers,
>> Ben
>>
>> --
>> *Ben Arnold*
>> *Liverpool, UK*
>>
>> *Free Software Foundation (Europe)*
>> *e: benarnold at fsfe.org <http://fsfe.org>  |  **ben at
>> seawolfsanctuary.com <http://seawolfsanctuary.com>*
>> *w: seawolfsanctuary.com <http://seawolfsanctuary.com>  |  chat:
>> benarnold at jabber.fsfe.org <http://jabber.fsfe.org>*
>>
>> _______________________________________________
>> 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/ae3a128f/attachment.html>


More information about the Chester mailing list