Proxmox + Hetzner +Additional IP: networking problems

Puzzola

Member
Jul 2, 2020
1
0
21
49
Hi,
I've a Proxmox 7.4-17 Server on a dedicate Hetzner server with this networking config:

auto enp7s0
iface enp7s0 inet static
address 167.xxx.xxx.70/26
gateway 167.xxx.xxx.65
up route add -net 167.xxx.xxx.64 netmask 255.255.255.192 gw 167.xxx.xxx.65 dev enp7s0

auto vmbr0
iface vmbr0 inet static
address 192.168.254.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.254.0/24' -o enp7s0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.254.0/24' -o enp7s0 -j MASQUERADE

# I added this 'cause i need to portforward 9000 port to connect a service to 200 VM from remote.

post-up iptables -t nat -A PREROUTING -i enp7s0 -p tcp --dport 9000 -j DNAT --to 192.168.254.3:9000
post-down iptables -t nat -D PREROUTING -i enp7s0 -p tcp --dport 9000 -j DNAT --to 192.168.254.3:9000


200 VM (Windows...) has a net card Virtio on the vmbr Bridge with IP 192.168.254.3.

All this it's working fine.
VM 200 is reachable on 9000 port from outside, can communicate on the internal net (192.168.254.0/24) and it has internet connection.

On the enp7s0 card i added a extra IP (167.xxx.xxx.68) with a different Mac address.
I need to use this IP for a Container to be reachable from outside.

I tried some configuration using a vmbr1 but when i have the right connection on the container i loose outgoing connectivity from the VM.

Can you suggest me how to correctly configure that networking?

Thanks.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, 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 yours easily in our online shop.

Buy now!