1 Answer
- Newest
- Most votes
- Most comments
0
First: While you can do what you want in your VPC you don't have to do it that way. Instances within the VPC already have private IP addresses and can communicate with each other. The public IP addresses that they have (assuming they are on a public subnet) are not assigned directly to the instance network interface; instead that access is provided using 1:1 NAT on your Internet Gateway. The instances can transparently (and without further configuration) communicate privately on their private IP addresses with no further action by you.
But let's assume that you absolutely need separate interfaces. You should do the following:
- Create a new subnet in your VPC with a new IP range that is within the VPC IP range but different to your existing subnet(s).
- Create two network interfaces on that subnet. The interfaces will automatically get IP addresses.
- Attach the network interfaces to the instances.
- Create a security group and in the inbound rules, allow the security group to communicate with itself. This means that any instances that has been assigned to the security group can communicate with any other instance that has been assigned that security group.
- Attach the security group to the two network interfaces.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
Hi, Brettski-AWS. Thanks for your help. In the end, I tried to attach a second network interface to each instace, each secondary network interface belongs to the same security group of the corresponding primary network interface. I didn't have to configure nothing, I see the Centos instance and the Windows instance have assigned the corresponding private IP, however I can only ping from Windows instance to the primary private Centos IP, I can't ping to the secondary network interface private IP. And neither can ping from Centos instance to any Windows instance. What extra configuration do you think I need to make? Thanks in advance, and sorry for the bad English.
I think you need to look at the built-in Windows firewall - it will allow communications that are initiated by Windows but block anything that is initiated by another host.