# How to Use the Same OpenVPN Static Key for Multiple Servers (TCP and UDP)?

**URL:** <https://forum.pritunl.com/t/how-to-use-the-same-openvpn-static-key-for-multiple-servers-tcp-and-udp/2748>\
**Category:** Pritunl VPN\
**Created:** [December 9, 2024, 8:09am UTC](https://forum.pritunl.com/t/how-to-use-the-same-openvpn-static-key-for-multiple-servers-tcp-and-udp/2748 "2024-12-09T08:09:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![leikaiwei](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@leikaiwei](https://forum.pritunl.com/u/leikaiwei)\
**Post date:** [December 9, 2024, 8:09am UTC](https://forum.pritunl.com/t/how-to-use-the-same-openvpn-static-key-for-multiple-servers-tcp-and-udp/2748/1 "2024-12-09T08:09:56Z")

</div>

I have set up two proxy servers on a single physical server (using the free version).

I have set up two servers, one using TCP and the other using UDP. When I download the profile files from the user interface, I get two separate configuration files, but the OpenVPN static keys inside them (the part marked with `-----BEGIN OpenVPN Static key V1-----`) are different.

Is there a way to make the OpenVPN static keys the same for multiple servers?

This would allow me to use a single profile file for the client (with multiple `remote` lines written inside). The OpenVPN client could then automatically connect to an available `remote`. For example, if the first `remote` (UDP) is blocked due to network restrictions, the client could automatically connect to the second `remote` (TCP).

However, for this functionality to work, the OpenVPN static keys for multiple servers need to be the same. Could you please help me achieve this?

---

<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 9, 2024, 11:39am UTC](https://forum.pritunl.com/t/how-to-use-the-same-openvpn-static-key-for-multiple-servers-tcp-and-udp/2748/2 "2024-12-09T11:39:12Z")

</div>

Copy the `tls_auth_key` field in the `servers` collection in the database.

```auto
var tlsAuthKey = db.servers.findOne({}, { tls_auth_key: 1 }).tls_auth_key;
if (tlsAuthKey) {
    db.servers.updateMany({}, { $set: { tls_auth_key: tlsAuthKey } });
}

```

---

<div class="post-metadata">

**Author:** ![leikaiwei](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@leikaiwei](https://forum.pritunl.com/u/leikaiwei)\
**Post date:** [December 13, 2024, 10:32am UTC](https://forum.pritunl.com/t/how-to-use-the-same-openvpn-static-key-for-multiple-servers-tcp-and-udp/2748/3 "2024-12-13T10:32:16Z")

</div>

Thank you. 🥳
