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

_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to