routing additional ip to Ubuntu guest machine

sepano

New Member
Nov 4, 2019
1
0
1
34
Hi
I have an additional IP on my Hetzner server with Proxmox that I want to route it to an Ubuntu guest machine

Here is my network configuration on Host and Guest machine

My guest machine is Ubuntu 18.04
And configurations don't work

My PVE Host net config:
Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
        address  77.77.77.241
        netmask  255.255.255.192
        gateway  77.77.77.193
        pointopoint 77.77.77.193
        up route add -net 77.77.77.192 netmask 255.255.255.192 gw 77.77.77.193 dev enp0s31f6
        post-up echo 1 > /proc/sys/net/ipv4/conf/enp0s31f6/proxy_arp
# route 77.77.77.192/26 via 77.77.77.193

auto vmbr0
iface vmbr0 inet static
  address 77.77.77.241
  netmask 255.255.255.192
  bridge_ports none
  bridge_stp off
  bridge_fd 0
  bridge_maxwait 0
  up route add -host 77.77.77.242 dev vmbr0
My Ubuntu VM net config:
Code:
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    renderer: networkd
    ethernets:
        ens18:
            addresses:
            - 77.77.77.242/26
            dhcp4: no
            dhcp6: no
            gateway4: 77.77.77.193
            routes:
            - to: 0.0.0.0/0
              via: 77.77.77.193
              on-link: true
            nameservers:
                addresses:
                - 8.8.8.8
                - 4.2.2.4
I also Created a file called /etc/sysctl.d/99-networking.conf and inserted the following contents

Code:
net.ipv4.ip_forward=1

net.ipv4.conf.enp0s31f6.send_redirects=0

net.ipv6.conf.all.forwarding=1
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE and Proxmox Mail Gateway. We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!