Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


please help me in configuring network statically on hetzner dedi
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

please help me in configuring network statically on hetzner dedi

marsonmarson Member

Hello

Is it possible to configure my network statically without using an DHCP on hetzner dedicated server? My
software complains that this ins not an optimal to use DHCP. I tried following
this guide

https://wiki.hetzner.de/index.php/Netzkonfiguration_CentOS/en

and my configuration files look like this:
/etc/sysconfig/network-scripts/ifcfg-eth0

                            DEVICE=eth0
                            HWADDR=xxxxx
                            ONBOOT=yes
                            BOOTPROTO=static
                            IPADDR=MY_SERVER_IP
                            NETMASK=255.255.255.255
                            SCOPE="peer GATEWAY"

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

ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=GATEWAY

I also tried the folllowing variants

DEVICE=eth0
HWADDR=xxxx
ONBOOT=yes
BOOTPROTO=static
IPADDR=MY_SERVER_IP
NETMASK=255.255.255.224
SCOPE="peer GATEWAY"

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

ADDRESS0=MY_SERVER_IP
NETMASK0=255.255.255.224
GATEWAY0=GATEWAY

and none work for me. I cannot ping any IP or host but as soon as I change to use
DHCP everything works fine.

Comments

  • seanhoseanho Member

    Have you tried DEFROUTE=yes and GATEWAY=<my_gw> in ifcfg-eth0, and nothing in route-eth0? I think you'll want the *.224 netmask.

    What does your ip ad say if you use DHCP? Does it configure the link scope to only peer with the gateway, or global scope?

    I installed debian using their installer, and it uses a static address, global scope, on a /27; very standard config.

  • FrankZFrankZ Veteran

    Excuse me if wrong o/s.

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

    [gateway ip] dev eth0
    default via [gateway ip] dev eth0

  • marsonmarson Member
    edited July 2018

    Problem solved by using their installimage script, firstly I use VNC and when using installimage I have static IP configured and here is my config for reference:

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

    ### Hetzner Online GmbH installimage
    
    DEVICE=eth0
    ONBOOT=yes
    BOOTPROTO=none
    IPADDR=148.251.xxx.xxx
    NETMASK=255.255.255.255
    SCOPE="peer GATEWAY"
    
    IPV6INIT=yes
    IPV6ADDR=2a01:4f8:xxx:xxxx::2/64
    IPV6_DEFAULTGW=fe80::1
    IPV6_DEFAULTDEV=eth0
    
     /etc/sysconfig/network-scripts/route-eth0
    ### Hetzner Online GmbH installimage
    
    ADDRESS0=0.0.0.0
    NETMASK0=0.0.0.0
    GATEWAY0=148.251.153.1
    
    Thanked by 2szarka MasonR
Sign In or Register to comment.