CenturyLinkCloud / clc-go-cli

Apache License 2.0
5 stars 3 forks source link

CIDR issue #86

Open chrislittle opened 7 years ago

chrislittle commented 7 years ago

can you look into the issue around CIDR on source IP filter on public ips:

  1. basically you add the public IP (i.e. clc server add-public-ip-address --server-name --internal-ip-address --ports port=XX,protocol=udp (or tcp)
  2. Update the public IP with CIDR IPs: clc server update-public-ip-address --server-name --public-ip --ports port=4040,protocol=udp --source-restrictions "CIDR=xx.xx.xx.xx/32"

if you add multiple CIDR (basically a list) it only sends the last item listed to the API

richardcase commented 7 years ago

Sure, I'll take a look.

richardcase commented 7 years ago

I had a look at this and you can specify multiple CIDR as source restrictions. I used the following command:

clc server update-public-ip-address --server-name MYSERVERNAME --public-ip xxx.xxx.xxx.xxx --ports port=80,protocol=tcp --source-restrictions "CIDR=70.100.60.140/32" "CIDR=71.100.60.0/24"

chrislittle commented 7 years ago

@richardcase so the space vs. a comma was the trick.

I was issuing clc server update-public-ip-address --server-name MYSERVERNAME --public-ip xxx.xxx.xxx.xxx --ports port=80,protocol=tcp --source-restrictions "CIDR=70.100.60.140/32","CIDR=71.100.60.0/24"

should we maybe put something in the code as the command is accepted with a comma but doesn't do anything but the last ip listed. not what we should have I'd think.

richardcase commented 7 years ago

That's a good point. I'll see what I can do.