Guest User!

You are not Sophos Staff.

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

Can't access internal website over VPN using WAN-accessible FQDN

I have a small home network protected by Sophos UTM 9.3. The ISP-assigned WAN address is resolvable (using DDNS) to an FQDN--call it mydomain.com. Within this network, I have a web site running on TCP 8080. This is reachable from the WAN via a DNAT rule that translates WAN-IP:8088 to WebServer:8080 (the port change was necessary, as I already have another WAN-accessible service using port 8080).

mydomain.com:8088 -> WAN-IP --DNAT--> WebServer:8080

L2TP and SSL VPN services are set up on the UTM. With a VPN client connected, I can access internal hosts and services using IPs or local host names.

My goal is to make the above web site only accessible to the following clients/networks, but in each case be able to use http://mydomain.com:8088/ to browse the site. The networks are:

  1. Trusted Remote Networks
  2. LAN clients
  3. VPN clients

I created a "Trusted Networks" object containing my LAN network, the various system-generated VPN address ranges, and another remote IP range (my work network). Then I used this object to select traffic for the DNAT rule.

This works up to a point: I can browse the web site from my work IP and from the LAN, but I cannot reach it over VPN (except by using the internal IP/hostname). The firewall log shows the traffic being stopped because the source IP is not the virtual (trusted) IP of the VPN client, but the real (untrusted) IP of the remote device.

To resolve this issue, I've tried using the DNS trick discussed here to pass the internal server IP to the VPN client: https://www.sophos.com/en-us/support/knowledgebase/115191.aspx. This will work, but only when there is no port translation. I've tried using the full NAT solution, but it doesn't seem to work: again, the request appears to come NOT from the VPN pool range, but from an "untrusted" IP, so I can't select for the traffice without opening up access to *any* outside IP.

Is there any way around this situation, so that I can access the website over VPN using the same URL and port as I would from the LAN or the WAN?



This thread was automatically locked due to age.
Parents
  • Hi, Matthew, and welcome to the UTM Community.

    Please insert a picture of your NAT rule. Also, tell us if #1 in Rulz gives us any clues.

    Cheers - Bob

  • Thanks for the welcome, Bob!

    I've been through the Rulez several times. I could be mistaken, but I'm not seeing any violations.

    Let me first reiterate that I have solved this problem to my satisfaction by:

    1. Changing the external (WAN Address) port to be consistent with the internal web server port (8088 in this case).
    2. Creating a DNS host entry on the UTM that resolves to the internal address of the web server. (Both LAN DHCP and VPN clients are passed the UTM LAN IP as their DNS resolver.)
    3. Using either a DNAT rule or a set of WAF rules (my preference) to route requests from the WAN side.

    This configuration achieves my goal of allowing a mobile device to access the internal web server using the same URL whether inside the LAN network, connecting via VPN, or from within a trusted remote network.

    But what if I didn't have the option of keeping the external port the same as the internal port? That would break things and require the use of two different URLs.

    My DNAT rule looks like this:

    Using the above rule, if I remove the DNS host entry that resolves the web server domain to the internal IP address, VPN access will break. The Firewall log shows a "Default DROP" from the real WAN IP of the mobile device (which is not part of my Trusted group) to the WAN IP of the UTM, like so:

    14:00:40 Default DROP TCP 166.136.184.62:59286 > 71.64.129.162:8088  (IP addresses changed in the interest of privacy)

    At the same time, access to the website from with the LAN and from one of the trusted remote networks works fine; the DNAT works as expected.

    Once a VPN connection is established, shouldn't the firewall evaluate incoming packets as originating from the *virtual* IP, rather than the real IP? It does this, *if* the destination resolves to a LAN address, but not when it resolves to a WAN address, as above. 

  • Instead of the "Trusted Networks" group, just use the "trusted remote network."  Remove that network from the group and make a new Full NAT, similar to your DNAT but also changing the source to the IP on the interface attached to PHOBOS.  Or, if you want to keep using split DNS, just do the Full NAT for the VPN Pools.

    Cheers - Bob

  • Like so, right?

    Yup, tried this already. Tried checking the box for "Rule applies to IPsec packets", too. The firewall still sees the original remote source IP, not the virtual IP from the VPN pool, and applies the default DROP. I even narrowed the traffic selector down to just the L2TP pool (or the Cisco VPN pool) and the results were the same.

    Let me throw another detail into this: I have a 4-port firewall. There is a single WAN port, and the other 3 ports are bridged into the LAN, so that I didn't have to use an extra switch in my little home network. Don't see why that would have an impact, but maybe someone else will. Everything works perfectly, except for this one issue with the VPN. I have tried disabling  IP, ATP, and web filtering. No joy. But thank you for trying!

  • If your "PHOBOS" object doesn't violate #3 in Rulz, please show the block line from the Firewall log file.  Alone among the logs, the Firewall Live Log presents abbreviated information in a format easier to read quickly.  Usually, you can't troubleshoot without looking at the corresponding line from the full Firewall log file.

    Cheers - Bob

  • Apologies for the late reply. I was out of town and computer-free for a few days.

    Thanks for the tip on checking the full log. Still, I'm not seeing any new information. Here's the entry in question, when the Full NAT rule is enabled:

    2016:03:31-13:28:13 mydevicename ulogd[15815]: id="2001" severity="info" sys="SecureNet" sub="packetfilter" name="Packet dropped" action="drop" fwrule="60001" initf="eth1" srcmac="00:01:5c:67:d2:46" dstmac="00:18:2a:e8:3c:55" srcip="166.172.185.94" dstip="71.91.109.162" proto="6" length="64" tos="0x00" prec="0x00" ttl="50" srcport="49610" dstport="8088" tcpflags="SYN" 

    PHOBOS is not bound to any interface, but it does receive a static IP from the DHCP server running on the LAN (bridge) interface.

  • The srcip is not from a VPN Pool nor is it from one of your LANs. If that IP is one that should be allowed in, you should add it to the group in the DNAT.

    Cheers - Bob

Reply Children