Static NAT and Dynamic NAT

scharles

New Member
Dec 10, 2024
1
0
1
Hi all I hope that anyone could give me a hand. I already have configured a Dynamic NAT (many to one mapping) using the physical IP address of my proxmox box, what I would like to add it's an additional static NAT (one to one mapping), so one of the VM running on proxmox will appear as directly connected to the network.

My current config it's the following:
network card: wlo1 IP address: 192.168.0.254/24 Natted vmbr1: 192.168.52.254/24
What I would like it's to have vmNatted with 192.168.0.253/24 as example.

My config it's the following:
auto wlo1
iface wlo1 inet static
address 192.168.0.254/24
gateway 192.168.0.1

auto vmbr1
iface vmbr1 inet static
address 192.168.52.254/24
bridge-ports none
bridge-stp off
bridge-fd 0
bridge-vlan-aware yes
bridge-vids 2-4094
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 192.168.52.0/24 -o wlo1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 192.168.52.0/24 -o wlo1 -j MASQUERADE


Thanks if advanced for the help