Re: [Nolug] http (or any) request via secondary nic

From: Petri Laihonen <pietu_at_weblizards.net>
Date: Wed, 26 May 2010 19:25:51 -0500
Message-ID: <AANLkTinHp-BFezaUBC3VaGFnV8U3KxU3JFZkNaWVXCJa@mail.gmail.com>

Hmm... OK I'm starting to see the method....

And if I try to address by domain name, I need to find out first what is the
IP for that domain and route that via eth1 (or in this case xenbr2)

P

On Wed, May 26, 2010 at 9:44 AM, -ray <ray@ops.selu.edu> wrote:

>
> Agreed, this seems to be a routing issue. If you can get to
> 192.168.2.0/24 through eth1, then just add the static route the Jerry
> mentioned. Since all apps use the routing table, then everything should
> "just work". Just make sure the response isn't coming back in through
> eth0...that could get to be a pain.
>
> ray
>
>
>
> On Tue, 25 May 2010, Jerry Wilborn wrote:
>
> What does your routing table look like? If it's local, it should be as
>> simple as route add -net 192.168.2.0/24 dev eth1.
>>
>> Jerry Wilborn
>> jerrywilborn@gmail.com
>>
>>
>> On Tue, May 25, 2010 at 9:38 PM, Petri Laihonen <pietu@weblizards.net
>> >wrote:
>>
>> Actually I'm looking a way to direct a traffic (requests and responses)
>>> via
>>> different NIC.
>>>
>>> For instance, if I run "ping", by default it wants to use the primary NIC
>>> (eth0). Therefore by pinging the IP address over the crossover cable
>>> (private net) there are no results because it was not found. If I specify
>>> the interface eth1 for the ping, then the IP address responds.
>>>
>>> for example:
>>> ping 192.168.2.251 (results nothing)
>>> ping -I eth1 192.168.2.251 (responses are as expected)
>>>
>>> But instead of ping, I would like to be able to do this with pretty much
>>> any process I see fit.
>>>
>>> This is easy with the applications which support defining the network
>>> interface such as ping and curl, but any other programs, what methods
>>> would
>>> there be available. I suspect iptables could be the one, but exactly
>>> how.....
>>>
>>>
>>> P
>>>
>>>
>>>
>>> On Tue, May 25, 2010 at 9:23 PM, Charles Paul <charles.paul@gmail.com
>>> >wrote:
>>>
>>> If Petri is looking to route packets based on the destination port,
>>>> say port 80 traffic through gw2 and the rest through gw1, he should
>>>> follow the instructions on this FAQ:
>>>>
>>>> http://www.linuxhorizon.ro/iproute2.html
>>>>
>>>>
>>>>
>>>> On 5/25/10, Jerry Wilborn <jerrywilborn@gmail.com> wrote:
>>>>
>>>>> iptables -t nat -A POSTROUTING -o eth0 -d 1.1.1.1 -j SNAT --to-source
>>>>> 2.2.2.2
>>>>>
>>>>>
>>>>> This will source traffic destined for 1.1.1.1 with a source of 2.2.2.2.
>>>>> Paint to match, etc.
>>>>>
>>>>> If you're using a program like 'curl' then you can use a switch like
>>>>> '--interface'.
>>>>>
>>>>> Jerry Wilborn
>>>>> jerrywilborn@gmail.com
>>>>>
>>>>>
>>>>> On Tue, May 25, 2010 at 6:25 PM, Petri Laihonen <pietu@weblizards.net
>>>>> wrote:
>>>>>
>>>>> Hey,
>>>>>>
>>>>>> Is it possible to direct a process on the server to use eth1 instead
>>>>>> of
>>>>>> eth0 for outgoing request?
>>>>>>
>>>>>> For instance, one can request PING command to use specified interface.
>>>>>>
>>>>> How
>>>>
>>>>> about links (or Lynx), or cli script etc...
>>>>>>
>>>>>> If this does not work in the application level, how about some sort of
>>>>>> rule
>>>>>> in the firewall, which would direct a request for
>>>>>> http://exampledomain.tldvia eth1 instead of default eth0?
>>>>>>
>>>>>> Petri
>>>>>>
>>>>>>
>>>>> ___________________
>>>> Nolug mailing list
>>>> nolug@nolug.org
>>>>
>>>>
>>>
>>>
>>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Ray DeJean http://www.r-a-y.org
> Systems Engineer Southeastern Louisiana University
> IBM Certified Specialist AIX Administration, AIX Support
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> ___________________
> Nolug mailing list
> nolug@nolug.org
>

___________________
Nolug mailing list
nolug@nolug.org
Received on 05/26/10

This archive was generated by hypermail 2.2.0 : 05/27/10 EDT