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

v18: Bug with data counting in firewall rules?

Hi,

I am noticing a strange behavior in v18 and the data counting in the firewall rules. I have some incoming rules (from Internet to DMZ) that are coupled with corresponding DNAT rules. The DMZ contains webservers, so they send a lot more data than they receive. However, the counters in the rules are the other way around: They show a lot more incoming data than outgoing data. 

Unless I am completely misinterpreting these counters (which I would like to rule out), it appears to me these counters have been reversed, e.g. incoming is actually showing outgoing, and outgoing is showing incoming. 

Any thoughts?



This thread was automatically locked due to age.
  • FormerMember
    0 FormerMember

    Hi cryptochrome, 

    Could you please share the screenshot of the firewall rule that shows data in and out counters? I will verify if it should be like that or not and update you.

    Thanks,

  • Hi cryptochrome, 

    Could you please share the screenshot of the firewall rule that shows data in and out counters? I will verify if it should be like that or not and update you.

    Thanks,

     

    Sure, here you go:

    Firewall Rule:

    Corresponding NAT rule:

    Firewall Rule Details:

     

    Note that this is just one example. I am seeing the same "reversed" counter on other incoming rules. 

    How do you count the data? If someone on the internet initiates the connection and transfers a lot of data, does that count as incoming or outgoing?

  • Hi  

    To answer your question about how the data counter works, if someone on the internet uploads to your webserver, that would be incoming traffic.  The server responses to those connections will be less unless you are downloading data from internet to local LAN.

    I hope that clears it up.

     

    Thanks!

  • My Plex rule (and others) is the same, and I have always been so confused.  When I was on v17, I noticed it was only the "Business" rules which did this.  The other rule type (User / Network??) was the other way around, which is what I would expect.  So it has to do with DNAT rules it seems.  So confused.

    Just now I checked and it shows "in 42GB, out 371MB".  My Plex server itself is not taking in that much data, but serving up to family/friends.  Why is this counted as "in"?  I can't wrap my head around it.  This is clearly 42GB leaving my Plex server, hitting the XG and then going out the WAN.

  • *Edit* To reflect this Thread better;

     

     

    V17.5 Client to Server through DNAT.

    Upload Something:

    Download something:

    Same behavior like V18. 

     

     

    LAN to WAN. Download shown as IN Bytes.

    DMZ to WAN. Download shown as IN Bytes.

    WAN to DMZ(DNAT). Download shown as IN Bytes. 

     

    The Plex Scenario shows this perfectly. 

    If the Client is in LAN, Plex in DMZ, streaming a Movie shows the movie as IN Bytes. 

    If the Client is in WAN, Plex in DMZ, Streaming a Movie shows the movie as IN Bytes. 

     

    Just to be complete.

    Client - XG1 SNAT - Internet - XG2 DNAT - Server 

    Client Upload:

    XG1 (SNAT):

    XG2 (DNAT):

     

     

    Client Download something:

    XG1 (SNAT):

    XG2 (DNAT):

     

  • KingChris said:

    Hi  

    To answer your question about how the data counter works, if someone on the internet uploads to your webserver, that would be incoming traffic.  The server responses to those connections will be less unless you are downloading data from internet to local LAN.

     

     

    If that is the case then my observation is correct and we are looking at a bug here. The data is counted in the wrong directions for connections that are subject to DNAT. See Nate's response, too. He pretty much confirms it. 

  • To add to my answer above something: 

     

    Actually you could resolve this by a little Switch in a Firewall to give the Administrator the possibility to "Switch" IN / OUT. 

    A little flag to tell the Firewall "This Rule is for NAT!". 

    But this would be just a "easy way out". I would actually hope, this is resolved in a deeper level in the upcoming releases!  :) 

  • LuCar Toni said:

     

    Lets recap the IN and OUT in Firewall Rule quickly.

    IN means, traffic coming from the Destination going through the XG to the Source.

    OUT means traffic, coming from the Source going through the XG to the Destination.

    [...] 

    Because basically the Firewall Rules was used for Traffic behind the XG through XG to the Internet, for example, this made perfectly sense. 

    Your Client is downloading something in the Internet. 

    LAN to WAN: IN 100 GB, Out 1 MB - Because the Internet is sending you traffic and we counting this as IN traffic. 

      

    I am not sure I can follow.... Let me re-iterate what I am seeing:

    Internet <-> XG Firewall <-> DMZ Server

    Internet user downloads a lot of data from the server in the DMZ. XG firewall shows this traffic as INcoming on the corresponding firewall rule. Nothing about that makes sense, it's just utterly wrong. 

    Again, this only applies on rules that are subject to DNAT. On SNAT connections, it shows the correct directions. This is inconsistent behavior at best, but I would actually go as far as saying this is clearly a bug.

    Note that this is reflected in all reports and statistics (counters in diagnostics etc.) as well. 

  • Your Example is the same issue like the the PLEX issue here in this Thread.

     

    Firewall makes perfectly sense for "none DNAT traffic" because the counter was build for everything behind XG. 

    DNAT turns the switch and allows traffic coming from WAN to LAN. 

     

     

    Think about this: you create a ANY - ANY Rule. 

    This will allow LAN to WAN. But also WAN to LAN (Your DNAT Traffic). 

    How should the traffic counter now work? It is hard to tell and that is causing this issue for now. 

     

    Firewall rule counter was not designed to reflect such kind of traffic in the first place. 

    PS: I am not saying it is good in any way. I just try to tell you the Root Cause of this. 

  • LuCar Toni said:

     

    Think about this: you create a ANY - ANY Rule. 

    This will allow LAN to WAN. But also WAN to LAN (Your DNAT Traffic). 

    How should the traffic counter now work? It is hard to tell and that is causing this issue for now. 

     

    How the traffic should be counted? Like on any other network device on this planet, like on any other firewall: based on traffic direction, which can be observed by looking at the interfaces on which traffic enters and leaves. Even simple layer 2 switches can distinguish between incoming and outgoing traffic. There is no guess work involved. You look at the traffic, you see that the connection was initiated from the internet (wan interface) and that reply packets are coming from a different interface. In a nutshell, this is very basic connection tracking. It has nothing to do with NAT. You can clearly tell which side initiates the connection and which side responds. Whether IP addresses get translated in the process is irrelevant. 

    All the firewall has to do is look at who initiated the connection. If the server in the DMZ initiates a connection through an interface, it's outgoing traffic. If the server responds to a connection, it's incoming traffic.