[aws] open-port doesn't allow IPv6 connections

Bug #1709312 reported by Junien F
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Thomas Miller

Bug Description

Hi,

On AWS, juju 2.2.2 "open-port" doesn't open ports for IPv6 connections.

This is because in the rulesToIPPerms function (https://github.com/juju/juju/blob/2.2/provider/ec2/environ.go#L1236), juju uses the "defaultRouteCIDRBlock" source CIDR if no source is defined.

However, as per https://github.com/juju/juju/blob/2.2/provider/ec2/environ_vpc.go#L22, this constant is set to 0.0.0.0/0, which is IPv4 only.

open-port should also allow connections from ::/0. It doesn't hurt if the instance doesn't have an IPv6.

Thanks !

Revision history for this message
Anastasia (anastasia-macmood) wrote :

Juju does not support IPv6 yet.

tags: added: ipv6 network
Changed in juju:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Haw Loeung (hloeung) wrote :

Still biting us. Would be nice to at least just add a secgroup to allow connections from '::/0', so Ipv6Ranges and CidrIpv6 in addition to IpRanges and CidrIp.

Tim Penhey (thumper)
tags: added: bitesize ec2-provider
Revision history for this message
Haw Loeung (hloeung) wrote :

At the moment, we're using the AWS CLI to work around this. The commands are:

| aws ec2 describe-instances --filters "Name=tag:juju-units-deployed,Values=content-cache/*" --query 'Reservations[*].Instances[*].SecurityGroups[*]' --output table | awk '/juju-.*-[[:digit:]]*[[:space:]]/ { print $2 }'

These are for units deployed as 'content-cache'. It will then give a list of secgroup IDs which you iterate through and add the missing rules:

| aws ec2 authorize-security-group-ingress --group-id $SECGROUP_ID --ip-permissions IpProtocol=tcp,FromPort=80,ToPort=80,Ipv6Ranges='[{CidrIpv6=::/0,Description="Work around LP:1709312"}]'

You'll need to re-run these commands after each environment change, such as adding or removing of units and applications.

Revision history for this message
Thomas Cuthbert (tcuthbert) wrote :

Ran into this issue again today when adding some additional apache units into aws, this would be a nice feature to have.

Revision history for this message
Haw Loeung (hloeung) wrote :

Similar one for OpenStack filed back in 2017, LP:1709312

Revision history for this message
Harry Pidcock (hpidcock) wrote :

I think hloeung means LP:1666537

Changed in juju:
milestone: none → 2.9-next
importance: Wishlist → High
Revision history for this message
Haw Loeung (hloeung) wrote :

Ah yes, LP:1666537.

Thomas Miller (tlmiller)
Changed in juju:
assignee: nobody → Thomas Miller (tlmiller)
Revision history for this message
Thomas Miller (tlmiller) wrote :

This has technically been working for a while. PR below just enshrines the behavior a bit better.

PR: https://bugs.launchpad.net/juju/+bug/1709312

Changed in juju:
status: Triaged → In Progress
milestone: 2.9-next → 2.9.32
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.