# 2 IPs on router and Pritunl

**URL:** <https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587>\
**Category:** Pritunl VPN\
**Tags:** pritunl, pritunl-client\
**Created:** [November 6, 2024, 2:06pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587 "2024-11-06T14:06:42Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 6, 2024, 2:06pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/1 "2024-11-06T14:06:43Z")

</div>

Hello,

Our router has 2 WAN interfaces with 2 IPs, but clients always connecting use one. As far as I understand, in the Pritunl server settings (set by the public address in either the top right settings or in the host settings for enterprise subscriptions) specify only one.

By default public address is blank to automatically detect the servers public address.

How can it be possible to use the 2nd WAN interface? Only by additionally installing a second Pritunl or setting up a software like Traefik or similar behind the router?

Because we want so that some clients connect via WAN1, the rest of the clients via WAN2. At this time it’s not convenient to edit user profile configs manually…

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 6, 2024, 2:39pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/2 "2024-11-06T14:39:21Z")

</div>

The server isn’t designed to support that, if it’s an enterprise subscription a blank host can be created by temporarily removing `/var/lib/pritunl/pritunl.uuid` and running `sudo systemctl restart pritunl`. This will create a second host, the public address of that host can be set to the second IP address. Then both hosts can be attached to the server. Even though the second host is offline the client will still attempt both IP addresses in a random order. This would not result in additional billing for the offline host.

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 6, 2024, 2:52pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/3 "2024-11-06T14:52:43Z")

</div>

Please clarify, finally must be exists only one file pritunl.uuid (new created automatically)? Pritunl client can’t connect although 2nd host added successfully and we set up 2nd IP explicitly as Public address. Now in pritunl client log:

```auto
2024-11-06 17:37:49 TCP/UDP: Preserving recently used remote address: [AF_INET]IP_WAN1:port
2024-11-06 17:37:49 UDPv4 link local: (not bound)
2024-11-06 17:37:49 UDPv4 link remote: [AF_INET]IP_WAN1:port
2024-11-06 17:37:53 Server poll timeout, restarting
2024-11-06 17:37:53 SIGUSR1[soft,server_poll] received, process restarting
type or paste code here

```

and client try to reconnect constantly.

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 7, 2024, 2:14am UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/4 "2024-11-07T02:14:19Z")

</div>

The uuid should be restored to the original value after the second host is created. If the host isn’t able to connect to the IP address then it is an issue with that network configuration. Check the `remote` values in the profile paths listed in the [**client debugging documentation**](https://docs.pritunl.com/docs/debugging-client).

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 7, 2024, 12:20pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/5 "2024-11-07T12:20:55Z")

</div>

thank you! actually in profile file for ovpn I can see:

```auto
remote WAN1-IP 21159 udp
remote WAN2-IP 21159 udp

```

but with equal port number value although in the server settings (exists 2 VPN servers configured in one VM with Pritunl) we have 2 different port values: 21159 and  
24924. I tried to add other port value to Public Address in host settings but it 's not working. Now we have 2 Hosts available with different Public IPs but one of them still in offline state. As I understand both Hosts must be in online state…

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 7, 2024, 7:49pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/6 "2024-11-07T19:49:52Z")

</div>

The port number can’t be changed. If port forwarding is being used to modify the external port the server has no option to adjust for that.

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 8, 2024, 8:45am UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/7 "2024-11-08T08:45:58Z")

</div>

So if remove temporarily `pritunl.uuid` followed by `systemctl restart pritunl` new created second host anyway will be in offline state but clients will be a able to connect both IPs (WAN1+WAN2) in a random order, correct? We a have new created second host in offline state now. Or both hosts must be in online state?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 8, 2024, 9:44am UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/8 "2024-11-08T09:44:45Z")

</div>

Yes it doesn’t matter if the host remains in an offline state. The remotes will be added to the client configuration and the client will attempt both hosts IP addresses.

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 12, 2024, 10:31am UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/9 "2024-11-12T10:31:49Z")

</div>

Pritunl client connects sucessully via WAN2 IP in wg-mode but when try connect via WAN1 IP this error message occured in log:

```auto
[2024-11-12 05:20:18][ERRO] ▶ profile: All connection requests failed
profile: Failed to parse response body
invalid character '<' looking for beginning of value
ORIGINAL STACK TRACE:
github.com/pritunl/pritunl-client-electron/service/connection.(*Client).authorize
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/connection/client.go:600 +0xa6b159
github.com/pritunl/pritunl-client-electron/service/connection.(*Client).connectPreAuth
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/connection/client.go:287 +0xa68e10
github.com/pritunl/pritunl-client-electron/service/connection.(*Client).Start
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/connection/client.go:189 +0xa67e75
github.com/pritunl/pritunl-client-electron/service/connection.(*Wg).Start
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/connection/wg.go:118 +0xa70246
github.com/pritunl/pritunl-client-electron/service/connection.(*Connection).Start
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/connection/connection.go:125 +0xa70230
github.com/pritunl/pritunl-client-electron/service/handlers.profilePost.func1
        /pacur_build/src/pritunl-client-electron-1.3.4075.60/service/handlers/profile.go:148 +0xa979fe
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1700 +0x479520

```

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 12, 2024, 1:10pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/10 "2024-11-12T13:10:37Z")

</div>

That’s an issue with the web server being unavailable at that IP address.

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [November 13, 2024, 12:13pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/11 "2024-11-13T12:13:35Z")

</div>

> [@zach](#):
>
> Yes it doesn’t matter if the host remains in an offline state. The remotes will be added to the client configuration and the client will attempt both hosts IP addresses.

We can connect successfully in ovpn mode to both IPs: WAN1 and WAN2 (when one of host remains in an offline state) but in wg mode we can connect only with one of WAN interfaces (which assign to host in online state). I.e. if we manually changed Host IPs vice versa then we can connect to other WAN (new host in online state) in wg mode. And strange that this error message occurred in client’s log when WG connection successful:

```auto
[2024-11-13 15:21:09][ERRO] ▶ connection: Failed to complete authorize ◆ body="413: Payload Too Large" ◆ method="POST" ◆ status_code=413 ◆ url="https://WAN2-IP:port/key/wg/61ff20cbc1e709c149fd0572/642c8e939b8aa8a4abb8991d/653644b488c49b9109058421/" request: Bad status 413 code from server

```

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [November 13, 2024, 3:36pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/12 "2024-11-13T15:36:34Z")

</div>

Actually this method won’t work with WireGuard even if the web server access was fixed. WireGuard connections are going to return the public address of the current host in authentication response and that will be used for the connection. This will cause only one IP to be used for WireGuard connections.

---

<div class="post-metadata">

**Author:** ![ffrr](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/f/47e85d/32.png) [@ffrr](https://forum.pritunl.com/u/ffrr)\
**Post date:** [December 2, 2024, 2:55pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/13 "2024-12-02T14:55:38Z")

</div>

I.e. need to have two Pritunl servers if uses 2 WAN interfaces on router? Maybe exist any workaround?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [December 2, 2024, 6:07pm UTC](https://forum.pritunl.com/t/2-ips-on-router-and-pritunl/2587/14 "2024-12-02T18:07:36Z")

</div>

In the future it may be possible to put the second IP in the Public IPv6 Address field but currently this is ignored by the Pritunl Client due to limited support for supplying multiple endpoints to the WireGuard `wg-quick` configuration.
