lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Using multiple IP addresses on one interface


From: Patrick Klos
Subject: Re: [lwip-users] Using multiple IP addresses on one interface
Date: Mon, 4 Jan 2016 12:45:42 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 1/4/2016 10:25 AM, John Pote wrote:

Hello all,

 

I am new to LWIP and working on extending some legacy code using the LWIP stack. It would be useful now if we could have a number of IP addresses on the one network interface.

I found the thread “LWIP and second IP feasible?” dated 5 Mar 2011 (http://lists.nongnu.org/archive/html/lwip-users/2011-03/msg00024.html)  which indicates it is possible with some effort.

My situation is perhaps a little simpler in that consecutive, statically allocated IP addresses will be used. So I wondered if a single IP address could be assigned to the IP stack with an appropriate subnet mask. EG

IP            192.168.1.16

Mask     255.255.255.252

The subnet would then consist of the 4 addresses 192.168.1.16/17/18/19.

 

Would the rest of LWIP stack manage the above arrangement correctly? I will need to open a listening socket on each IP address.

 

Any thoughts and help appreciated,


Hello John,

You'll clearly have to tweak any code that checks local IP address(es).  I'm pretty sure they're all expecting a single IP address (not an address and mask).  I'm sure it's not a huge task. 

As was suggested in the thread you mentioned, another approach might be to create alternate ethernet interfaces, one for each IP address, so the rest of the code (hopefully) doesn't have to know or care?  There still may be some tweaking to make it all seamless, but it doesn't sound very difficult.

What platform are you using LwIP on?

Patrick Klos
Laufer Wind


reply via email to

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