NAT One IP address configuration

Ridge

New Member
Sep 26, 2018
3
0
1
27
Hi all!

I've been since a couple of days trying to configure NAT in my Proxmox VE. I've followed some steps here and other tutorials on the internet but I couldn't get it work.

I can ping my VM from my PVE succesfuly but I don't have connection from my VM to the PVE or to the internet. Here is my /etc/network/interfaces PVE machine configuration:

Code:
auto lo
iface lo inet loopback

allow-hotplug eno1

auto eno1
iface eno1 inet manual

iface eno2 inet manual

#Public interface
auto vmbr0
iface vmbr0 inet static
        address 1.1.1.2
        netmask 255.255.255.0
        gateway 1.1.1.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 192.168.250.1
        netmask 255.255.255.0
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -D POSTROUTING -s '192.168.250.0/24' -o vmbr0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.250.0/24' -o vmbr0 -j MASQUERADE[/

I have set the vmbr1 to the VM with another IP in the same range of the PVE vmbr network and set the PVE IP as gateway.

Am I missing something? Is there another way to do this? I appreciate your help and thank you advance.

Regards!
 
https://pve.proxmox.com/wiki/Network_Configuration
Code:
post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eno1 -j MASQUERADE
Example from the wiki. Check your iptables, you delete the rule twice.
 
I can't believe it, I miss the A!

Thank you so much! Now is working perfectly.
 

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!