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.
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.