Rostyslav Malenko
Rostyslav Malenko

Reputation: 569

AWS EC 2 assign secondary public IPv4 address - does not pinging

I have attached secondary IP to the AWS instance (created network interface, assign IP and attach to instance)

aws ec2 describe-instances --instance-ids=i-0erd00a130f9 | grep PublicIp
"PublicIpAddress": "54.77.93.1",
"PublicIp": "54.77.93.1",
"PublicIp": "54.77.93.1",
"PublicIp": "52.209.58.2",
"PublicIp": "52.209.58.2",

As I can see the both IPs are attached. Interface eth1 up and have private IP 172.31.4.143 which does not ping by private and public IP.

Interface eth0 ping by private and public IP.

I had pinged from another instance in the network.

Could anybody help me understand what I had missed, please?

Upvotes: 1

Views: 855

Answers (1)

Rostyslav Malenko
Rostyslav Malenko

Reputation: 569

ip rule add from 172.31.4.143 table default
ip route add default via 172.31.0.1 dev eth1 table default
ip route flush cache

I have found answer in the article: Multiple IP addresses on Amazon EC2 and there

Upvotes: 1

Related Questions