AWS – Install NAT function into OpenVPN Server

Introduction

We occasionally observe redundancy within the system. Combining two servers into a single unit can efficiently manage various functions, depending on the circumstances. In my scenario, I’ve established a compact system environment with 4 – 6 running EC2 instances. In this context, it’s a wise approach to amalgamate the “NAT instance” and the “VPN Instance” to streamline operations and reduce costs. By the conclusion of the video, we achieve a minimal yet scalable AWS system environment in a cost-effective manner.

Image of the VPC we are setting up in this blog

1. Preparation

0:00 What we developed so far
1:23 A redundancy in this design
2:04 Take a snapshot of VPN instance
3:07 Change source/destination check
3:33 Change Security Groups
6:25 Change a Route Table

2. Install NAT function to VPN instance

00:00 SSH to VPN Instance
01:18 Install NAT function
02:02 Check the Internet connection
03:00 Troubleshooting 1
04:16 Restart VPN Insntace
05:32 Troubleshooting 2
05:53 NAT function worked
06:19 Change /etc/sysctl.conf
07:15 Enable iptables service
08:06 Check the Internet connection
08:22 Restart VPN/NAT instance
09:00 Check the Internet connection
09:26 NAT was successfully configured
10:06 How to stop NAT service
10:45 How to start NAT Service
11:12 Delete a NAT instance
11:38 Conclusion