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

Accessing external IP from internal network

Hi,
i have a webserver on my home-LAN, this server can be accessed from external IP's using the DNAT/SNAT functionality of Astaro V5, and it works just great.  But when I try to access the same server using the external IP-address of my internetconnection from my internal desktop (it has an ip-address in the same range as the webserver), i cannot seem to get connected...  I guess some of you will say i need to configure an internal dns-server but i do not want that (now)... Is this by design or am i doing something wrong?  I have checked the packetfilter log, but no packets for that kind of connection are dropped or rejected, what can be wrong?

Thx,
Tim.


This thread was automatically locked due to age.
Parents
  • Hi,
    i've been strugling with this problem for a couple of days now, i've posted my question on this BB and then all of the sudden ... bang!

    The old rule of NAT was:
    Source Address: Any
    Destination Address: IP assigned by ISP
    Service: HTTP
    Source Translation: none
    Destination Translation Address: IP of Internal Webserver
    Destination Translation Service : none

    By using this rule: when an internal client tries to access the internal webserver using the external IP of the ISP connection, the webserver sees it comes from an internal IP and responds to it directly, but the client cannot process that information because he doesn't know why he gets those datapackets (he expects to get that information for the external IP-address and not from the internal ip of the webserver).

    If you make a small change to the config of NAT, then it works:
    Source Address: Any
    Destination Address: IP assigned by ISP
    Service: HTTP
    Source Translation Addres: IP ASSIGNED BY ISP (!!!!)
    Source Translation Service: none
    Destination Translation Address: IP of Internal Webserver
    Destination Translation Service : none

    By doing this the webserver is forced to communicate with the firewall instead of directly with the internal client... Problem solved!!

    Kind regards,
    Tim.

    (BTW: if your ISP forces you to use their proxy, you have to add the external address to the list of addresses that don't need the proxy or it might not work)
  • If you do source IP address translation in your Web server NAT rule, this might work OK for the machines on the internal network that wish to browse the web server via its external IP address, but how does the web server now manage to reply to web browsing from the outside world? The replies will now be addressed to the External interface on the ASL box.

    Have you tested your modified NAT rule by browsing the web server from outside of your local LAN? I would suggest that you return to your original rule, which is the proper one for external access, and simply use the local LAN IP address (unless you are running split dNS, with a separate DNS server for the internal network) to browse the web server locally from the internal net.
  • It works fine for both pc's on the internal network or machines on the outside.  I do not understand your remark quite well: the webserver now communicates with the ip assigned by the ISP and the NAT translates the packets to the actual source ip, just like it was when there was no change in the source ip... or am I missing something?

    Tim.
  • actually this will work ok except for certain circumstances
    1. unforseen problems because your doing interesting things with the packets (your guess is as good as mine as to what this will be)
    2. no ability to log based on ip address or block by acl because every packet coming from outside is translated to external isp assigned ip
    in other words your website internally will see everything as the external ip
    -Dave
  • Your web server now sees all the traffic as originating from your external IP address, and responds accordingly. This is something that I consider to be a misconfiguration. It remains a mystery to me how people can now successfully browse your web server from the outside world, since it now sees the external IP address of the ASL box as the single source (and thus the only reply destination) for all the web traffic.

    I can only repeat my recommendation that you return to your original, properly configured, NAT rule.
  • You're right about the logging... this is where my solution is going wrong, i really need to see where traffic is coming from for analyzing and stuff... when I look in the logs of IIS, all traffic is coming from ISP assigned IP (of course this is logic, considering my config, but i didn't think about it...)

    Now that brings us back to the initial question, how to access external IP from local network without using the split-DNS solution?

    Tim.
  • why not split dns ?
    1 grab old computer w/ cd drive
    2 download and burn mandrake 10
    3 install mandrake w/webmin component and dns component
    4 choose not to use gui on boot
    5 create dns zone w/ internal ip's create a a record for www done...
    also with internal dns you will have faster browsing.
    6 or setup internal ad w/ 2000 server

    do you actually host your own dns for the website?
    if so grab 2nd old computer.

    it's not really that bad beats host files or ip's for all query's.

    another way around  it is to request a second ip and use it for the mapping that fixes the problem also
    unless you use dhcp or pppoe then that really isnt a solution

    you could use a linksys to grab a second ip also if dhcp or pppoe

    anyway enough blabbering

    -Dave
  • Hi,
    me again... I have spend some more time fooling around with the astaro settings just to get what I want without split DNS (the reason i don't wanna do that is because I don't have any old PC left, astaro is on it... and i don't want to maintain 2 dns with all records i need...).  
    I've found another solution: i don't have the problem anymore with the source ip appearing 'wrong' in the logs of my IIS and it seems to work fine, both for internal and external connections.... this is what i have done:
    I already had an Masquerading rule to be able to surf the internet from internal pc with these settings: 
    - Network : Internal (Network)
    - Interface: ISP Interface
    Now i have added another one:
    - Network: Internal (Network)
    - Interface: Internal Interface

    What do you guys think about this?  Will I encounter any surprises with this configuration? 
    If I am annoying anyone about be so stubborn about this, just tell 

    Thanks for your advice!
    Tim.
  • no not annoying this is an issue we have all dealt with in our own ways i have an astaro box with 3 ip's outside and I deal with the translation thing on that one because the astaro won't do a 1:1 mapping like the firewalls my company sells
    i was just fyiing about the translation issues but could you go into a little more detail about the "solution" you found sorry i don't understand
  • Hi,
    this is the NAT-configuration (eth0=internal nic - eth1=ISP)
    Chain USR_POST (1 references)
     pkts bytes target     prot opt in     out     source               destination         
        0     0 MASQUERADE  all  --  *      eth0    192.168.100.0/24     0.0.0.0/0           
        6   288 MASQUERADE  all  --  *      eth1    192.168.100.0/24     0.0.0.0/0 

    I don't know for sure, but i guess by adding the first nat-rule all packets (the second one in my earlier post) the packets coming from an internal IP now get a new source ip: the ip of the internal nic of my astaro.  When the destination ip is outside the network the packets are send through the ISP Nic, if not packets are sent to my internal webserver and this server is sending the replies directly to the clientpc on my internal network... this is just a guess, but the 'solution' is working fine without any issues so far... 
    Tim.
  • Awesome!

    I changed the rule slightly.

    Instead of saying From ANY TO:  External Interface I say
    from Internal Network To External Interface.

    The logging issue doesn't bother me for my home network.

    thanks.
Reply Children
No Data