Hetzner - DokuWiki

Cloud IP static/en
(Fedora / CentOS)
(Debian/Ubuntu)
Zeile 5: Zeile 5:
 
== Debian/Ubuntu ==
 
== Debian/Ubuntu ==
  
 +
=== ifup ===
 
edit of /etc/network/interfaces
 
edit of /etc/network/interfaces
 
<pre>auto eth0
 
<pre>auto eth0
Zeile 16: Zeile 17:
  
 
iface eth0 inet6 static
 
iface eth0 inet6 static
         address <one IPv6 address from your subnet, e.g. 2a01:4f8:0:3df1::1>
+
         address <one IPv6 address from your subnet, e.g. 2001:db8:0:3df1::1>
 
         netmask 64
 
         netmask 64
 
         gateway fe80::1
 
         gateway fe80::1
 
</pre>
 
</pre>
 +
 +
=== netplan ===
 +
 +
Edit /etc/netplan/01-netcfg.yml
 +
<pre>
 +
network:
 +
  version: 2
 +
  renderer: networkd
 +
  ethernets:
 +
    eth0:
 +
      dhcp4: yes
 +
      dhcp6: no
 +
      addresses:
 +
        - <one IPv6 address from your subnet, e.g. 2001:db8:0:3df1::1>/64
 +
      gateway6: fe80::1
 +
</pre>
 +
 +
=== disable cloud-init network changes ===
 +
 
Add file /etc/cloud/cloud.cfg.d/98-disable-network.cfg
 
Add file /etc/cloud/cloud.cfg.d/98-disable-network.cfg
 
<pre>network:
 
<pre>network:

Version vom 19. September 2018, 05:51 Uhr

Inhaltsverzeichnis

Static IP configuration (Cloud)

Debian/Ubuntu

ifup

edit of /etc/network/interfaces

auto eth0
iface eth0 inet static
        address <your IPv4 address>
        netmask 255.255.255.255
        gateway 172.31.1.1
        pointopoint 172.31.1.1
        dns-nameservers 213.133.98.98 213.133.99.99 213.133.100.100


iface eth0 inet6 static
        address <one IPv6 address from your subnet, e.g. 2001:db8:0:3df1::1>
        netmask 64
        gateway fe80::1

netplan

Edit /etc/netplan/01-netcfg.yml

network:
  version: 2
  renderer: networkd
  ethernets: 
    eth0:
      dhcp4: yes
      dhcp6: no
      addresses: 
        - <one IPv6 address from your subnet, e.g. 2001:db8:0:3df1::1>/64
      gateway6: fe80::1

disable cloud-init network changes

Add file /etc/cloud/cloud.cfg.d/98-disable-network.cfg

network:
  config: disabled

Execute the following command

rm /etc/network/interfaces.d/50-cloud-init.cfg

Fedora / CentOS


edit of /etc/cloud/cloud.cfg.d/98-disable-network.cfg

network:
  config: disabled


edit of /etc/sysconfig/network-scripts/ifcfg-eth0

BOOTPROTO=static
DEVICE=eth0
HWADDR=<keep the HWADDR as is!>
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPADDR=<your IPv4 address>
NETMASK=255.255.255.255
DNS1=213.133.98.98
DNS1=213.133.99.99


edit of /etc/sysconfig/network-scripts/route-eth0

172.31.1.1/32 dev eth0
default via 172.31.1.1 dev eth0


© 2019. Hetzner Online GmbH. Alle Rechte vorbehalten.