How to easily reroute traffic between servers running Proxmox VMs

Last weekend I ran into a lack of IP addresses to test something on my SYS box (176.31.102.105). But I did not want to buy additional IP addresses just for testing, as these would have increased my monthly cost (I know I am very greedy). I had an IP address (5.39.19.229) left on my OVH VPS (213.32.31.12) that I use for monitoring. So I decided to recycle this address. How ever it is not possible to move addresses from OVH servers to SYS / Kimsufi servers, so I needed a workaround.

Box 1 (monitoring)

Tunnel Setup

Routing

Box 2 (SYS server)

Tunnel Setup

Tunnel bridge

Why I use a bridge? I want to use this IP address directly in a virtual machine. This is also the reason why I needed to use a gretap tunnel insteaed of a gre tunnel. Only gretap tunnels seem to support bridging. So my Proxmox configuration for this virtual machine looks like this:

Simple? Yup. You do not even need to care about the MAC address. Just get the bridge interface right and you’re all set (well almost).

Next step is the configuration of the virtual machine:

Bring the interface up and the VM should start pinging. Simple, isn’t it? Well, not exactly.

Debugging

I noticed that the SSH connection is very laggy and freezes pretty pretty much instantly. I was able to do an iperf test at some point (right before the connection timed out again):

Something seems very wrong.

Let’s check the interface configuration on the virtual machine:

and compare it to the configuration of the tunnel on the host:

Wrong MTU on the VM. Add the MTU to the network config:

A new iperf test looks fine:

Making this permanently

Add a new interface on the VPS:

Enable IPv4 packet forwarding permanently:

Add new interfaces on the Proxmox host (untested because server is in production, but it should™ work):

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.