Same Web Server, two IP addresses

Using FreeRTOS plus TCP created a simple web server from examples. But what I need is to be able to have the web page simultaneously accessible as two different IP addresses e.g. and Is there an example of:

  1. creating two IP addresses for the same physical Ethernet adapter
  2. connecting each of those to the same web server
    Does this require a second thread, i.e. a mostly copy of net_thread_entry, or can
    the one thread be setup to manage both addresses?

Hi @polarsoft,

FreeRTOS-Plus-TCP is now supporting multiple endpoints (1 endpoint for 1 IP address) in 4.0.0 version. Please feel free to try with our latest tag, which is v4.0.0-rc3.

Take FreeRTOS_Plus_TCP_Echo_Posix as example, you can create multiple endpoints with different IP addresses on same network interface (like here) before calling FreeRTOS_IPInit_Multi(). Then you can have two(or more) IP address on same physical Ethernet adapter.

No, it’s not necessary to have multiple threads to poll same network interface. But it’s necessary to update the NetworkInterface.c to support this, like PR#701 did on each port.

Please let me know if you have any other question.


1 Like

One more good reference is the demo: This demo currently creates multiple IPv4 and IPv6 endpoints.

1 Like