Configuring Network Connectivity

With the instance up and running, we now need to configure network access to it. This is a two-step process: first, we need to permit traffic to the instance, and then we need to associate a public IP address to it. Without configuring network access to it, you won’t be able to access it from outside of the Nova. In this example, we will permit SSH (TCP port 22) and ICMP traffic to our instance from any IP address.

# euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
GROUP default
PERMISSION default ALLOWS tcp 22 22 FROM CIDR 0.0.0.0/0
# euca-authorize default -P icmp -t -1:-1
GROUP default
PERMISSION default ALLOWS icmp -1 -1

Note

Realize that we’ve only permitted basic access to the instance. If you want to communicate with the server beyond ping and SSH, you’ll need to authorize additional ports. For example, to allow for web server traffic, you will need to authorize TCP port 80.

With traffic permitted to the instance, we now need to assign a public address to it. This is also a two-step process: allocate an address and then associate it to our instance.

# euca-allocate-address
ADDRESS    192.168.1.128
# euca-associate-address -i i-00000001 192.168.1.128
ADDRESS    192.168.1.128 i-00000001
# nova list
+----+----------+--------+---------------+------------+
| ID |   Name   | Status |   Public IP   | Private IP |
+----+----------+--------+---------------+------------+
| 1  | Server 1 | ACTIVE | 192.168.1.128 | 10.0.0.2   |
+----+----------+--------+---------------+------------+

Caution

Public addressing operates differently on Nova than on Amazon EC2. EC2 automatically assigns each instance a public and private address (floating and fixed addresses in Nova). Nova automatically assigns a private address but requires manual allocation of a public address.