PrepAway - Latest Free Exam Questions & Answers

How can the user configure this with the security group?

A user has configured a VPC with a new subnet. The user has created a security group. The user wants to
configure that instances of the same subnet communicate with each other. How can the user configure this
with the security group?

PrepAway - Latest Free Exam Questions & Answers

A.
There is no need for a security group modification as all the instances can communicate with each other
inside the same subnet

B.
Configure the subnet as the source in the security group and allow traffic on all the protocols and ports

C.
Configure the security group itself as the source and allow traffic on all the protocols and ports

D.
The user has to use VPC peering to configure this

Explanation:
A Virtual Private Cloud (VPC. is a virtual network dedicated to the user’s AWS account. AWS provides two
features that the user can use to increase security in VPC: security groups and network ACLs. Security groups
work at the instance level. If the user is using the default security group it will have a rule which allows the
instances to communicate with other. For a new security group the user has to specify the rule, add it to define
the source as the security group itself, and select all the protocols and ports for that source.

27 Comments on “How can the user configure this with the security group?

    1. venkat sai says:

      I will agree with Justin.

      The reason is when you create a custom VPC and subnets, route table will be configured such that the instance launched in the subnets can communicate with each other. There won’t be any restrictions or blocking for the instances.




      0



      0
    2. venkat sai says:

      The answer is C.

      The reason is user has created another Security Group which by default has nothing configured, so he has to set the sources as itself when he uses this Security Group with the created VPC.

      If the user has only created a custom VPC then a custom SG will be created and which has a rule to allow itself. In this way the subnets can communicate with each other




      0



      0
      1. sridhar says:

        When the new subnet is created, default routing enables the communicating within the instances of subnet is enabled by default.

        So, I go with A




        0



        0
        1. sridhar says:

          I will take it back. I go with B

          By Default EC2 instances within the same subnet can communicate with each other using the default routing policy. But only thing is security group must be created to open the port for communication. so I will go with B




          0



          0
    3. Pk says:

      Something is off with this questions, I just tested and both B and C are correct.

      Type Protocol Port Range Source
      B. All traffic All All sg-70f09519 (SG itself as source)

      Type Protocol Port Range Source
      C. ll traffic All All 192.0.0.0/24 (subnet as source)

      A. is not correct, this is only valid for the default VPC.
      D. is not correct, as VPC peering is for connecting VPCs




      0



      0
  1. Gig says:

    Both A and C is WRONG. The correct answer is B.

    I setup 2 hosts and EC2 on a new subnet and new security group (with default settings). Neither host could ping either other on their internal IP by default. I had to edit the inbound Security Group to allow traffic traffic between the two EC2 instances. Both instances are on the same subnet and same security group.

    I tried both B and C in this actual AWS environment and both options worked in real life for sending traffic between the EC2 instances in this scenario.

    However the questions ask that “instances of the same subnet communicate with each other.” B allows instances of the same subnet to communicate with each other. C only allows instances of the same security group to communicate. In this scenario the EC2 instances are in the same subnet and security group but the question specifically ask for communication on the subnet level.

    The correct answer is B.




    0



    0
  2. Aneesh Mohan says:

    I feel B is the correct answer .

    The reason not C is any subnet instances can be configured to use the affected security group and if you added SG as the source then this may not match to the requirement raised in question “The user wants to
    configure that instances of the same subnet communicate with each other”




    0



    0
  3. Anonym says:

    Agree with Aneesh Mohan logic.
    I did the same test as Gig: actually, both B and C work for instances to communicate between each other within a subnet. But because question mentions “The user wants to configure that instances of the same subnet communicate with each other.” – I believe the correct answer is B: subnet as a source. Not security group.




    0



    0
  4. sridhar says:

    By Default EC2 instances within the same subnet can communicate with each other using the default routing policy. But only thing is security group must be created to open the port for communication. so I will go with B




    0



    0
  5. Viva says:

    Answer is C. Please read question carefully as they mentioned user created new SG.

    Security groups work at the instance level. If the user is using the default security group it will have a rule which allows the instances to communicate with other. For a new security group the user has to specify the rule, add it to define the source as the security group itself, and select all the protocols and ports for that source.




    0



    0
  6. nagarjunadn says:

    The perfect answer is B.

    Though the options B and C would be possible answers, but option B makes more sense as per the question.
    B – In this case, if we add subnet as the source to the security group then any other instance in that subnet can communicate with the instance owning this security group. But important consideration here is, we need to add subnet as the source to each individual instance security groups.
    C – In this case, if we add security group itself as the source then it allow traffic from other instances assigned to this security group only. Even if the instances launched in the different subnets uses this security group can also communicate.

    http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario3.html




    1



    0
    1. nagarjunadn says:

      One more point in the question to be consider is “instances of the same subnet communicate with each other”(optin B fits).
      If there is a scenario where “the instances of the same security group communicate with each other”(Option C fits).

      Security Groups are nothing to do with subnet level(network level) but NACL does and applies to all instances launched with that subnet.




      0



      0
  7. BDA says:

    C – for this reason

    When you create a security group, it has no inbound rules. Therefore, no inbound traffic is allowed until you add inbound rules to the security group.




    0



    0
    1. baboon says:

      Mate, that isn’t a valid reason at all. Sure it needs inbound rules, but from WHAT SOURCE? SG or Subnet? SG if you want instances of the same SG to talk to each other, or subnet if you want instances of the same subnet to talk to each other.




      0



      0
  8. Cloud Geek says:

    Option B is the ONLY Correct answer.

    Reason: Its a NEW security Group being created, even though its similar to default security group. Now unless NEW Security Group is created …you will not get Security Group ID to configure as Source, so only option left is to use Subnet as SOURCE




    1



    0

Leave a Reply

Your email address will not be published. Required fields are marked *