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

Using DNS server in AWS VPC over VPN

I'm running UTM 9 locally and I've successfully connected three Amazon VPCs to my local network. I'm using Route53 for private DNS on the internal network and I wanted to configure the DNS resolver on the UTM box to use a proxy service I have configured in one of my VPCs. While I can successfully use my proxy from any machine on my local network, it doesn't appear to be accessible from the UTM machine (can't ping, can't resolve, requests just timeout, etc.). How can I fix this?

What I've done so far:
- Configured a Bind server in AWS (192.168.32.5) that forwards requests to Amazon's DNS server (192.168.32.2) since Route53 private zones are only accessible within a VPC.
- Created a VPN connection from my AWS Cloud to the UTM machine (192.168.20.100)
- Configured a static DNS route for mydomain.local that points to 192.168.32.5
- Configured Google's nameservers as the forwarding name servers for the UTM box
- Configured DHCP to provide the UTM server as the nameserver for all clients on the local network

How do I configure the UTM box so it can see the AWS instances over the VPN?


This thread was automatically locked due to age.
  • Hi, MrB, and welcome to the User BB!

    I'm running UTM 9 locally and I've successfully connected three Amazon VPCs to my local network.

    How have you done this?  Is the issue you describe after that opening sentence consistent over all three VPCs?

    Created a VPN connection from my AWS Cloud to the UTM machine (192.168.20.100)

    Is this what you meant with the above?  What are the Local/Remote networks in the UTM tunnel definition?

    Configured a static DNS route for mydomain.local that points to 192.168.32.5

    Is that .32.5 IP included in the VPN tunnel definition?  Or, do you only want DNS requests to go to that IP?  Which DNS requests?

    Configured DHCP to provide the UTM server as the nameserver for all clients on the local network

    I'm confused about the relationship between "local network" and "mydomain.local."

    How does your setup differ from DNS Best Practice?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Bob,

    Hopefully this clarifies my situation and current configuration.

    Infrastructure:
    - "Local Network" - on-site machines behind the UTM firewall (192.168.0.0/19)
    - AWS VA VPC (192.168.32.0/19)
    - AWS OR VPC (192.168.64.0/19)
    - AWS CA VPC (192.168.96.0/19)
    - Sophos UTM 9.313-3 (192.168.20.100)
    - DNS Proxy VA (192.168.63.250) * redid subnets; formerly 192.168.32.5
    - DNS Proxy OR (192.168.95.250)
    - DNS Proxy CA (192.168.127.250)

    Goals:
    - Leverage existing Amazon Route 53 private DNS zone for "mydomain.local" on "Local Network"
    - Forward only queries for mydomain.local to AWS to minimize bandwidth usage; forward all other queries to Google DNS servers (8.8.8.8, 8.8.4.4)

    VPN Configuration:

    - Created Customer Gateway in all 3 Regions pointing to the public IP of the UTM box
    - Created Virtual Private Gateways in all 3 Regions to serve as the remote concentrator
    - Created VPN in Amazon to link Customer and Virtual Gateways
    - Exported Sophos configuration files from Amazon and imported into UTM via the "Site-to-site VPN/Amazon VPC" section of the web UI.

    VPN Current Status:

    vpc-0
    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 23:56:35 / Routes

    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 2d23h45m / Routes 192.168.96.0/19


    vpc-0
    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 2d23h45m / Routes

    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 2d23h45m / Routes 192.168.32.0/19


    vpc-0
    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 2d23h45m / Routes 192.168.64.0/19

    SA: 0.0.0.0/0= =0.0.0.0/0
    IKE: Auth PSK / Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 28800s / PFS MODP_1024 / DPD
    IPsec: Enc AES_CBC_128 / Hash HMAC_SHA1 / Lifetime 3600s
    BGP: State Established / Uptime 16:08:01 / Routes


    DNS Configuration:
    Since Route 53 private zones are only accessible to instances in assigned VPCs, I created the three proxy servers referenced above (.63.250, .95.250, .127.250) as forwarding-only nameservers within the Amazon VPCs. I can successfully query those servers for my private addresses from client machines behind the UTM firewall, but I can't reach the machines from the UTM box itself.

    Global:

    Allowed Networks:
    - Local (192.168.0.0/19)


    Forwarders:

    DNS Forwarders:
    - Google DNS 1 (8.8.8.8)
    - Google DNS 2 (8.8.4.4)

    Use forwarders assigned by ISP?
    - OFF

    Request Routing:
    - mydomain.local -> Route53 VA Proxy (192.168.63.250)

    I don't think my setup differs much from the DNS Best Practice post. The primary difference is I don't want to push my proxy servers to the DHCP clients as the first resolution option; I want them to point at the UTM box and have it handle query routing since it has the facility to do so and my clients don't.

    Please let me know if you have any more questions about my existing config and if/how I can solve the problem!

    Thanks,
    Gordon
  • Gordon, you can use an Availability Group for the Google Forwarders.  They're so reliable that this likely isn't necessary.  Likewise, an Availability Group for the Request Route would let you use the other two DNS proxies as instant backups for the one in VA.

    What did you experience that led you to conclude that you could not "see the AWS instances" via the VPC connections?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I'll definitely look into the availability groups. I was wondering how to configure the request route to use all three!

    If I make the request route active, all of my requests for mydomain.local time out. I ssh'ed into the UTM box and tried to ping all three IPs, as well as some other instances in the VPCs and also tried to run DNS queries against them. None of the pings went through (verifying that ICMP was enabled on the AWS boxes; and I can ping them from my laptop) and the DNS queries all timed out.
  • I've not had much hands-on with VPCs, so most of my understanding is from studying the documentation...

    What happens if you disable two of the VPC tunnels on the 'Status' tab?  What happens if you replace "Any" in 'Local networks' on the 'Setup' tab with "Internal (Network)" and then toggle the still-enabled tunnel off/on?  What happens if you now re-enable the other two tunnels?

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I tried several different settings in the Route Propagation, but I believe that just configures the routes on the other side of the tunnel so the target networks use the VPN connection as the gateway (e.g. route all traffic for my local network through the gateway, route all internet traffic through the gateway, etc.). Either way, I get the same issue with any configuration -- I can't send traffic from the UTM box through the tunnel.

    Same thing with disabling/re-enabling. I turned off all connections but one and had the same issue.
  • The Sophos will use the 169.254 address as the source ip address when it is trying to communicate over a VPN tunnel to your VPC. You need to change the source IP address used by the Sophos and stop it using a 169.254 address as the source.

     

    Create a new source NAT rule for each VPC tunnel IP address. Set up the NAT rule as follows:

    Source: 169.254.x.x (your VPC tunnel ip address on your Sophos)

    Service: Any (or DNS, or ICMP, whatever you need)

    Destination: Your VPC subnet CIDR block (e.g. 192.168.1.0/24)

    Source IP address changes to: put your Internal LAN ip address in here (just the host address, create a network definition if you don't have one)

    Make sure you have put your internal network into the Amazon VPC networks section of the VPC configuration on the Sophos so AWS can route to the Sophos to get to your internal lan address on your Sophos. 

    And finally, ensure your firewall rules AND your AWS ACL's and security groups aren't blocking the above source/destination/protocols