Hetzner - DokuWiki

Cloud IP static/en
(Static IP configuration (Cloud))
(Fedora / CentOS)
Zeile 46: Zeile 46:
 
  rm /etc/network/interfaces.d/50-cloud-init.cfg
 
  rm /etc/network/interfaces.d/50-cloud-init.cfg
  
== <span class="mw-headline" id="Fedora_.2F_CentOS">Fedora / CentOS</span> ==
+
== Fedora / CentOS ==
 
+
----
+
  
 
edit of /etc/cloud/cloud.cfg.d/98-disable-network.cfg
 
edit of /etc/cloud/cloud.cfg.d/98-disable-network.cfg
Zeile 73: Zeile 71:
 
<pre>172.31.1.1/32 dev eth0
 
<pre>172.31.1.1/32 dev eth0
 
default via 172.31.1.1 dev eth0</pre>
 
default via 172.31.1.1 dev eth0</pre>
 +
 +
== FreeBSD ==
 +
 +
edit /etc/rc.conf
 +
 +
<pre>
 +
ifconfig_vtnet0="inet <your IPv4 address>/32"
 +
static_routes="hetzner_cloud_gw"
 +
route_hetzner_cloud_gw="172.31.1.1/32 -iface vtnet0"
 +
defaultrouter=“172.31.1.1”
 +
ifconfig_vtnet0_ipv6="inet6 <one IPv6 address from your subnet, e.g. 2001:db8:0::1>/64"
 +
ipv6_defaultrouter="fe80::1%vtnet0”
 +
</pre>
  
 
[[Kategorie:Cloud]]
 
[[Kategorie:Cloud]]
 
[[Kategorie:Hetzner Cloud]]
 
[[Kategorie:Hetzner Cloud]]

Version vom 25. Oktober 2018, 07:22 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
DNS2=213.133.99.99
IPV6ADDR=<one IPv6 address from your subnet, e.g. 2001:db8:0:3df1::1>/64
IPV6INIT=yes
IPV6_DEFAULTGW=fe80::1%eth0
IPV6_DEFAULTDEV=eth0

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

172.31.1.1/32 dev eth0
default via 172.31.1.1 dev eth0

FreeBSD

edit /etc/rc.conf

ifconfig_vtnet0="inet <your IPv4 address>/32"
static_routes="hetzner_cloud_gw"
route_hetzner_cloud_gw="172.31.1.1/32 -iface vtnet0"
defaultrouter=“172.31.1.1”
ifconfig_vtnet0_ipv6="inet6 <one IPv6 address from your subnet, e.g. 2001:db8:0::1>/64"
ipv6_defaultrouter="fe80::1%vtnet0”


© 2019. Hetzner Online GmbH. Alle Rechte vorbehalten.