![Reach to internet via other firewall in AWS Reach to internet via other firewall in AWS](https://askjoechan.com/wp-content/uploads/2023/07/bingjpg.jpg)
Reach to internet via other firewall in AWS
Internet
In previous post, in order to secure our VM in the private subnet. Using NAT Gateway, is very good option. In the other hand, AWS will charge it on the NAT Gateway usage. below info:
![](https://askjoechan.com/wp-content/uploads/2023/07/1-1024x434.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/2-1024x382.png)
NAT gateway will do NAT gateway do. It will not filter specific URL…..or other function. In this case, we can put third party firewall act as Gateway and also we can apply firewall policy to restrict the traffic.
Deploy Fortigate Firewall
1 VPC
1 Public Subnet + 1 Private Subnet ( Also Routing table )
1 Internet Gateway
1 VM in Public subnet & 1 VM ( Ubuntu ) in Private Subnet
Under AWS Marketplace you could select fortigate to deploy, beware pricing on the conditions. First, when you launched the Fortigate in AWS. You can login to Fortigate via HTTPS.
NAME: admin
Pass: will be your instance ID ( <- go to AWS EC2, you can find your instance ID info )
![](https://askjoechan.com/wp-content/uploads/2023/07/ec2-1.3-1024x299.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/first-login-2.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/first-login-1.1-2-1024x657.png)
apply rules with related IP:
- Virtual IP -> for ssh into your VM in private subnet
- Firewall rules for ssh flow
- Explicit Proxy on Fortigate
- Proxy firewall ruels
![](https://askjoechan.com/wp-content/uploads/2023/07/internet-1.2-1024x668.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/internet-1.4-1024x246.png)
Fortigate has been setup, now we moved the VM in Private Subnet.
This is Ubuntu VM with prviate Ip 10.10.2.128. Can reach to the internet via Fortigate Proxy ( Google website, apt update, apt install….etc) Also on Fortigate, we can restrict HTTPS & HTTPS on services, and FQDN for the DST .
![](https://askjoechan.com/wp-content/uploads/2023/07/ec2-1.5-1024x544.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/internet-1.1-1024x196.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/Capture-1024x517.png)
Aviatrix Firewall
If you are using Aviatrix in your work enviroment. You can also use it’s Distributed firewall to inspect the traffic. After the distributed Firewall is active. Then search “smartgroup” at the left hand side . You will configure your smartgroup.
will need to define which is enviroment -> development, production…etc
Can Development traffic go to production
Can Development traffic go to Public internet
![](https://askjoechan.com/wp-content/uploads/2023/07/cloud-1.1.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/BT-1.1-1-1024x644.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/tag-1.1-1-1024x596.png)
![](https://askjoechan.com/wp-content/uploads/2023/07/cloud-1.3-1024x543.png)