Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


DMZ / iptables NAT problem
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

DMZ / iptables NAT problem

Sokaris07Sokaris07 Member
edited November 2016 in Help

Hey there,

Need a little help with a problem with my current home connection.

Basically I have 2 Proxmox Servers and I set my router DMZ to Server 1 and iptables to NAT forward to the correct internal ip. From the outside, all works fine in Server 1 but I can't forward anything to Server 2.

I'll leave some configs below:

192.168.0.0/24 - Internal Network

192.168.5.0/24 - NAT Network

Server 1 - Interfaces

auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
    pre-up iptables-restore < /etc/iptables.rules
    address 192.168.0.10
    netmask 255.255.0.0
    gateway 192.168.0.1
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

auto vmbr1
iface vmbr1 inet static
    address 192.168.5.1
    netmask 255.255.0.0
    network 192.168.5.0
    broadcast 192.168.5.255
    bridge_ports eth1
    bridge_stp off
    bridge_fd 0

Server 1 - iptables Rules

...
-A PREROUTING -i vmbr1 -p tcp -m tcp --dport 10000:20000 -j DNAT --to 192.168.5.100:10000-20000
-A PREROUTING -i vmbr1 -p udp -m udp --dport 10000:20000 -j DNAT --to 192.168.5.100:10000-20000
-A POSTROUTING -s 192.168.5.0/24 -o vmbr1 -j MASQUERADE
...

Server 2 - Interfaces

auto lo
iface lo inet loopback

auto vmbr0
iface vmbr0 inet static
    pre-up iptables-restore < /etc/iptables.rules
    address 192.168.0.20
    netmask 255.255.0.0
    gateway 192.168.0.1
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

auto vmbr1
iface vmbr1 inet static
    address 192.168.5.2
    netmask 255.255.0.0
    network 192.168.5.0
    broadcast 192.168.5.255
    bridge_ports eth1
    bridge_stp off
    bridge_fd 0

Already tested it with iptables on Server 2 and nothing...

Here's some Painting skills of the network. Everything can reach every devices, only NAT

Another thing but I can't say if it is related is that from my personal computer for example, I can't connect to anything inside those 2 servers using the external IP, only using the internal IPs. I'm redirected to ports 65000+.

Any help will be appreciated :D

Sign In or Register to comment.