Cannot get ipv6 for ec2 instance

0

I added an ipv6 address to my EC2 instance in AWS. Followed the instructions, adding a ipv6 CDIR to the VPC, and editing the subnet. Added to the .route table, updated the security rules and finally added an ipv6 address to the network interface. The ipv6 address shows up in the EC2 instance overview now. I restarted the instance.

I followed instructions in: Migrate your VPC from IPv4 to IPv6 - Amazon Virtual Private Cloud

I would expect ifconfig to now show the ipv6 address in the Ubuntu instance, and of course be able to access the instance in browser, or ping it (all of which works with the ipv4 address). But ifconfig only shows the fe80:: address.

Would appreciate any pointers for troubleshooting this.

Wido
asked 6 months ago358 views
4 Answers
0

Hello.

I was able to check the IPv6 address set on EC2 by running "ip a" in my environment.
Does it not appear even if you recreate EC2?

root@ip-10-0-0-180:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc fq_codel state UP group default qlen 1000
    link/ether 06:13:93:d4:4c:57 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.180/25 metric 100 brd 10.0.0.255 scope global dynamic eth0
       valid_lft 3051sec preferred_lft 3051sec
    inet6 yyyy:yyyy:yyy:yyyy:yyyy:yyyy:yyyy:bd41/128 scope global dynamic noprefixroute
       valid_lft 391sec preferred_lft 81sec
    inet6 fe80::413:93ff:fed4:4c57/64 scope link
       valid_lft forever preferred_lft forever
profile picture
EXPERT
answered 6 months ago
0

Any additional information or remedy on this issue would be appreciated.

I encountered the same problem, ie attached an IPv6 address to the NIC, after spending a day wondering why the instance was inaccessible via IPv6 even though other instances in the same subnet were in fact accessible via IPv6.

I finally reattach an IPv4 address to the instance and ssh into it, and of course I see it is only bound to the the private IPv4 address and no binding to IPv6, that would have saved me hours had I checked that first.

In other words it is possible for the NIC to show IPv6 binding in the AWS console to signal IPv6 is enabled on the instance but in fact for that not to be true, you can only confirm by logging into the instance via IPv4.

Edmond
answered 2 months ago
  • This turns out to be an OS related issue, possibly tied to instances derived from older OS releases. While my instance has an up-to-date ubuntu OS it was created years ago so I am not sure if something is off in its configuration.

    In any case I came across this post https://github.com/coreos/bugs/issues/1828

    My instance doesn't have /etc/network/interfaces.d/50-cloud-init.cfg but it does have /etc/network/interfaces.d/eth0.cfg

    sudo vi /etc/network/interfaces.d/eth0.cfg #add this line for ipv6 binding iface eth0 inet6 dhcp #save then restart networking sudo systemctl restart networking

    #exit the instance and ssh back in and i see the IPv6 binding

    eth0.cfg is apparently a static config meaning you can't take advantage of cloud-init in ubuntu, meaning using is ultimately not a solution but will do for now.

    This post (https://github.com/canonical/cloud-init/issues/2663) suggests deleting /etc/network/interfaces.d/eth0.cfg, however that left my instance unreachable because /etc/network/interfaces.d/50-cloud-init.cfg did not get created as expected, fortunately I had an AMI backup.

0

Hey, thanks for the response!!! This is what I get... there is nothing in there that looks like the ipv6 address on the EC2 dashboard of my instance... when you say "recreate the EC2" - what I did was reboot the instance. Is "recreate" a different process?

$ ifconfig ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 172.31.X.XX netmask 255.255.240.0 broadcast 172.31.XX.XX inet6 fe80::82c:d4ff:fe6f:XXXX prefixlen 64 scopeid 0x20<link> ether 0a:2c:d4:6f:XX:XX txqueuelen 1000 (Ethernet) ... lo: ...

Wido
answered 6 months ago
0

@Riku_Kobayashi - yes, I went through the instructions in the document you referenced, and when I go to the EC2 dashboard of my instance, it does show the ipv6 address. So since I see the address, I think I must have done things right. But I don't see the ipv6 address in Ubuntu with ifconfig...

Wido
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions