Clients of a remote Active Directory domain (forwarded domains, DHCP relay)

This scenario speaks from the branch: almost all the steps are done on the console of the branch's Argos, not on the headquarters' one. The branch has the LAN 192.168.50.0/24 on eth1…

Situation

This scenario speaks from the branch: almost all the steps are done on the console of the branch’s Argos, not on the headquarters’ one. The branch has the LAN 192.168.50.0/24 on eth1 (192.168.50.1) and the wg0 tunnel “Headquarters” to the headquarters LAN, 192.168.10.0/24; only the section “the domain’s ports” is done on the headquarters’ Argos.

The Windows PCs at the John Smith Ltd branch (LAN 192.168.50.0/24, the branch’s Argos with eth1 = 192.168.50.1) must be in the Active Directory domain ad.johnsmith.test. The domain controller dc1.ad.johnsmith.test is at headquarters, at the address 192.168.10.10, and is also the DHCP server for all the sites. The two sites are already connected by a VPN WireGuard tunnel (see Connecting two Argos sites with WireGuard).

For a PC to join the domain and work in it, three things are needed:

  1. finding the domain in DNS: the PC asks its DNS for the domain’s records (_ldap._tcp.dc._msdcs.ad.johnsmith.test and the like), which only the domain controller knows;
  2. reaching the domain controller on the domain’s ports (Kerberos, LDAP, SMB, RPC…), through the tunnel;
  3. getting its address from the headquarters’ DHCP server, because the addresses are managed in one place only.

On the branch’s Argos you get them with a forwarded domain (the resolver asks the domain controller for ad.johnsmith.test and the internet for everything else) and with a DHCP relay (the appliance carries the clients’ DHCP requests to the headquarters’ server, inside the tunnel). On the headquarters’ Argos, if the tunnel’s zone is closed, you need the rules that let the domain’s ports through to the domain controller.

At the end you find the variant with the domain on EDON Atlas.

What you need

  • The VPN WireGuard tunnel between the sites up, with 192.168.10.0/24 among the remote networks of the branch’s profile and 192.168.50.0/24 among those of the headquarters’ profile. As in scenario 29, the branch’s profile is wg0, with “Description” Headquarters, and on both appliances the tunnel is in the sites zone.
  • DNS protection on on the branch’s Argos: the forwarded domains are resolved by the appliance’s resolver.
  • The domain’s name (ad.johnsmith.test) and the domain controller’s address (192.168.10.10).
  • Access to the console of the headquarters’ DHCP server, to create the branch’s scope.
  • The appliance’s DHCP service installed (dnsmasq-base): it acts both as server and as relay.

Warning The relay carries the requests to the server only through a tunnel, a static route or an internal network, never through the wan: a server that can be reached only from the internet is refused with “No way there outside the WAN: it needs a VPN tunnel, a static route or an internal network”. The replies would not come back anyway: the relay asks for them on behalf of a private address.

Steps

On the branch’s Argos: the domain in DNS

  1. Open DNS and DHCP → DNS protection and check that “Enable DNS protection” is on. If it is off, switch it on and press “Save settings”.

  2. Open DNS and DHCP → Forwarded domains and press the “+” button on the right of the block’s bar (“Add a forwarded domain”).

  3. In the “Add a forwarded domain” dialog fill in:

    • “Domain”: ad.johnsmith.test (without the final dot). It applies to the domain and to every name under it;
    • “Active”: on;
    • “Servers”: 192.168.10.10. Up to four IPv4 addresses separated by commas, asked in turn: if you have a second domain controller, add it;
    • “Comment”: Domain controller (dc1).
  4. Press “Add”. The resolver is updated at once and “Forwarded domain saved” appears.

    The forwarded domain dialog for ad.johnsmith.testThe forwarded domain dialog for ad.johnsmith.test
    The forwarded domain dialog for ad.johnsmith.test
  5. Optional: add the reverse zones of the two networks in the same way, so that reverse lookups (address → name) also go to the domain controller: “Domain” 50.168.192.in-addr.arpa and then 10.168.192.in-addr.arpa, “Servers” 192.168.10.10.

  6. If you have switched on forced DNS on the branch’s lan (DNS and DHCP → DNS protection, “Force the appliance’s DNS”), the message says “Forwarded domain saved — apply the firewall: forced DNS leaves its servers alone”. Open the firewall button in the header (“Unapplied changes”), choose “Apply” and, in the “Keep the new ruleset?” dialog, press “Confirm” within 60 seconds.

Step 6 matters: with forced DNS every DNS query of the zone is redirected to the appliance, whatever server the client asked. A Windows PC, though, registers its own name in the domain’s DNS by sending an update (DNS UPDATE) straight to the domain controller, which the appliance would refuse. That is why queries addressed to the servers of an active forwarded domain are not redirected. It is a firewall rule: it holds after the apply.

For the technician Each forwarded domain becomes a forward-zone in Unbound (never over TLS), with domain-insecure (AD zones are not DNSSEC-signed) and a transparent local-zone: Unbound answers the special-use names (.test, home.arpa.) and the private reverse zones by itself, and without the transparent zone it would never ask the domain controller. The exception to forced DNS is ip daddr != { 192.168.10.10 } in the zone’s redirect rule; the refusal of DNS over TLS (port 853) stays.

On the branch’s Argos: the DHCP relay

  1. Open DNS and DHCP → DHCP and choose eth1 in the list.

  2. In the “DHCP service” block, in “On this interface”, choose “Relay to another server”.

  3. In the “DHCP relay” block:

    • “DHCP servers”: 192.168.10.10 (up to two IPv4 addresses, separated by commas);
    • “Relay active”: on;
    • “Comment”: DHCP from headquarters.
  4. Read the “On the server” block: it says what to declare on the DHCP server — the network 192.168.50.0/24, with 192.168.50.1 (this interface) as router and DNS server, and 192.168.50.1 as the server identifier, so that renewals also come back through the relay. It also reminds you to give leases of 3 to 7 days: the clients ride out a tunnel outage for at least half of that.

  5. Press “Save”. If the appliance’s DHCP server was on eth1, the console asks “Switch eth1 to the relay? Its DHCP server settings and their reservations are removed.”: press “Switch”. “DHCP server applied” appears.

  6. The console goes back to the list: open eth1 again. Below the “DHCP servers” field the console now says which way it reaches the server by: “192.168.10.10: through the VPN Headquarters (wg0)”. If it says instead “… no way there outside the WAN …”, the tunnel is off or does not carry that network: the relay does not forward to that server until the way is there. The “On the server” block adds that “192.168.50.0/24 now travels in the export of the tunnel Headquarters (VPN page)…”: there is nothing else to do here, because it is the branch’s lan network, which headquarters already has among the remote networks of its wg0.

    The DHCP relay of eth1 to the domain controller, with the way through the tunnelThe DHCP relay of eth1 to the domain controller, with the way through the tunnel
    The DHCP relay of eth1 to the domain controller, with the way through the tunnel
  7. The relay opens the DHCP port (udp 67) on eth1 in the firewall and accepts the server’s replies: apply the firewall from the header and press “Confirm” within 60 seconds.

If the “On the server” block shows “Zone LAN does not answer ping: at boot a Windows client keeps its address only when its gateway answers. Switch ping back on for the zone.”, open Zones and rules → Zones, the lan zone, switch on “Answer ping (ICMP)”, “Save zone” and apply.

On the headquarters’ DHCP server

  1. In the DHCP console of dc1 create the scope 192.168.50.0/24, for example with the addresses from 192.168.50.100 to 192.168.50.199, and the options: router 192.168.50.1, DNS server 192.168.50.1, domain name ad.johnsmith.test, lease duration 5 days.

The server chooses the scope from the address of the interface that forwards (192.168.50.1), not from the server’s address: that is why the scope carries the branch’s network. With the appliance as DNS, the PCs resolve the domain through the forwarded domain and the internet through the local resolver, even when the tunnel is down.

Tip If the DHCP server does not let you declare the server identifier, the PCs renew their lease by talking directly to 192.168.10.10 through the tunnel: the rules of step 17 let that through as well (udp 67).

On the headquarters’ Argos: the domain’s ports

  1. Open Zones and rules → Zones and choose the tunnel’s zone, sites.

  2. Look at the “Forwarding matrix” and the “Forward policy”. If the zone lets everything through to LAN (in scenario 29 the matrix has “Accept” next to “LAN”), the branch’s PCs already reach the domain controller and you can skip to step 19. If towards LAN a “Drop” or “Reject” policy decides (next to “LAN” there is “Zone default” and the forward policy is closed), open only what the domain needs, towards the domain controller alone.

  3. In the “Forward rules” block press “Add rule” and fill in:

    • “Destination zone”: LAN;
    • “Action”: “Accept”;
    • “Protocol”: TCP;
    • “Ports”: 53,88,135,389,445,464,636,3268,3269,49152-65535;
    • “Source”: leave it empty (“Any”). Besides the branch’s PCs (192.168.50.0/24), the resolver of the branch’s Argos also talks to the domain controller, and it sends the forwarded domain’s queries from the tunnel address, not from 192.168.50.1;
    • “Destination”: 192.168.10.10;
    • “Comment”: Branch AD TCP.

    Press “Add”.

  4. Add a second, identical rule with “Protocol” UDP, “Ports” 53,67,88,123,389,464 and “Comment” Branch AD UDP, then “Add”.

    The two forward rules of the sites zone towards the domain controllerThe two forward rules of the sites zone towards the domain controller
    The two forward rules of the sites zone towards the domain controller
  5. Press “Save zone”, then apply the firewall from the header and press “Confirm” within 60 seconds.

The rules are read in order, ahead of the forwarding matrix: the first that matches decides, and the traffic that no rule describes follows the zone’s matrix and forward policy. The domain controller’s replies to the branch get through by themselves (they are connections already open), and the headquarters’ lan zone starts out with the forward policy “Accept”.

Port Protocol What it is for
53 tcp, udp the domain’s DNS (the queries forwarded from the branch, the PCs’ updates)
67 udp DHCP: the relay’s requests and the renewals
88 tcp, udp Kerberos (authentication)
123 udp time (NTP): Kerberos refuses a PC whose clock is too far from the domain’s
135 tcp RPC, port mapping
389 tcp, udp LDAP
445 tcp SMB: group policies and logon scripts
464 tcp, udp Kerberos password change
636 tcp LDAP over TLS
3268, 3269 tcp global catalogue
49152–65535 tcp RPC dynamic ports (replication, management)

Verification

On the branch’s Argos:

  • DNS and DHCP → DHCP, eth1: the line below “DHCP servers” says “through the VPN Headquarters (wg0)”.

  • System status → Status: the wg0 tunnel is up in the “Gateways and tunnels” card; the “Attention” strip does not hold “The DHCP relay of eth1 has no way to its server…”.

  • Events and diagnostics → Diagnostics → DNS lookup: “Name” dc1.ad.johnsmith.test, “Record type” A, “Server” “Local (the appliance’s DNS resolver, port 53)” → “Run”. The answer is 192.168.10.10. With “Record type” SRV and “Name” _ldap._tcp.dc._msdcs.ad.johnsmith.test the answer names dc1.ad.johnsmith.test.

    The lookup of the domain's SRV record from DiagnosticsThe lookup of the domain's SRV record from Diagnostics
    The lookup of the domain's SRV record from Diagnostics

From a branch PC (Windows command prompt):

ipconfig /renew
ipconfig /all
nslookup -type=SRV _ldap._tcp.dc._msdcs.ad.johnsmith.test
nltest /dsgetdc:ad.johnsmith.test
  • ipconfig /all shows an address from the scope (192.168.50.1xx), the gateway and the DNS 192.168.50.1, the suffix ad.johnsmith.test and the DHCP server that assigned it.
  • nslookup answers with dc1.ad.johnsmith.test; nltest finds the domain controller.
  • The PC joins the domain (System settings → domain ad.johnsmith.test) and, after the restart, accepts the sign-in of a domain user.

On the headquarters’ Argos, Events and diagnostics → Firewall with the filter 192.168.10.10 and “Show” “Blocked” must not show branch connections dropped by the zone-sites-fwd rule: if you see any, the “Port” column says which port the rules of step 17 or 18 lack.

If something goes wrong

What you see Likely cause What to do
In the forwarded domains block: “DNS protection is off: the appliance resolves nothing…” The resolver is off. Switch on “Enable DNS protection” and save.
“This domain is already forwarded” The domain is already in the list. Edit the existing entry (the pencil icon).
“Each server: an IPv4 address (not the loopback)” You typed a name or an invalid address. Type the domain controller’s IPv4 address.
nslookup of the domain does not answer The tunnel is down, or headquarters does not let port 53 through to the domain controller. Check the tunnel on the Status page and the rules of steps 17–18.
The PC resolves the internet but not the domain The PC uses another DNS. With ipconfig /all check that the DNS is 192.168.50.1; or force DNS on the lan.
“No way there outside the WAN: it needs a VPN tunnel, a static route or an internal network” when saving the relay The server is not inside the networks of an active tunnel, of a static route or of an internal interface. Add 192.168.10.0/24 to the remote networks of the VPN profile, or switch the profile on.
Status: “The DHCP relay of eth1 has no way to its server (its tunnel is down, or nothing routes to it)…” The tunnel has dropped. The PCs keep their lease until it expires: get the tunnel back up (see scenario 29).
“On this interface’s own network: that server hears the clients without a relay” The DHCP server is on the same network as the clients. No relay is needed: the server already receives the requests.
“The DHCP service is not installed (package dnsmasq-base)” The package is missing. Install dnsmasq-base.
The PCs get no address, the tunnel is up The scope 192.168.50.0/24 is missing on the server, or headquarters drops udp 67. Create the scope (step 14) and check the UDP rule of step 18 in the headquarters’ Firewall log.
The PCs get an address but lose it at boot The lan zone does not answer ping. Switch “Answer ping (ICMP)” back on in the lan zone.
The PCs do not register their name in the domain’s DNS With forced DNS, the firewall was not applied after the forwarded domain. Apply the firewall and confirm.
Domain sign-in refused because of the time The PC’s clock is too far from the domain’s. Let udp 123 through to the domain controller and check the PC’s time.

If the domain is on EDON Atlas

If the domain is EDON Atlas’s, corp.johnsmith.test with the domain controller 10.20.0.10, and the branch has joined Atlas as a site (see Joining the site to EDON Atlas; hub 10.250.0.1), the link does almost everything:

  • DNS: Atlas’s domain is forwarded to Atlas for as long as the link lasts and appears in DNS and DHCP → Forwarded domains with the note “managed by the Atlas link”. Do not add it by hand;
  • forced DNS: Atlas’s IP in the tunnel and the domain controller Atlas gave the link are not redirected. If the domain controller’s address changes, System → Atlas warns “The DC’s address changed: link again to update the forced DNS exemption.”;
  • the firewall: the lan zone reaches Atlas on every port; no forward rules are needed. The other zones do not reach Atlas;
  • DHCP: two ways. The simplest is to leave the appliance’s “DHCP server” on eth1, with “DNS servers” empty (the PCs get the appliance’s address, which forwards the domain to Atlas) and “Domain” corp.johnsmith.test, so that the PCs complete names with the domain’s suffix. If instead the addresses must be assigned by Atlas’s DHCP server, the relay goes through wg-atlas too: in “DHCP servers” type “Atlas in the tunnel” (10.250.0.1) and the line below the field says “10.250.0.1: through the Atlas tunnel (wg-atlas)”. eth1 is in the lan zone, so 192.168.50.0/24 is among the networks the link sends to Atlas, as the “On the server” panel asks (“… must be among the networks the link sends Atlas (the lan zone’s), or the server’s replies never come back.”).

If a DHCP scope of the lan hands out a DNS other than the appliance, System → Atlas warns “The DHCP scopes of eth1 hand out an explicit DNS: their clients will not resolve Atlas’s domain.”: empty that scope’s “DNS servers” field.

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer