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.
  • So this is what the packet filter shows up:

    23:46:29  Default DROP  TCP  172.16.11.181  :  49968 ?  209.85.148.100  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:34  Default DROP  TCP  172.16.11.181  :  42855 ?  209.85.148.101  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:35  Default DROP  TCP  172.16.11.181  :  42855 ?  209.85.148.101  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:39  Default DROP  TCP  172.16.11.181  :  42855 ?  209.85.148.101  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:44  Default DROP  TCP  172.16.11.181  :  42855 ?  209.85.148.101  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:54  Default DROP  TCP  172.16.11.181  :  42855 ?  209.85.148.101  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:54  Default DROP  TCP  172.16.11.181  :  35028 ?  209.85.148.102  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:56  Default DROP  TCP  172.16.11.181  :  35028 ?  209.85.148.102  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:46:59  Default DROP  TCP  172.16.11.181  :  35028 ?  209.85.148.102  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:47:05  Default DROP  TCP  172.16.11.181  :  35028 ?  209.85.148.102  :  80 [SYN]  len=52  ttl=63  tos=0x00
    23:49:46  Default DROP  TCP  172.16.11.181  :  37368 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:49:47  Default DROP  TCP  172.16.11.181  :  37368 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:49:49  Default DROP  TCP  172.16.11.181  :  37368 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:49:53  Default DROP  TCP  172.16.11.181  :  37368 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:49:57  Default DROP  TCP  172.16.11.181  :  55729 ?  216.34.140.195  :  7275 [SYN]  len=52  ttl=63  tos=0x00
    23:49:58  Default DROP  TCP  172.16.11.181  :  55729 ?  216.34.140.195  :  7275 [SYN]  len=52  ttl=63  tos=0x00
    23:50:00  Default DROP  TCP  172.16.11.181  :  55729 ?  216.34.140.195  :  7275 [SYN]  len=52  ttl=63  tos=0x00
    23:50:04  Default DROP  TCP  172.16.11.181  :  55729 ?  216.34.140.195  :  7275 [SYN]  len=52  ttl=63  tos=0x00
    23:50:05  Default DROP  TCP  172.16.11.181  :  48830 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:50:06  Default DROP  TCP  172.16.11.181  :  48830 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
    23:50:08  Default DROP  TCP  172.16.11.181  :  48830 ?  74.125.39.188  :  5228 [SYN]  len=52  ttl=63  tos=0x00
  • Hi, can you post the SNAT settings, and any related PacketFilter rules?

    Barry
  • Hi Barry, thank you for replying, this is the SNAT rule:

    ------------------------------------
    SNAT GR - MOBILE
    Traffic selector: GR - MOBILE -> Any -> Any
    Source translation: External (WAN) (Address)
    Automatic packet filter rule: X
    Initial packets are logged: X
    ------------------------------------


    The network group "GR - MOBILE" consists of two network DNS host definitions:

    ------------------------------------
    Network definition 1:
    CLIENT - MOBILE - SGS Michi
    nwwlan-sgs-michi.net-waves.de [172.16.11.181]

    Network definition 2:
    CLIENT - MOBILE - SGS Swanni
    nwwlan-sgs-swanni.net-waves.de [172.16.11.182]
    ------------------------------------
  • To clarify, the phones are on your internal network, right?

    And by 'X', you mean you have the 'auto packet filter rule' setting enabled, right?

    Barry
  • Good morning Barry,

    yes, you're absolutely right. Phones are on internal network, this is 172.16.11.181 + 172.16.11.182.
    With "X" I mean that the setting is enabled.

    Other devices (gaming group) with addresses 172.16.11.161 and .162 are working with the same rule except for the other network device group (instead "group mobile" this is "group gaming").

    Michael
  • Any ideas are appreciated! ;-)
    I really don't see the problem... The network interface is correctly set up with the /23 mask and other devices are functioning properly in the segment 172.16.11.*  -  I turned off all IM/P2P control, IPS/IDS - but nothing helped.

    So if anyone has an idea on this, please help! ;-)

    Michael
  • 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 #
    ------------------------------------
  • Your SNAT rules look good, but there are no matches at all (first column).
    Is there a packet filter rule for 172.16.11.181/172.16.11.182 allowing packets to the Internet?
  • Hi da_merlin,

    Your SNAT rules look good, but there are no matches at all (first column).
    Is there a packet filter rule for 172.16.11.181/172.16.11.182 allowing packets to the Internet?


    that there are no matches on these rules may be as I restarted the system few minutes before and no device of the gaming and mobile group was online at this time.
    There is no packet filter rule as I checked the box to have automatic packet filter rules created. Shouldn't this suffer? I recently tried to do it without the checkbox for the automatic packet filter rules enabled and created those rules by hand. This didn't make a difference, but if you want me to do that again, I will do it again, of course! ;-)

    Michael


    EDIT: Sorry, I didn't mean to suffer, (I'm suffering! ;-) ) - I meant sufficient... of course... sry for my bad english. It's obviously not in everyday use... ;-)