AWS - Series - EC2: Allow IP in AWS security Groups RDP connection for Windows and Linux

 Hello All

Today we are going to see, the security groups [Inbound rule ] in EC2 Instance for Windows EC2  

Security groups act as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level. we must add rules to a security group to enable you to connect to our Windows instance from our IP address using RDP.


Scenario : 

To protect our instances allow only those IP's which are authenticated. For this, we need to set up the IP's in our security groups connected to your EC2 instance.

Some Critical servers running on windows OS platform can be accessed via RDP only from specific IP address or specific Subnets

Remote  Desktop Service Name in Windows : RDP - Port 3389

Remore Desktop Service Name in Linux - SSH - Port  22

I have taken two ISP for this scenario

One is Hathaway and Other is  JIO  

 The EC2 Instance is allowed to connect only the Hathway  specific IP range or single IP

To add a rule to a security group for inbound RDP traffic over IPv4 (console)

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances.

  3. Select your instance and, in bottom half of the screen, choose the Security tab. Security groups lists the security groups that are associated with the instance. Inbound rules displays a list of the inbound rules that are in effect for the instance.

  4. For the security group to which you'll add the new rule, choose the security group ID link to open the security group.

  5. On the Inbound rules tab, choose Edit inbound rules.

  6. On the Edit inbound rules page, do the following:

    1. Choose Add rule.

    2. For Type, choose RDP.

    3. For Source, choose My IP to automatically populate the field with the public IPv4 address of your local computer.  As am i using STATIC IP from Hathway - My IP address is 210..19.181.5 /32  so its Single IP 


      For information about finding your IP address, see Before you start.


    4. Choose Save rules.




Once its added . i Can able to Connect from the server from my HATHWAY static IP




From another Subnet  - JIO ISP Network

i Disconnected my internet connectivity from Hathway and connected the Internet through my JIO connection 

Now my IP got changed from 210..19.181.5 [Hathway] to 157.51.99.30 [JIO] and Try to connect the same EC2 Windows instance its not connecting because of the inbound traffic rules configured to allowed only from specific IP ranges



Note : if you want to so the same thing for Linux Instance. you need to choose SSH on port 22

Happy Learning All 😃


Comments