lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Re: Using lwip for writing a minimal HTTP proxy


From: Mandeep Sandhu
Subject: Re: [lwip-users] Re: Using lwip for writing a minimal HTTP proxy
Date: Fri, 25 Sep 2009 15:15:29 +0530

On Fri, Sep 25, 2009 at 1:44 PM, Kieran Mansley <address@hidden> wrote:
> On Fri, 2009-09-25 at 12:04 +0530, Mandeep Sandhu wrote:
>> Oops! I think i'm in a soup on this one!
>>
>> My default interface set to the interface from which the client
>> request is originating. Could this be the reason that the TCP packets,
>> of the new connection (the proxy one), are being routed out of this
>> interface instead of the correct one (the second interface)?!
>>
>> Is there a way I can add a host specific route for the second servers
>> IP. So that the packets get routed properly?
>>
>> I could not find any "route add" function.
>
> Can you show us how you create the two netifs?  They should logically be
> on two different IP subnets, and so the appropriate one for the IP
> address you're connecting to should be used.  If the IP address you're
> connecting to is not in either subnet, then I think it will use the
> default netif and attempt to route via the gateway on that subnet.

The second webserver is on a different network. I can reach it using
my router (which will do NAT).

I too arrived at the same conclusion. Actually the interface through
which the "client" contacts my webserver, is set as "default". I
presume this is the reason that when I try to connect to the "other"
server, the ip_route fxn, picks up the default interface and tried to
send it out of that.

The ECOS ethernet driver sets up the interface as follows:

netif_add()
if (<configured as default>)
        netif_set_default()
netif_set_up()

One way to workaround this is to change the default interface to the
second i/f (the one which connects me to the other server) when it
comes up i.e gets an addr from DHCP.

Do you think it's a good idea to change the def interface at runtime?

My system looks like the followin:

client<---->eth0 my webserver<--->eth1<---->DSL router<---> other
webserver on public internet

I need the first interface(eth0) to be the default one, otherwise the
DHCP server running on it won't work. I'm running my own small DHCP
server on eth0 so that the "client" can get an IP. For certain reasons
I cannot allow the client to directly contact the DSL router.

Thanks for your time.

Regards,
-mandeep


>
> Kieran
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]