Skip to content

Instantly share code, notes, and snippets.

@marcaurele
Last active November 21, 2017 07:14
Show Gist options
  • Save marcaurele/363c9deb42ecfbb55e9eb04bd1605bed to your computer and use it in GitHub Desktop.
Save marcaurele/363c9deb42ecfbb55e9eb04bd1605bed to your computer and use it in GitHub Desktop.
Private Networking feature through the API for Exoscale

Private Network Exoscale CloudStack guide

User guide

Requirements check

Your account should have been granted access to privnet. Check that you have at least one network with this command:

cs listNetworks type=isolated

Add extra NIC to a VM

The network id value is needed to attach a new NIC to your VM with this call:

cs addNicToVirtualMachine networkid=<network_id> virtualmachineid=<vm_id>

If all works out, you should have a new interface on the pci slot 07 (ens7 on Ubuntu), you can configure the new interface like that:

sudo ip addr add 10.0.0.1/24 dev ens7
sudo ip link set ens7 up

Or you can create a configuration file to keep the interface configured between reboot:

# For Ubuntu 16.04 which names network interface as ensX
sudo -i
cat <<EOF > /etc/network/interfaces.d/privnet.cfg
auto ens7
iface ens7 inet static
address 10.0.0.1/24
EOF
ifup ens7

Remove nic from VM

To remove the extra nic, just run:

cs removeNicFromVirtualMachine nicid=<nic_id> virtualmachineid=<vm_id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment