This tutorial will teach you how to setup an extra port (IPv6) with Netplan
This tutorial will show how to configure the Public6 port, when you want to manual add IPv6 to your machine. For IPv4 check the other tutorial.
- Fuga Cloud Account
- An SSH key is known by the Fuga Cloud API
- A compute instance
- A second port, connected to the Public6 network
When a compute instance is created with an extra port, this one is already configured.
Step 1: Check if the port is added to your machine
Some operating systems (OS) will not automatically recognize an added virtual interface port (VIP). It’s important to check if the chosen OS has the new assigned VIP.
- Log into your instance with your SSH key
- Fill in the next command:
Note: The VIP name can be different on your system, in this example above it's possible to see 'ens3' and 'ens7'. In your case, for example, this could be 'ens2' and 'ens5'.
In the above output you see two VIPs:
- The port "ens3" has an IPv4 address assigned.
- The port "ens7" has nothing assigned.
This means that the VIP has not been set up.
Step 2: configure the extra port
To configure the extra port, the config file of Netplan has to be changed. A normal configuration of Netplan should look like this:
Open the configuration file with:
Add the following extra lines for ens7 (ens7 is in our example the extra VIP):
- <IPv6 from dashboard by instance>
macaddress: <mac address from port in dashboard / ip a>
- to: ::/0
via: <network gateway IPv6 of Public6>
Step 3: Check the configuration and apply it
To check if the configuration is correct we execute the following:
sudo netplan try
If there is an error, Netplan will give an error message. If there is no error it will apply the current settings. After applying, check if the applications running on your machine are still working and click ENTER to apply the configuration.
If the timer runs out (120 seconds) it will revert the settings back to the previous configuration if possible. To apply the settings:
sudo netplan apply
Step 4: Check if the port has an IP address assigned
When you run the command 'ip a' again the IP address will show up in ens7.
After you followed this tutorial you have configured a port to have an IPv6 address assigned through manual configuration.