# Fault-tolerant OpenVPN in AWS

**URL:** <https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419>\
**Category:** AWS Networking\
**Tags:** vpn\
**Created:** [August 18, 2018, 10:21am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419 "2018-08-18T10:21:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiarash-irandoust](https://awshq.com/letter_avatar_proxy/v4/letter/k/6a8cbe/32.png) [@kiarash-irandoust](https://awshq.com/u/kiarash-irandoust)\
**Post date:** [August 18, 2018, 10:21am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/1 "2018-08-18T10:21:25Z")

</div>

Fault-tolerant OpenVPN in AWS

[https://medium.com/@xynova/fault-tolerant-openvpn-in-aws-a47e0d17ca85](https://medium.com/@xynova/fault-tolerant-openvpn-in-aws-a47e0d17ca85)

* * *

**Related discussions:**

- [Solution: Problem with Client VPN Split Tunnel](https://awshq.com/t/solution-problem-with-client-vpn-split-tunnel/20144)
- [VPN Recomendations](https://awshq.com/t/vpn-recomendations/16431)
- [Need help setting up architecture to reach a developer’s machine from an EC2 instance, via a peering connection and VPN Client](https://awshq.com/t/need-help-setting-up-architecture-to-reach-a-developers-machine-from-an-ec2-instance-via-a-peering-connection-and-vpn-client/21277)
- [Strategy for migrating on prem file servers to FSX for Windows.](https://awshq.com/t/strategy-for-migrating-on-prem-file-servers-to-fsx-for-windows/15533)
- [Client VPN Recommendations for Securing AWS Access?](https://awshq.com/t/client-vpn-recommendations-for-securing-aws-access/16999)

---

<div class="post-metadata">

**Author:** ![m\_onken](https://awshq.com/letter_avatar_proxy/v4/letter/m/8797f3/32.png) [@m\_onken](https://awshq.com/u/m_onken)\
**Post date:** [August 18, 2018, 10:53am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/2 "2018-08-18T10:53:34Z")

</div>

Wouldn’t it be easier to just detach the Elastic IP from the failed instance and reattach it to the new one? DNS changes are not immediate even if you have a low TTL on the record.

---

<div class="post-metadata">

**Author:** ![DashJacks0n](https://awshq.com/letter_avatar_proxy/v4/letter/d/eada6e/32.png) [@DashJacks0n](https://awshq.com/u/DashJacks0n)\
**Post date:** [August 18, 2018, 12:23pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/3 "2018-08-18T12:23:30Z")

</div>

Thanks for sharing!

---

<div class="post-metadata">

**Author:** ![hijinks](https://awshq.com/letter_avatar_proxy/v4/letter/h/9fc29f/32.png) [@hijinks](https://awshq.com/u/hijinks)\
**Post date:** [August 18, 2018, 12:32pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/4 "2018-08-18T12:32:12Z")

</div>

> [@m\_onken](#):
>
> Wouldn’t it be easier to just detach the Elastic IP from the failed instance and reattach it to the new one? DNS changes are not immediate even if you have a low TTL on the record.

Yes this whole setup is over engineered

---

<div class="post-metadata">

**Author:** ![AlaskaFishingGuide](https://awshq.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@AlaskaFishingGuide](https://awshq.com/u/AlaskaFishingGuide)\
**Post date:** [August 18, 2018, 1:34pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/5 "2018-08-18T13:34:25Z")

</div>

> [@m\_onken](#):
>
> Wouldn’t it be easier to just detach the Elastic IP from the failed instance and reattach it to the new one? DNS changes are not immediate even if you have a low TTL on the record.

With Route53 you can fail-over between endpoints based on a health check, so it can be instant.

---

<div class="post-metadata">

**Author:** ![godhatesmetoo](https://awshq.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@godhatesmetoo](https://awshq.com/u/godhatesmetoo)\
**Post date:** [August 18, 2018, 3:02pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/6 "2018-08-18T15:02:57Z")

</div>

You might also want to try [SoftEther VPN](https://www.softether.org/1-features). It’s an open-source P2TP VPN server written by the University of Tsukuba in Japan. It is free, easy to use and most importantly it supports clustering and thereby scaling horizontally.

---

<div class="post-metadata">

**Author:** ![asurah](https://awshq.com/letter_avatar_proxy/v4/letter/a/67e7ee/32.png) [@asurah](https://awshq.com/u/asurah)\
**Post date:** [August 18, 2018, 3:47pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/7 "2018-08-18T15:47:03Z")

</div>

Building applications that rely on 100% uptime of the network infrastructure is a bad move to begin. I pushed back on requirements like this, and stateful failover, because it encourages software engineers to stop thinking about error handing at the application layer.

---

<div class="post-metadata">

**Author:** ![DigitalWhitewater](https://awshq.com/letter_avatar_proxy/v4/letter/d/b4bc9f/32.png) [@DigitalWhitewater](https://awshq.com/u/DigitalWhitewater)\
**Post date:** [August 18, 2018, 5:36pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/8 "2018-08-18T17:36:05Z")

</div>

> [@godhatesmetoo](#):
>
> You might also want to try [SoftEther VPN](https://www.softether.org/1-features). It’s an open-source P2TP VPN server written by the University of Tsukuba in Japan. It is free, easy to use and most importantly it …

Wow I never heard of softether vpn. Thanks for morning reading material.

---

<div class="post-metadata">

**Author:** ![strongfarce](https://awshq.com/letter_avatar_proxy/v4/letter/s/6de8d8/32.png) [@strongfarce](https://awshq.com/u/strongfarce)\
**Post date:** [August 18, 2018, 6:39pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/9 "2018-08-18T18:39:04Z")

</div>

> [@AlaskaFishingGuide](#):
>
> With Route53 you can fail-over between endpoints based on a health check, so it can be instant.

Not exactly. The dns records will still have a small TTL and the lag of the healthcheck itself, but I think what the person you were replying to was probably referring to is how some dns providers, especially ISP ones, don’t allow a very low TTL and make sure the minimum is above a certain number to avoid constant recaching. I’ve had 60 second TTL changes take much longer than 1 minute for users to hit the new IP.

By just rebinding the elastic IP it will remove all those variables and you’re only reliant on how fast that detaching and attaching takes. Bad DNS providers don’t matter then.

---

<div class="post-metadata">

**Author:** ![hair-plug-assassin](https://awshq.com/letter_avatar_proxy/v4/letter/h/c4cdca/32.png) [@hair-plug-assassin](https://awshq.com/u/hair-plug-assassin)\
**Post date:** [August 18, 2018, 9:05pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/10 "2018-08-18T21:05:27Z")

</div>

> [@godhatesmetoo](#):
>
> You might also want to try [SoftEther VPN](https://www.softether.org/1-features). It’s an open-source P2TP VPN server written by the University of Tsukuba in Japan. It is free, easy to use and most importantly it …

Can confirm, we use this and it’s pretty hardy.

---

<div class="post-metadata">

**Author:** ![omenking](https://awshq.com/letter_avatar_proxy/v4/letter/o/9d8465/32.png) [@omenking](https://awshq.com/u/omenking)\
**Post date:** [August 19, 2018, 9:33am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/11 "2018-08-19T09:33:43Z")

</div>

> [@strongfarce](#):
>
> Not exactly. The dns records will still have a small TTL and the lag of the healthcheck itself, but I think what the person you were replying to was probably referring to is how some dns providers, especially ISP ones, …

I agree here, Elastic IP can be much faster than waiting on TTL.. Currently I’ve been looking for a way to automate changing the Elastic IP when I spin up new servers that I promote to production

---

<div class="post-metadata">

**Author:** ![BU14](https://awshq.com/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@BU14](https://awshq.com/u/BU14)\
**Post date:** [August 19, 2018, 5:49pm UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/12 "2018-08-19T17:49:46Z")

</div>

> [@omenking](#):
>
> I agree here, Elastic IP can be much faster than waiting on TTL.. Currently I’ve been looking for a way to automate changing the Elastic IP when I spin up new servers that I promote to production

I have done this using lifecycle hooks and lambda (if you are using autoscaling groups)

---

<div class="post-metadata">

**Author:** ![my\_awesome\_username](https://awshq.com/letter_avatar_proxy/v4/letter/m/7ab992/32.png) [@my\_awesome\_username](https://awshq.com/u/my_awesome_username)\
**Post date:** [August 21, 2018, 12:17am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/13 "2018-08-21T00:17:09Z")

</div>

> [@godhatesmetoo](#):
>
> You might also want to try [SoftEther VPN](https://www.softether.org/1-features). It’s an open-source P2TP VPN server written by the University of Tsukuba in Japan. It is free, easy to use and most importantly it …

Is there anyway to configure this on the command line or via a config file? I see it has a client manager, but I’m not seeing enough info to automate the deployment? Also, any Google MFA integration?

Currently deployed openvpn fully configured via ansible, but I’d love an ha setup

---

<div class="post-metadata">

**Author:** ![godhatesmetoo](https://awshq.com/letter_avatar_proxy/v4/letter/g/ad7895/32.png) [@godhatesmetoo](https://awshq.com/u/godhatesmetoo)\
**Post date:** [August 21, 2018, 6:51am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/14 "2018-08-21T06:51:57Z")

</div>

> [@my\_awesome\_username](#):
>
> Is there anyway to configure this on the command line or via a config file? I see it has a client manager, but I’m not seeing enough info to automate the deployment? Also, any Google MFA integration? Currently deployed …

Yes, there’s a config file. I’ll look it up and post it here later today 🙂

EDIT: [Here’s the config](https://www.softether.org/4-docs/1-manual/3._SoftEther_VPN_Server_Manual/3.3_VPN_Server_Administration#3.3.7_Configuration_File)

---

<div class="post-metadata">

**Author:** ![mindhoc](https://awshq.com/letter_avatar_proxy/v4/letter/m/edb3f5/32.png) [@mindhoc](https://awshq.com/u/mindhoc)\
**Post date:** [August 25, 2018, 12:28am UTC](https://awshq.com/t/fault-tolerant-openvpn-in-aws/6419/15 "2018-08-25T00:28:47Z")

</div>

> [@m\_onken](#):
>
> Wouldn’t it be easier to just detach the Elastic IP from the failed instance and reattach it to the new one? DNS changes are not immediate even if you have a low TTL on the record.

> Wouldn’t it be easier to just detach the Elastic IP from the failed instance and reattach it to the new one? DNS changes are not immediate even if you have a low TTL on the record.

And to harden the IP allocation with a Resource Tag constraint. Definitely faster recovery
