# Same Web Server, two IP addresses

**URL:** <https://forums.freertos.org/t/same-web-server-two-ip-addresses/17813>\
**Category:** Libraries\
**Created:** [July 12, 2023, 6:24pm UTC](https://forums.freertos.org/t/same-web-server-two-ip-addresses/17813 "2023-07-12T18:24:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![polarsoft](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@polarsoft](https://forums.freertos.org/u/polarsoft)\
**Post date:** [July 12, 2023, 6:24pm UTC](https://forums.freertos.org/t/same-web-server-two-ip-addresses/17813/1 "2023-07-12T18:24:43Z")

</div>

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. 192.168.1.27 and 192.168.2.55. 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?

---

<div class="post-metadata">

**Author:** ![ActoryOu](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/actoryou/32/2880_2.png) [@ActoryOu](https://forums.freertos.org/u/ActoryOu)\
**Post date:** [July 13, 2023, 2:53am UTC](https://forums.freertos.org/t/same-web-server-two-ip-addresses/17813/2 "2023-07-13T02:53:49Z")

</div>

Hi @polarsoft,

> [@polarsoft](#):
>
> 1. creating two IP addresses for the same physical Ethernet adapter

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](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/releases/tag/V4.0.0-rc3).

Take [FreeRTOS\_Plus\_TCP\_Echo\_Posix](https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Posix/) as example, you can create multiple endpoints with different IP addresses on same network interface (like [here](https://github.com/FreeRTOS/FreeRTOS/blob/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Echo_Posix/main_networking.c#L166-L175)) before calling `FreeRTOS_IPInit_Multi()`. Then you can have two(or more) IP address on same physical Ethernet adapter.

> [@polarsoft](#):
>
> 1. 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?

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](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/pull/701/files) did on each port.

Please let me know if you have any other question.

Thanks.

---

<div class="post-metadata">

**Author:** ![Shub](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@Shub](https://forums.freertos.org/u/Shub)\
**Post date:** [July 13, 2023, 1:12pm UTC](https://forums.freertos.org/t/same-web-server-two-ip-addresses/17813/3 "2023-07-13T13:12:44Z")

</div>

One more good reference is the demo: [https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS\_Plus\_TCP\_IPv6\_Demo](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_IPv6_Demo). This demo currently creates multiple IPv4 and IPv6 endpoints.
