Novice with network, how setup port 80?

StealthFantom2

New Member
Jun 20, 2024
23
0
1
Hi all,
sorry I´m novice with Proxmox. Created a VM with Debian 12, installed what I want, at Datacenter configured the Firewall. But can´t open the webserver port 80 and 443 in VM.

I find this on internet:
Code:
iptables -t nat -A PREROUTING -p tcp -d 175.*.censure.* --dport 80 -i vmbr0 -j DNAT --to-destination 192.168.10.100:80

This run on SSH Promox server? Whats next?
How FIX the IP for the VM1?

My config yet:
Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.0.150/24
        gateway 192.168.0.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0

iface eno2 inet manual

iface eno3 inet manual

iface eno4 inet manual
 
Last edited:
do you want configure the IP of your VM1?
Go to your VM1->edit->/etc/network/inetrfaces
Code:
auto lo
iface lo inet loopback

auto ens18 #interface of your VM
iface ens18 inet static
    address 192.168.0.151/24
    gateway 192.168.0.1

if you want a NAT, i think you need to add a new vmbr
 
Last edited:
do you want configure the IP of your VM1?
Go to your VM1->edit->/etc/network/inetrfaces
Code:
auto lo
iface lo inet loopback

auto ens18 #interface of your VM
iface ens18 inet static
    address 192.168.0.151/24
    gateway 192.168.0.1

if you want a NAT, i think you need to add a new vmbr

Like this? Or delete that DHCP?

I created a vmbr1, but when want to set for VPS1 then: error message is: bridge 'vmbr1' does not exist.
 

Attachments

  • hihiii.jpg
    hihiii.jpg
    55.1 KB · Views: 7
Last edited:
i'm not sure i understand what you are trying to do,
if you have dhcp you don't need to configure your VM IP
are you doing NAT inside your VM?

if you need vmbr1 NAT bridge it should look like this: https://pve.proxmox.com/wiki/Network_Configuration
proxmox host /etc/network/interfaces
Code:
auto vmbr1
iface vmbr1 inet static
        address 192.168.10.254/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.10.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
# after for a specific rule i don't know
iptables -t nat -A PREROUTING -p tcp -d 175.*.censure.* --dport 80 -i vmbr0 -j DNAT --to-destination 192.168.10.100:80

inside VM
Code:
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
    address 192.168.10.100
    gateway 192.168.10.254 # bridge IP
 
Last edited:
I only need a setup a webserver with port 80 and 443 in VPS1. But not clear how that DHCP works or what routing there... :/ (I have only 1 dedicated IP adress from ISP)

After set these 2:
1718904023134.png
1718904193922.png
 
Last edited:
your linux bridge isn't active
check the box autostart maybe
1718906435591.png
1718906278272.png

after the bridge is created, your bridge IP will be the gateway inside your VM
 
Last edited:
this should add a new vmbr, In Your proxmox Host
under: /etc/network/interfaces
Code:
auto vmbr1
iface vmbr1 inet static
        address 192.168.10.254/24 #address ip you want
        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.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
u can have more than 1 bridge with single cable or interface
what is your current config une /etc/network/interface
 
Last edited:
Okey, without restart can´t load, yet work the vmbr1. I set the config on host like this:
1718908669998.png

After POSTROUTING the IP is good?
 
yeah look good
i forgot: ' '
on the first POSTROUTING

you can use systemctl restart networking to restart proxmox network
 
Last edited:
Still not working xD
vmbr0 in postrouting?

I slowly giving up... Watching few days, few hours of videos but not help any video. It´s crazy... Why not easier by clicking in Proxmox and voala!
 
Last edited:
it should work flawless
yes vmbr0 in POSTROUTING
is vmbr1 activated now ?
do vmbr0 have internet ?
can you reach/ping your primary gateway inside proxmox host?

your config look like this now?
Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.0.150/24
        gateway 192.168.0.1
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
 
auto vmbr1
iface vmbr1 inet static
        address 192.168.10.254/24 #address ip you want
        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.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

#if everything work add rule my ssh rule ex: ssh Port forwarding to VM
Code:
    post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 32768 -j DNAT --to 192.168.2.2:22
    post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 32768 -j DNAT --to 192.168.2.2:22
 
Last edited:
vmbr1 need 192.168.10.1/24 or 192.168.10.254/24
don't forget vmbr1 IP address will be the gateway in your VM
 
Last edited:
  • Like
Reactions: news
did you add vmbr1 in your VM (VM->hardware->network device->vmbr1)

can you go to your console inside your VM and edit /etc/network/inerfaces ?
 
Last edited:

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!