port forwarding

maukkis

New Member
Dec 8, 2022
1
0
1
so i have nat networking cus my host is not local i can connect fine to it with rdp but i tried to port forward other ports and it didnt work
heres my /etc/network/interfaces
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback
dns-nameservers 67.207.67.2 67.207.67.3

auto eth0
iface eth0 inet manual
hwaddress 8e:e4:ca:7a:9f:0d
post-up ifup eth0:1

auto eth0:1
iface eth0:1 inet static
address 10.19.0.6/255.255.0.0
hwaddress 8e:e4:ca:7a:9f:0d

auto eth1
iface eth1 inet static
address 10.114.0.3/20
hwaddress 46:8c:df:2f:e0:a1

auto vmbr0
iface vmbr0 inet static
address 165.232.120.0/20
gateway 165.232.112.1
bridge-ports eth0
bridge-stp off
bridge-fd 0


auto vmbr2
iface vmbr2 inet static
address 10.0.0.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 echo 1 > /proc/sys/net/ipv4/conf/vmbr2/proxy_arp
post-up iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.0.0.0/24 -o vmbr0 -j MASQUERADE


post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3389 -j DNAT --to 10.0.0.101:3389
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 3389 -j DNAT --to 10.0.0.101:3389
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 30120 -j DNAT --to 10.0.0.101:30120
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 30120 -j DNAT --to 10.0.0.101:30120
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 30120 -j DNAT --to 10.0.0.101:30120
post-down iptables -t nat -D PREROUTING -i vmbr0 -p udp --dport 30120 -j DNAT --to 10.0.0.101:30120
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 40120 -j DNAT --to 10.0.0.101:40120
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 40120 -j DNAT --to 10.0.0.101:40120
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 40120 -j DNAT --to 10.0.0.101:40120
post-down iptables -t nat -D PREROUTING -i vmbr0 -p udp --dport 40120 -j DNAT --to 10.0.0.101:40120
 
Hi,

I never used the bridge interface for the NAT-rules. Maybe try replacing "vmbr0" in all your NAT rules with the "eth0" interface and see if this gets port forwards working ;).
 

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!