This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[8.102] Can't get SNAT working

Hi @all,

maybe you can help me a bit solving this problem.
I have the following network: 172.16.10.0/23, that is 172.16.10.0 - 172.16.11.255.
For wired clients I use the .10 net and for wireless clients I use the .11 net.

I had to switch from full masquerading mode and working with some firewall rules to SNAT mode to have more control of what's going to the outside.

For some reason one SNAT rule does not work at all. This is a rule for two smartphones grouped together into a network group.
In the SNAT rule I checked both checkboxes to have the initial packets logged and the firewall rule created automatically.
As being confused that this config works for other device groups but not for this one I deleted the SNAT rule, created a clean firewall rule and then again a new SNAT rule without the two checkboxes activated.

This did not work as well. I deleted all rules again, deleted the network definitions and created everything new regarding these two devices which aren't snat'ed.
With the newly created device definitions, groups and SNAT rules it didn't work again.

In the meantime (between all these config changes) I restarted the ASG several times, maybe 4-5 times. I turned off the radio at the two devices and also restarted the devices, but nothing helped.

What can I do to make this working?
What information do you need from me?

Greetz from DE,
Michael


This thread was automatically locked due to age.
Parents
  • Hi tuxi,

    whats the output of "iptables -t nat -L -v -n" on the console?

    BTW: You can also enable Uplink Balancing and specify a multipath rule,
    to route certain traffic over a dedicated interface.

    Cheers
     Ulrich
  • Hi Ulrich,

    thank you for replying.
    Here is the output of iptables command:

    The clients which begin with 172.16.11.16* are working, the 11.18* aren't.


    ------------------------------------
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root # iptables -t nat -L -v -n
    Chain PREROUTING (policy ACCEPT 118K packets, 9625K bytes)
     pkts bytes target     prot opt in     out     source               destination
     119K 9677K AUTO_PRE   all  --  *      *       0.0.0.0/0            0.0.0.0/0
     118K 9624K USR_PRE    all  --  *      *       0.0.0.0/0            0.0.0.0/0
     118K 9624K LOAD_BALANCING  all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain POSTROUTING (policy ACCEPT 57626 packets, 3947K bytes)
     pkts bytes target     prot opt in     out     source               destination
    57717 3946K AUTO_POST  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    57717 3946K USR_POST   all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain OUTPUT (policy ACCEPT 54262 packets, 3783K bytes)
     pkts bytes target     prot opt in     out     source               destination
    53558 3725K AUTO_OUTPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    53558 3725K USR_OUTPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain AUTO_OUTPUT (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain AUTO_POST (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain AUTO_PRE (1 references)
     pkts bytes target     prot opt in     out     source               destination
      539 28028 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spts:1024:65535 dpt:4444 ADDRTYPE match dst-type LOCAL

    Chain LOAD_BALANCING (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain USR_OUTPUT (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain USR_POST (1 references)
     pkts bytes target     prot opt in     out     source               destination
        0     0 SNAT       all  --  *      *       172.16.11.161        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.162        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.165        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.163        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.181        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.182        0.0.0.0/0           policy match dir out pol none to:85.116.204.86

    Chain USR_PRE (1 references)
     pkts bytes target     prot opt in     out     source               destination
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    ------------------------------------
Reply
  • Hi Ulrich,

    thank you for replying.
    Here is the output of iptables command:

    The clients which begin with 172.16.11.16* are working, the 11.18* aren't.


    ------------------------------------
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root # iptables -t nat -L -v -n
    Chain PREROUTING (policy ACCEPT 118K packets, 9625K bytes)
     pkts bytes target     prot opt in     out     source               destination
     119K 9677K AUTO_PRE   all  --  *      *       0.0.0.0/0            0.0.0.0/0
     118K 9624K USR_PRE    all  --  *      *       0.0.0.0/0            0.0.0.0/0
     118K 9624K LOAD_BALANCING  all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain POSTROUTING (policy ACCEPT 57626 packets, 3947K bytes)
     pkts bytes target     prot opt in     out     source               destination
    57717 3946K AUTO_POST  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    57717 3946K USR_POST   all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain OUTPUT (policy ACCEPT 54262 packets, 3783K bytes)
     pkts bytes target     prot opt in     out     source               destination
    53558 3725K AUTO_OUTPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0
    53558 3725K USR_OUTPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0

    Chain AUTO_OUTPUT (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain AUTO_POST (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain AUTO_PRE (1 references)
     pkts bytes target     prot opt in     out     source               destination
      539 28028 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp spts:1024:65535 dpt:4444 ADDRTYPE match dst-type LOCAL

    Chain LOAD_BALANCING (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain USR_OUTPUT (1 references)
     pkts bytes target     prot opt in     out     source               destination

    Chain USR_POST (1 references)
     pkts bytes target     prot opt in     out     source               destination
        0     0 SNAT       all  --  *      *       172.16.11.161        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.162        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.165        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.163        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.181        0.0.0.0/0           policy match dir out pol none to:85.116.204.86
        0     0 SNAT       all  --  *      *       172.16.11.182        0.0.0.0/0           policy match dir out pol none to:85.116.204.86

    Chain USR_PRE (1 references)
     pkts bytes target     prot opt in     out     source               destination
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    gatekeeper:/root #
    ------------------------------------
Children
No Data