Hetzner vswitch and Proxmox

Discussion in 'Proxmox VE: Networking and Firewall' started by Petar Kozic, Nov 6, 2018.

  1. Petar Kozic

    Petar Kozic New Member

    Nov 6, 2018
    Likes Received:
    Hi folks,
    I'm using several dedicated server with Proxmox, all server was at Hetzner. On all that server I have added additional IP subnet and DHCP (isc-dhcp) and everything works.

    Now I want to use Hetzner vswitch because there I can add several IP subnet in same VLAN.
    In anyway I have problem with configuration.

    I do everything by manual from Hetzner. On fresh installed proxmox server by default I have this settings:

    ### Hetzner Online GmbH installimage
    source /etc/network/interfaces.d/*
    auto lo
    iface lo inet loopback
    iface lo inet6 loopback
    auto enp2s0
    iface enp2s0 inet static
      address 78.46.xxx.xxx
      netmask 255.255.xxx.xxx
      gateway 78.46.xxx.xxx
      #route 78.46.xxx.xxx via 78.46.xxx.xxx
      up route add -net 78.46.xxx.xxx netmask 255.255.xxx.xxx gw 78.46.xxx.xxx dev enp2s0
    iface enp2s0 inet6 static
      address 2a01:4f8:xxx:xxx::x
      netmask xx
      gateway fexx::1
    Then by Hetzner manual I need to add subnet on vswitch over they robot interface and need to assign some vlan ID. That is done.

    Than I need to do next:

    Example configuration for the network card "enp0s31f6", with the VLAN ID 4000

    Create a VLAN device

    ip link add link enp0s31f6 name enp0s31f6.4000 type vlan id 4000
    ip link set enp0s31f6.4000 mtu 1400
    ip link set dev enp0s31f6.4000 up
    Configure IP address from the private subnet

    ip addr add brd dev enp0s31f6.4000
    Public subnet You need to create an additional routing table for the public subnet so you can configure another default gateway.

    Example configuration for IP from the public subnet, interface enp0s31f6.4000

    echo "1 vswitch" >> /etc/iproute2/rt_tables
    ip addr add dev enp0s31f6.4000
    ip rule add from lookup vswitch
    ip rule add to lookup vswitch
    ip route add default via dev enp0s31f6.4000 table vswitch

    Example Debian configuration

    Interface enp0s31f6, VLAN 4000, private network
    # /etc/network/interfaces
    auto enp0s31f6.4000
    iface enp0s31f6.4000 inet static
      vlan-raw-device enp0s31f6
      mtu 1400

    When I did it, I just added vmbr0 interface

    auto vmbr0
    iface vmbr0 inet static
      bridge_ports enp2s0.4000
            bridge_stp off
            bridge_fd 0
    When I create and install ubuntu on Proxmox and assign this IP (this is from manual, example IP, not real) I can ping everything but I can't do apt-get update or curl. DNS resolve hostname but not traffic.

    When I do traceroute from my computer to they finish without problem.
    When I try to connect over ssh, I can connect and login, but if I try to do something stop responding, on example top or ps aux.
    DerDanilo likes this.
  2. DerDanilo

    DerDanilo Member

    Jan 21, 2017
    Likes Received:

    I'm gonna have a project where I will have time to play with the Hetzner vSwitches soon.

    Did you enable forwarding on the host? Not sure if it it's really required with this setup but it's still the same NIC, hence it might be required.
  3. Petar Kozic

    Petar Kozic New Member

    Nov 6, 2018
    Likes Received:
    Hi @DerDanilo
    thank you on your answer. Yes I setup that.

    Indeed, I found problem. Problem was in mtu. Because vlan interface enp2s0.4000 have mtu 1400
    I need to setup same mtu on VM interfaces. Because I handle IP assign with isc-dhcp-server I also send mtu over DHCP and evertyhing works.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice