2.0.RC3 NET BALANCER – 1:1 Nat Virtual Servers not managable

Forums Network Management Signal a BUG 2.0.RC3 NET BALANCER – 1:1 Nat Virtual Servers not managable

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #43734

    Hi there,

    yesterday I upgraded my Soekris 5501 to a Gigabit capable Soekris 6501. My old system was runnung on ZS Release 1.0 Beta14.
    I decided to upgrade to Release 2.0.RC3. I am using Zeroshell for many years in different situations. Its a very
    good project, keep on moving!

    My Setup:
    WAN Link 1 ETH00: CABLE 100Mbps with dynamic public ip adress
    WAN Link 2 ETH01: ADSL 5Mbps with static /28 (16 adresses) public ip range
    internal ETH02: users (me)
    internal ETH02: server

    My Goal:(which was working on 1.0 Beta14):
    I want to map my internal server with a 1:1 Nat to on of my static public ip addresses.

    My Configuration:
    I made a 1:1 Nat under Setup -> Startup/Cron -> NAT and Virtual Servers script

    iptables -t nat -I PREROUTING 1 -d -i ETH01 -j DNAT –to-destination
    iptables -t nat -I POSTROUTING 1 -s -o ETH01 -j SNAT –to-source

    Then I added the required rule to the Firewall

    A and at last I setup the Net Balancer and Balancing Rules:

    Failover Mode

    Gateway Description | IP Address    | Interface | Weight |  Timeout Coefficient
    ADSL | | | 1 | x8
    CABLE | | | 99 | x1

    I want all outgoing connections to use my fast link so i set the weight of the CABLE to 99

    Balancing Rules to route all traffic from the server to the ADSL Gateway:
    MARK all opt — in * out * -> MARK set 0x65 ADSL (

    So far so good! and this setup worked perfectly on 1.0 Beta14. On the latest 2.0.RC3 i can see the following effect:

    when I connect from the Internet to the defined external public address of my server i check the firewall interface ETH01 with tcpdump
    I see packages comming in. On the server i can see the the packages arriving and leaving towards the firewall again but at the
    firewall the packages dont leave through the per Balancing Rule defined Gateway, they leave though the Interface that has the highest weight.
    In my case its CABLE ETH00 (99).

    When I iniciate a connection to the Internet from the shell prompt of the server i get routed correctly through the Balancing Rules defined gateway.

    For me it looks like NET BALANCER’s Balancing Rules are ignoring iptables POSTROUTING rules. In such a case the balancer just goes for the weight of the connection instead of looking at the balancing rules first. Maybe some priority changed from Beta14 to 2.0.RC3, the balancer should look at the rules first and if not found go for the weight.

    Do you have similar experience?

    i saw similar threads:
    Internal service behind load balancer – ZeroShell 2.0 RC1 -> https://www.zeroshell.org/forum/viewtopic.php?t=3794

    Bug in Loadbalacing or Virtual Server in 2.0.RC1 -> https://www.zeroshell.org/forum/viewtopic.php?t=3704

    Greets Mike


    Hi miketheknife,

    I’m in the same trouble upgrading from 1.b14 to latest 3.2.1.
    The configuration that was working in previous release doesn’t work any more now in routing packets as per nat1:1 configuration.

    I don’t think it is a netbalancer issue: I have the same problem even disabling netbalancing.

    In my configuration I have 4 public ip addresses (, .75, .76, .77) on ETH03.
    All 4 are configured nat1:1 to dmz servers, but only the first one ( works, i.e. packets come back through ETH03. Packet to the others goes back through ETH02 (which is the default route).

    I’m stuck trying all possible configurations and wondering if you fixed your issue.


    After having put this task aside for some months, I’m now trying to fix the problem (without success by now).

    Here is my setup:
    – ETH00 –> LAN
    – ETH01 –> DMZ
    – ETH02 –> GW1
    – ETH03 –> GW2

    GW1 + GW2 are in netbalancing (failover), where GW1’s weight is 95 and GW2’s weight is 1.

    GW2 has 4 IP addresses (x.x.x.74,x.x.x.75,x.x.x.76,x.x.x.77).

    My goal is to map different addresses to different services/servers in DMZ.

    So I setup portforwarding and postrouting rules in crontab in order to SNAT specific traffic.
    I also setup balancing rules to get all trafic coming from DMZ through GW2.

    This configuration _was_ working in version 1.beta14.

    What happens now:
    – services mapped to first address (x.x.x.74) are correctly routed through GW2
    – services mapped to the other addresses are routed through GW1 (which is also default gateway). Therefore they never get back to the calling party.

    Port forwarding config:

    ETH03 / x.x.x.77 TCP 25
    ETH03 / x.x.x.74 TCP 110,143,143
    ETH03 / x.x.x.74 TCP 80,443,443
    ETH03 / x.x.x.75 TCP 80
    ETH03 / x.x.x.74 TCP 25
    ETH03 / x.x.x.76 TCP 80,443,443

    Postrouting rules:

    iptables -t nat -I POSTROUTING 1 -s -o ETH03 -j SNAT --to-source x.x.x.76
    iptables -t nat -I POSTROUTING 1 -s -o ETH03 -j SNAT --to-source x.x.x.75

    *** No change even if these rules are commented ***

    Net balancing rule:

    1 * * MARK all opt -- in * out * -> MARK set 0x66 GW2 (x.x.x.73)

    Any help will be greatly appreciated. Thanks!


    I vaguely recall upgrading from 1.0 to 2.0, then to 3.0 and to 3.5.
    The profile worked.
    Perhaps you can try upgrading incrementally?


    I changed my hardware, so I think it’s not possible to go the gradual upgrade path (because of how the network interfaces are identified).

    Thanks anyway


    Bummer! Then it sounds like your only option is to bring up an old version in a VM and copy the profile values manually.


    That’s what I did: the same configuration (copied over page-by-page) works in every aspect but using the right gateway in network balancing for some traffic (not all – see my post above).

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.