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

squid could not access domain web server(fw (80) --> redirect --> internal web ) ?

Hi all,

   I got a problem on squid. Story like follwoing :
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Host configure
--------------
firewall ( ASL 2.X ) , simple, two interface.
one for external ( pub_fire )
one for internal ( int_fire )

internal web server ( int_web ) apache.

DNAT 
-----
firewall port 80  redirect to internal web[Network-->DNAT-->pub_fire|HTTP|int_web|HTTP

HTTP Proxy
----------
Enable Proxy
Allowed network : just internal network.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Outside network surf to domain web is fine ( firewall 80 port, response by internal web ).
Interanl client surf to outside is fine (client manully setup proxy.)

The problem is : internal client want surf domain web (firewall) via proxy , it got time out.

What should i do ?

Gordon


This thread was automatically locked due to age.
Parents
  • Is the web server set as a DNS IP address of the firewall? If so you can't use the external IP address to access that machine. You have to access the internal machine by the IP address.

    So you can do this either with a hosts file on the workstations or have an internal DNS server setup.

    I hope I understood your question ok.
Reply
  • Is the web server set as a DNS IP address of the firewall? If so you can't use the external IP address to access that machine. You have to access the internal machine by the IP address.

    So you can do this either with a hosts file on the workstations or have an internal DNS server setup.

    I hope I understood your question ok.
Children
  • Hi Adam,

        My domain web name (www.domain.com) IP point to firewall, but firewall redirect port 80 to internal server (private IP). So, when public side surf to www.domain.com, internal server reseponce the HTTP.

      Back to problem, the firewall's squid  could be access the internal server via redirect (private ip) as www.domain.com. 

    Gordon
  • quote:
    Originally posted by Gordon Luk:
    Hi Adam,

        My domain web name (www.domain.com) IP point to firewall, but firewall redirect port 80 to internal server (private IP). So, when public side surf to www.domain.com, internal server reseponce the HTTP.

      Back to problem, the firewall's squid  could be access the internal server via redirect (private ip) as www.domain.com. 

    Gordon



    Thats what I am saying. It won't work that way, NAT gets all confused, you have to set your clients to talk directly to the internal server and bypass the firewall and proxy.

    So either setup a hosts file for the clients or an internal DNS server for domain.com

    So for people *outside* the firewall domain resolution looks like this:

    www.domain.com -> [external firewall IP]

    But for people *inside* the firewall domain resolution looks like this:

    www.domain.com -> [servers actual internal ip]
  • Hello Adam,

       Thanks for your reply again. :-)

       Back to my problem, infact , i don't want setup hosts file for client or a internal named server ... may be, the firewall also runing a named  :-)  ...

       About bypass... now i could set client use proxy also, and setup bypass internal network or domain named...  let client NAT to external...

      I want explain what i think  proxy server how it work, and what i feeling current problem. Please correct me when i got wrong concept.
      when i use proxy server.. every request (URL) send to proxy server...  proxy server as a CLIENT, request my (URL).. and then send back result to me...  now squid run on firewall... it hold two interface (real & private IP)...  if squid use real IP access, firewall should be redirect to internal web server...    

       I feeling that ... squid it don't access local interface and local host address.


    Gordon
  • The problem is that it just wont work.

    Its not just squid its NAT and the firewall and squid combined.

    Its hard to explain so I'll point you to the docs:
    NAT_MASQ.txt

    Also from the FAQ:

    #4014
      Q: I have trouble connecting to DNATed services from clients inside my 
         LAN when I use a DNS or server name. What can I do ?
      
      A: This is most probably a generic problem with DNAT, DNS and routing.
         Example:
      
           Your external ASL interface has the IP 1.2.3.4
           Your webserver inside the LAN has the IP 192.168.1.10
           You have added a DNAT rule to translate
                  1.2.3.4:80 -> 192.168.1.10:80
           Your server name "www.myserver.com" resolves to 1.2.3.4
           
           Symptoms: External clients can browse the web server fine, but
           internal lients can only connect if they use the IP address instead
           of the name or they cannot connect at all.
           
           Cause: The web server is in the same network as the clients, but
           its name resolves to an external address. Thus, the web server will
           answer connections from the LAN clients directly with his internal
           interface address (192.168.1.10) But the clients expect the answer
           from the external address (1.2.3.4) which they contacted in the
           first place.
           
           Solution 1: Put the web server in a different logical network,
           separated from the LAN (in our case, maybe 192.168.2.10).
           
           Solution 2: Make sure the name "www.myserver.com" resolves into
           the internal address of the webserver for all clients in your
           LAN (via extra DNS server or static hosts file entry).
  • Hi Adam,

        Thanks... Thanks... this is a .. good/bad news.

        Anyway, this don't need me got crazy in squid...  Thanks.  :-D

        Now, look like have two solution :
    1. new alias internet (a new subnet.. call it.. DMZ..) and the internal web server reset the IP at DMZ.  what do you think? possible?

    2. setup firewall' squid point to upstream proxy server (may be ISP) ... let parent proxy access my www.domain.com... ha..ha..

    Gordon
  • quote:
    Originally posted by Gordon Luk:
    Hi Adam,

        Thanks... Thanks... this is a .. good/bad news.

        Anyway, this don't need me got crazy in squid...  Thanks.  :-D

        Now, look like have two solution :
    1. new alias internet (a new subnet.. call it.. DMZ..) and the internal web server reset the IP at DMZ.  what do you think? possible?

    2. setup firewall' squid point to upstream proxy server (may be ISP) ... let parent proxy access my www.domain.com... ha..ha..

    Gordon



    Depends how many users you have. I have tested Astaro in lots of different setups, some with under 10 users and some with 50 users. With under 10 its very easy to setup the hosts file. With 50 its very easy to setup an internal DNS server.

    This isn't too hard stuff, it will take you less time to setup an internal DNS server on NT or 2000 than it has taken to have all these discussions about it ;-)
  • have you tried to masquerade yourself?
    long time ago i post something for this
    problem.

    try masquerading "dmz --> dmz" or
    "intern --> intern"

    i'am not sure if this was the solution..

    --
    siudak@hes