Skip to content

Instantly share code, notes, and snippets.

@zestrada
Created March 13, 2013 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zestrada/5153135 to your computer and use it in GitHub Desktop.
Save zestrada/5153135 to your computer and use it in GitHub Desktop.
Openstack public IP example
I've got a floating ip configured and associated with my instance:
zak@logging:~$ nova floating-ip-list
+------------+--------------------------------------+-------------+------+
| Ip | Instance Id | Fixed Ip | Pool |
+------------+--------------------------------------+-------------+------+
| 10.10.11.1 | e5e3bf5f-37fb-426b-8d97-1bcb600d0505 | 192.168.3.2 | nova |
+------------+--------------------------------------+-------------+------+
root@logging:~# nova-manage floating list | head -1
c5039c683ff8486c8944f7d2a7145497 10.10.11.1 e5e3bf5f-37fb-426b-8d97-1bcb600d0505 nova eth0
which I can successfully connect to:
zak@logging:~$ ssh 10.10.11.1 "hostname"
test
However, nova doesn't seem to 'recognize it' as a public IP address:
zak@logging:~$ nova ssh test
ERROR: No public addresses found for 'test'.
@zestrada
Copy link
Author

Interestingly enough, I can't ping google.com or access any outside hosts from the guest with the floating ip assigned. DNS still resolves, but traceroutes don't get past the first hop (192.168.3.1 on the hypervisor).

@zestrada
Copy link
Author

Turns out the the connectivity issue was just the router's netmask. I'm still unsure of how to get nova to recognize my IP as 'public. ' I tried grepping through the installed python client libs for the error message, but I'm probably looking on the wrong side of the API.

@zestrada
Copy link
Author

Creating a pool called 'public' had no effect either:

zak@logging:~$ nova floating-ip-create public
+------------+-------------+----------+--------+
| Ip         | Instance Id | Fixed Ip | Pool   |
+------------+-------------+----------+--------+
| 10.10.12.1 | None        | None     | public |
+------------+-------------+----------+--------+

zak@logging:~$ nova add-floating-ip test 10.10.12.1
+--------------------------------------+------+--------+-------------------------------------------------+
| ID                                   | Name | Status | Networks                                        |
+--------------------------------------+------+--------+-------------------------------------------------+
| e5e3bf5f-37fb-426b-8d97-1bcb600d0505 | test | ACTIVE | novanetwork=192.168.3.2, 10.10.11.1, 10.10.12.1 |
+--------------------------------------+------+--------+-------------------------------------------------+
zak@logging:~$ nova ssh test
ERROR: No public addresses found for 'test'.

@zestrada
Copy link
Author

I have looked at this:

zak@logging:~$ nova ssh -h
usage: nova ssh [--port PORT] [--private] [--ipv6] [--login <login>]
                [-i IDENTITY]
                <server>

SSH into a server.

Positional arguments:
  <server>              Name or ID of server.

Optional arguments:
  --port PORT           Optional flag to indicate which port to use for ssh.
                        (Default=22)
  --private             Optional flag to indicate whether to use private
                        address attached to an instance. (Default=False)
  --ipv6                Optional flag to indicate whether to use an IPv6
                        address attached to an instance. (Defaults to IPv4
                        address)
  --login <login>       Login to use.
  -i IDENTITY, --identity IDENTITY
                        Private key file, same as the -i option to the ssh
                        command.

And tried --private, specifying the uuid, and specifying the key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment