# Connecting EC2 to AWS ActiveGate

**URL:** <https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082>\
**Category:** Cloud platforms\
**Tags:** activegate, aws\
**Created:** [May 9, 2022, 6:51pm UTC](https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082 "2022-05-09T18:51:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shakib](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@shakib](https://community.dynatrace.com/u/shakib)\
**Post date:** [May 9, 2022, 6:51pm UTC](https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082/1 "2022-05-09T18:51:40Z")

</div>

I have an AWS EC2 that I installed a OneAgent on before setting up an Environment ActiveGate in AWS.

The EC2 instance and AG are both in the same network zone. And yet the EC2 instance is still connecting directly to the Dynatrace cluster, even after I restarted the OneAgent.&nbsp;  
When I check --get-server on the EC2 I see the AG on AWS as one of the listed entities but I’m perplexed as to why it doesn’t connect to it first instead of directly to the cluster.

I assume there is a networking issue that is blocking it. If it is a networking issue, I don’t see anything about it in the oneagent-logmon-general or detailed logs on the EC2 instance.

---

<div class="post-metadata">

**Author:** ![shakib](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@shakib](https://community.dynatrace.com/u/shakib)\
**Post date:** [May 10, 2022, 1:43pm UTC](https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082/2 "2022-05-10T13:43:54Z")

</div>

Ok so this was resolved after&nbsp;adding inbound rule on the ActiveGate’s security group to allow 9999 traffic from that specific EC2 instance.

---

<div class="post-metadata">

**Author:** ![jgibson](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@jgibson](https://community.dynatrace.com/u/jgibson)\
**Post date:** [May 10, 2022, 1:54pm UTC](https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082/3 "2022-05-10T13:54:16Z")

</div>

We also deal with firewalls setup to protect between accounts and have to open port 9999 to those ActiveGates&nbsp; 😞

---

<div class="post-metadata">

**Author:** ![techean](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/techean/32/227_2.png) [@techean](https://community.dynatrace.com/u/techean)\
**Post date:** [May 11, 2022, 5:21am UTC](https://community.dynatrace.com/t/connecting-ec2-to-aws-activegate/35082/4 "2022-05-11T05:21:50Z")

</div>

great, Its basically the product behavior, if oneagent is not able to connect to AG it will directly communicate with cluster.
