Hetzner - DokuWiki

Cloud Networks Configuration/en

Inhaltsverzeichnis

Hetzner Cloud Networks Configuration

Installation of the auto-configuration package

Download the latest version of `hc-utils` for your OS and your architecture on: https://packages.hetzner.com/hcloud/

On Debian based distributions (Ubuntu, Debian):

curl https://packages.hetzner.com/hcloud/deb/hc-utils_0.0.1-1_all.deb -o /tmp/hc-utils_0.0.1-1_all.deb -s
apt install -f /tmp/hc-utils_0.0.1-1_all.deb

On RHEL based distributions:

CentOS 7

curl https://packages.hetzner.com/hcloud/rpm/hc-utils-0.0.1-1.el7.noarch.rpm -o /tmp/hc-utils-0.0.1-1.el7.noarch.rpm -s
yum install /tmp/hc-utils-0.0.1-1.el7.noarch.rpm

Fedora 29

curl https://packages.hetzner.com/hcloud/rpm/hc-utils-0.0.1-1.fc29.noarch.rpm -o /tmp/hc-utils-0.0.1-1.fc29.noarch.rpm -s
yum install /tmp/hc-utils-0.0.1-1.fc29.noarch.rpm

Fedora 30

curl https://packages.hetzner.com/hcloud/rpm/hc-utils-0.0.1-1.fc30.noarch.rpm -o /tmp/hc-utils-0.0.1-1.fc30.noarch.rpm -s
yum install /tmp/hc-utils-0.0.1-1.fc30.noarch.rpm

Uninstall auto-configuration package

On Debian based distributions (Ubuntu, Debian):

apt remove hc-utils

On RHEL based distributions (Fedora, CentOS):

yum remove hc-utils

Manual configuration via DHCP

On Debian based distributions (Ubuntu, Debian):

The interface for the network will be named `ens10` for the first attached network, `ens11` for the second and `ens12` for the third.

1. Access the server via SSH

2. Create the configuration file and open an editor

touch /etc/network/interfaces.d/61-my-private-network.cfg
nano /etc/network/interfaces.d/61-my-private-network.cfg

3. Paste the following configuration into the editor

auto ens10:0
iface ens10:0 inet dhcp

4. Now you should restart your network. *Caution: This will reset your network connection*

sudo service networking restart

On RHEL based distributions (Fedora, CentOS):

The interfaces will be named `eth1`,`eth2` and `eth3`.

1. Access the server via SSH

2. Create the configuration file and open an editor

touch /etc/sysconfig/network-scripts/ifcfg-eth1
vi /etc/sysconfig/network-scripts/ifcfg-eth1

3. Paste the following configuration into the editor

DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=yes

4. Now you should restart your network. *Caution: This will reset your network connection*

systemctl restart network

Manual configuration of alias IPs

On Debian based distributions (Ubuntu, Debian):

1. Access the server via SSH

2. Create the configuration file and open an editor

touch /etc/network/interfaces.d/61-my-private-network.cfg
nano /etc/network/interfaces.d/61-my-private-network.cfg

3. Paste the following configuration into the editor and replace `your.ali.as.IP` with one of the alias IPs. Keep in mind to increase the identifier by one when using more alias IPs.

auto ens10:1
iface ens10:1 inet static
   address your.ali.as.IP
   netmask 32

4. Now you should restart your network. *Caution: This will reset your network connection*

sudo service networking restart

On RHEL based distributions:

The interfaces will be named `eth1`,`eth2` and `eth3`.

1. Access the server via SSH

2. Create the configuration file and open an editor

touch /etc/sysconfig/network-scripts/ifcfg-eth1:0
vi /etc/sysconfig/network-scripts/ifcfg-eth1:0

3. Paste the following configuration into the editor and replace `your.ali.as.IP` with one of the alias IPs. Keep in mind to increase the identifier by one when using more alias IPs.

BOOTPROTO=static
DEVICE=eth1:0
IPADDR=your.ali.as.IP
PREFIX=32
TYPE=Ethernet
USERCTL=no
ONBOOT=yes

4. Now you should restart your network. *Caution: This will reset your network connection*

systemctl restart network


© 2019. Hetzner Online GmbH. Alle Rechte vorbehalten.