Connect your virtual machine to the Internet via the web
- Summary
- This tutorial shows you how to create a security group, manage its rules, and assign them and a public IP address to a virtual machine.
- Internet
- https://pouta.csc.fi
flowchart LR
A(Log in to<br>my.csc.fi) --> B(Select Network and 'Security Groups')
B --> C(Create and name a security group)
C --> D(Manage rules)
D --> E{Create<br>another}
E -->|Yes| C
E -->|No| F(Allocate public IP address)
F --> G(Associate the IP)
G --> H(Apply SSH Security rule)
Prerequisites
- An existing virtual machine in the cPouta. Create a virtual machine in cPouta over the web
Procedure
The procedure is divided into three steps:
1. Create a security group
2. Allocate a public IP
3. Apply the security group and the IP to the virtual machine.
Let's start by creating a security group.
Create Security Group
Sign in to cPouta. Select 'Security Groups' from the Network menu on the left.
Click the ' Create Security Group' button.
Enter a name for your security group and click the 'Create Security Group'
button.
If you want to try it yourself:
Create another security group and name it to HTTP.
Click the 'Manage Rules' button at the far right of the security group row.
By default, all security groups contain an egress rule that allows traffic from the virtual machine to the Internet.
Add a new rule to allow inbound (ingress) traffic.
Select SSH rule . Define remote as CIDR
and allow traffic from anywhere (
0.0.0.0/0
).
Accept the rule by clicking the Add button.
Note the newly created rule .
You can return to the list of security groups by clicking 'Security Groups' in the Network menu on the left.
If you like, you can try it out for yourself:
Create a rule in the HTTP security group to allow traffic to port 80 from the Internet.
Then we'll move on to a public IP address.
Reserve floating IP
Select 'Floating IPs' from the Network menu on the left.
Click on ' Allocate IP To Project' .
Enter the purpose of the public IP in the description field, if you wish, and click on 'Allocate IP' .
Check the IP address allocated to you.
Info
This is a unique, public IPv4 address that can be used to connect the virtual machine from anywhere, if security rules allow.
Tip
It is possible to associate the public IP with a virtual machine from this view, but in this tutorial we will show another way.
Apply configurations
Next, let's assign the SSH security rule and the IP address to the virtual machine.
Return to the Compute -> Instances view. Select 'Associate Floating IP' from the drop down menu.
Check that the public IP address is selectable and that it is associated with the virtual machine's private IP address
.
Click on 'Associate' .
The instance view should be updated with the associated public IP address .
Next, select 'Edit Security Groups' from the drop down menu.
On the left you can see the available security groups and on the right the ones in effect.
Click on the next to SSH security group to add the SSH rule to your virtual machine.
Save the changes using the Save button.
Tip
You can remove a security rule (deny access) by clicking sign next to the group name in the 'Instance Security Groups' list.
That's it!
Your virtual machine is now accessible from the Internet.
And again, if you like:
Make your virtual machine available for HTTP requests.
Further Learning
Here are some suggestions for what to read next: