0

I have an Amazon EC2 Instance running Ubuntu server 16.04

I want the EC2 to have two network interfaces. After configuring the secondary interface. I cannot ping my primary interface from my other instances. This is my configuration of the /etc/network/interfaces.d/51-secondary.cfg . I have enable to allow all traffic on the ec2 as well. My interfaces are ens5 the primary and ens6 the secondary. my primary IP is 172.31.0.67 and the secondary is 172.31.6.43. I want my other ec2s to communicate with both my ip address. Is it possible what did i do wrong here.

 auto ens6
iface ens6 inet static 
address 172.31.6.43
netmask 255.255.240.0

# Gateway configuration
up ip route add default via 172.31.0.1 dev ens6 table 1000

# Routes and rules
up ip route add 172.31.6.43 dev ens6 table 1000
up ip rule add from 172.31.26.168 lookup 1000
Zaffry
  • 1
  • Check the security group for each interface allows them to communicate. Being in the same security group doesn't allow communication, you need explicit allow rule incoming / outgoing. Also check your NACLs. – Tim May 30 '22 at 20:03
  • I allowed all incoming traffic on all my EC2s. but still having this issue. I put them on separate security groups and allowed all incoming traffic but still same issue. – Zaffry May 31 '22 at 08:59
  • Resources inside the same security group that need to communicate need matching incoming and outgoing security group rules. I know security groups are stateless, but you do have to allow both the outgoing from one resource in the SG and the incoming to another resource in the same SG. Like I said, it's not a subnet. You could also do this with allowing the whole VPC range in and out of the same SG. – Tim May 31 '22 at 09:51
  • I explicitly allowed both on inbound and outbound. but my main interface as mentioned above cannot ping to other EC2s in the same subnet but my second Interface can ping them and vice versa. – Zaffry Jun 03 '22 at 05:26

0 Answers0