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

Logging actual source IP

Hi all. Here's a real dumb question...

I have several applications like phpBB, Gallery, Chat, FileShares, Squirelmail etc, behind ASL and I noticed recently, doooh!, that if an internet user goes into any of these apps, the IP that is logged is my firewall's 192. network  instead of their actual IP.

So, for example, my firewalls internal IP is 192.168.1.1 and my apps server is 192.168.1.3. A user coming in browsing my BB is logged as 192.168.1.1 and not his actual internet IP.

Have I misconfigured something or is that how it is with ASL?

Any suggestion or recommendation is mucho appreciated.

Thanks!
jav


This thread was automatically locked due to age.
Parents
  • Have you by any chance created masquerading rules that change the source address of the packets coming in from the outside?
  • [ QUOTE ]
    Have you by any chance created masquerading rules that change the source address of the packets coming in from the outside? 

    [/ QUOTE ]

    Hi there VelvetFog.

    No, I don't have any Masquerading rules configured.

    I do have NAT for incoming requests such as  HTTP(S), IPP, SSH, etc, all of which runs on my 192.168.1.3 server.

    So, shouldn't ASL log the actual source, ie; the actual internet IP address coming into the firewall instead of my internal IP used for translation?

    Thanks!
    jav
  •  if you search for me this is one thread
    that concerns a workaround for having nat
    see if you are doing any of these things
    and remove any of these workarounds
    otherwise it shouldnt be doing this.

    Again Local nat bug - Help please!  

    this is the thread's name
  • [ QUOTE ]
    No, I don't have any Masquerading rules configured.

    I do have NAT for incoming requests such as HTTP(S), IPP, SSH, etc, all of which runs on my 192.168.1.3 server.

    [/ QUOTE ]It appears we have a semantic problem here. Masquerading and NAT (Network Address Translation) is actually the same thing.

    So, back to my original question. Does your NAT rules change the source address of the incoming packets? If so, that is your problem.
  • [ QUOTE ]
    [ QUOTE ]
    No, I don't have any Masquerading rules configured.

    I do have NAT for incoming requests such as HTTP(S), IPP, SSH, etc, all of which runs on my 192.168.1.3 server.

    [/ QUOTE ]It appears we have a semantic problem here. Masquerading and NAT (Network Address Translation) is actually the same thing.

    So, back to my original question. Does your NAT rules change the source address of the incoming packets? If so, that is your problem. 

    [/ QUOTE ]

    In that case, yes. My firewall has two NICs and are setup as  such:

    eth2 - 68. network for the external interface
    eth0 - 192.168.1.1 internal network

    And my webserver is also on the same 192. network whose IP address is 192.168.1.3.

    Incoming packets are NATed to my internal IP which is 192.168.1.1. If I don't do it that way, I can't access my webserver from the internet.

    Is there a better way of doing this? Any suggestion at this time is very much appreciated!  

    Thanks!
    jav
  • [ QUOTE ]
     if you search for me this is one thread
    that concerns a workaround for having nat
    see if you are doing any of these things
    and remove any of these workarounds
    otherwise it shouldnt be doing this.

    Again Local nat bug - Help please!  

    this is the thread's name 

    [/ QUOTE ]

    Hi there. I read through that thread you suggested and other threads related to NAT but I didn't find any that would solve my problem. Unless I missed it.

    I also read ASL's FAQ for configuring a webserver and I did it exactly as instructed but for some reason, I can't connect to my webserver from external, ie; an internet user. However, with their configuration, I can connect to my webserver internally.

    My webserver is both accessible via internal or external only through the use of SNAT. The only issue I have with that configuration is that logging will show internal IPs instead of external sources. That's expected because of the way it's configured.

    I have yet to read a thread that someone has actually used NAT,       or Masquerade for some, whose webserver is accessible from external with actual source IP is logged. I have web applications that keeps track of user's IP and it would be nice to have this working correctly.

    Expert advise at this time is well appreciated... 

    Thanks!
    jav
Reply
  • [ QUOTE ]
     if you search for me this is one thread
    that concerns a workaround for having nat
    see if you are doing any of these things
    and remove any of these workarounds
    otherwise it shouldnt be doing this.

    Again Local nat bug - Help please!  

    this is the thread's name 

    [/ QUOTE ]

    Hi there. I read through that thread you suggested and other threads related to NAT but I didn't find any that would solve my problem. Unless I missed it.

    I also read ASL's FAQ for configuring a webserver and I did it exactly as instructed but for some reason, I can't connect to my webserver from external, ie; an internet user. However, with their configuration, I can connect to my webserver internally.

    My webserver is both accessible via internal or external only through the use of SNAT. The only issue I have with that configuration is that logging will show internal IPs instead of external sources. That's expected because of the way it's configured.

    I have yet to read a thread that someone has actually used NAT,       or Masquerade for some, whose webserver is accessible from external with actual source IP is logged. I have web applications that keeps track of user's IP and it would be nice to have this working correctly.

    Expert advise at this time is well appreciated... 

    Thanks!
    jav
Children
  • Your DNAT rule should only be changing the DEST IP, not the source.

    Please post your NAT/MASQ rules.

    Barry
  • [ QUOTE ]
    Your DNAT rule should only be changing the DEST IP, not the source.

    Please post your NAT/MASQ rules.

    Barry 

    [/ QUOTE ]

    Hi Barry, thanks for your reply.

    Here's my NAT rules:

    If I use the following NAT, everything works well. However, as you can see the source is changed. This means IPs being tracked are not the actual:

    Code:

    Name   Match Parameters   SRC Translation   DST Translation
    web_services    Any -> inwall (Address) / HTTP   sidewall amed / HTTP



    And if I use the following NAT, I can't get to my webserver:
    Code:

    Name   Match Parameters   SRC Translation   DST Translation
    web_services  Any -> inwall (Address) / HTTP   None   amed



    where:
    inwall = external interface in the ASL server
    sidewall = 192. network  in the ASL server
    amed = webserver with 192. network


    At the present time I ran out of idea why the latter NAT don't work. Hence, my plea for help... [:S]

    Thanks,
    jav
  • You should be using the second (no source translation).

    You also need a packet filter rule:
    source: any
    service: http
    dest: amed
    ALLOW

    Barry
  • [ QUOTE ]
    Code:

    Name   Match Parameters   SRC Translation   DST Translation
    web_services    Any -> inwall (Address) / HTTP   sidewall amed / HTTP


     

    [/ QUOTE ]

    you're changing the soucre IP to your "sidewall", which isn't needed for DNAT and causing you to see your fw's IP instead of the real one - change it back to "No change" and it'll work
  • Hello,
    maybe this question sounds silly for someone but,
    have you set the internal Interface of your ASTARO as default-Gateway in your WebServer ?
    If not the sourceNAT is needed for routing and it dont run without the sourceNAT.

    firebear