Network team · Mixed sites
FortiGate up top, UniFi below. Two half views.
When a FortiGate is the firewall and UniFi runs the switches and Wi-Fi, each system sees only its own part of the network. UniFi loses everything that depends on a UniFi gateway, and the FortiGate can't see inside the UniFi switches. Knowing which half lives where saves a lot of chasing.
Part 1 · Who sees what
Swap the gateway and UniFi loses the top of the picture.
In a full UniFi stack, one app sees the internet connection, the traffic, the switches, the Wi-Fi and every client's address. Put a FortiGate on top and the routing, firewall, DHCP and internet side move to the FortiGate. UniFi keeps the switch ports and the Wi-Fi.
Full UniFi stack
One app, one view, top to bottom.
FortiGate with UniFi
Two apps. Neither one sees the whole network.
Where each feature lives
| Feature | Full UniFi | FortiGate + UniFi | What it means for us |
|---|---|---|---|
| Traffic and app identification | UniFi | FortiGate | UniFi's traffic identification needs a UniFi gateway. Look up apps and top talkers on the FortiGate. |
| Traffic flows and logs | UniFi | FortiGate | UniFi Flows only logs traffic through a UniFi gateway. Use FortiGate logs and FortiView. |
| Firewall rules, port forwards, VPN, IPS | UniFi | FortiGate | These menus in UniFi set up a UniFi gateway. On a mixed site they do nothing; make changes on the FortiGate. |
| DHCP and reservations | UniFi | FortiGate | See Part 3. A UniFi Fixed IP is not where the reservation lives. |
| Local DNS names and option 43 in UniFi | UniFi | FortiGate | Ubiquiti says these UniFi settings only work with a UniFi gateway. Set them on the FortiGate. |
| Internet and WAN health | UniFi | FortiGate | UniFi does not manage the FortiGate, so check the WAN on the FortiGate. Field reports. |
| Switch ports, PoE, VLAN tagging | UniFi | UniFi | Unchanged. UniFi still runs the switches. |
| Wi-Fi, SSIDs, wireless clients | UniFi | UniFi | Unchanged. |
| Which switch port a device is on | UniFi | UniFi | Only UniFi knows. The FortiGate sees the device's MAC on its VLAN interface, not the port. (Full port view on the FortiGate needs FortiSwitch, managed over FortiLink.) |
Part 2 · Why things show up wrong
Missing switches, odd IPs, and devices stuck "adopting."
Most of these come from one fact: UniFi isn't the router or the DHCP server any more, so it has to learn addresses secondhand and reach its devices across the FortiGate.
| What you see in UniFi | Likely cause | Check |
|---|---|---|
| Switch or AP stuck "Adopting" or keeps going offline | The controller is on another VLAN and the device can't reach it. UniFi devices need TCP 8080 to the Network app. | A FortiGate policy allows the device VLAN to reach the controller on TCP 8080. Option 43 or a DNS name unifi points at the controller. |
Device shows 192.168.1.20 or a 169.254.x.x address | It never got a DHCP lease. That's its fallback address. | The FortiGate's DHCP server is on for that VLAN, the uplink port carries the right native VLAN, and DHCP Guarding trusts the FortiGate. |
| Switch drops off after changing its management VLAN | The new VLAN isn't tagged on the upstream port, or it's already the port's native VLAN. | Tag the VLAN on every port up to the FortiGate before you set Network Override. A wrong change can need a factory reset at the switch. |
| A VLAN works on the FortiGate but devices on it get no address | The VLAN isn't defined in UniFi, so the switch ports never carry it. | Create it in UniFi as a network with Router: Third-party Gateway and the same VLAN ID. |
| Clients on one VLAN get no IP, others are fine | DHCP Guarding is on and doesn't list the FortiGate as a trusted server for that network. | Enter the FortiGate's interface IP for that VLAN as the trusted DHCP server. |
| Clients show a MAC but no IP or name, or an old IP | UniFi isn't the DHCP server, so it doesn't have the lease table. Field reports; Ubiquiti doesn't document how UniFi picks up client IPs in this setup. | Trust the FortiGate's DHCP monitor (Dashboard › Network › DHCP) for the current IP. Match on MAC. |
| The FortiGate looks like a client, an unknown device, or doesn't show in the topology | UniFi doesn't manage third-party gateways. Field reports. | Expected. Don't try to adopt or fix it in UniFi. |
Rule of thumb: for an address question, ask the FortiGate. For a port, PoE or Wi-Fi question, ask UniFi. Match the two on the device's MAC address.
Part 3 · FortiGate as the DHCP server
The FortiGate hands out the addresses, so it holds the facts.
When the FortiGate runs DHCP, the lease table, the reservations and the DHCP options all live on the FortiGate. UniFi only knows what it overhears. This is the same rule as in DHCP reservations: the DHCP server holds the reservation.
What UniFi loses
- The lease table. UniFi can't tell you who has which IP for sure. The FortiGate can.
- Reservations. A Fixed IP set in UniFi is for a UniFi gateway's DHCP server. Make the reservation on the FortiGate.
- DHCP options from UniFi. Option 43 and the other DHCP settings in UniFi aren't used. Set them on the FortiGate.
Things that differ
- Lease time. The FortiGate defaults to 7 days, UniFi gateways to 1 day. A moved device can keep an old address longer.
- DHCP Guarding. On by default on UniFi switches. It has to trust the FortiGate's IP or clients get nothing.
- Phones. Provisioning options (like option 66) go on the FortiGate's DHCP server too.
Reservation and option 43 on the FortiGate (CLI)
In the GUI both are on the interface's DHCP server settings. The CLI below reserves an IP for one MAC and points UniFi devices at a controller on 10.0.10.5. Option 43 is 0104 followed by the controller IP in hex: 10.0.10.5 is 0a 00 0a 05.
config system dhcp server
edit 2
config reserved-address
edit 1
set ip 10.0.20.45
set mac ac:cc:8e:4c:22:10
set description "Parking lot camera"
next
end
config options
edit 1
set code 43
set type hex
set value 01040a000a05
next
end
next
end
Scope 2, the IPs and the MAC are examples. Run show system dhcp server first to find the right scope ID.
What the FortiGate can't see: device detection on the FortiGate works on devices on its directly connected LAN interfaces, by MAC. It sees the clients on each VLAN, but not which UniFi switch or port they're on. Turning on LLDP reception on the interface facing the UniFi switch lets the FortiGate list that switch as a neighbor.
Part 4 · Set it up right
Make both sides agree.
A mixed site works fine when the VLANs, the DHCP server and the adoption path are set up on purpose and written down.
- One DHCP server per VLAN: the FortiGate. Keep every reservation there and note it in the site docs. Don't add Fixed IPs in UniFi for those networks.
- Same VLANs on both sides. Each FortiGate VLAN interface gets a matching UniFi network with Router set to Third-party Gateway and the same VLAN ID.
- Match the native VLAN on the uplink. The untagged network on the FortiGate port must match the native network on the UniFi uplink port.
- Give devices a way to find the controller. If the controller is on another VLAN, push option 43 from the FortiGate or add a DNS name
unifi, and allow TCP 8080 from the device VLAN to the controller. - Trust the FortiGate in DHCP Guarding. Enter the FortiGate's interface IP as the trusted DHCP server on each network.
- Set the management VLAN last. Tag it on every upstream port first, then set Network Override on the switch.
- Turn on device detection and LLDP on the FortiGate LAN ports. The FortiGate then lists clients and the UniFi switch it plugs into.
Sources
Where this comes from.
- Ubiquiti: Creating virtual networks (VLANs), third-party gateway setting
- Ubiquiti: Traffic identification and Traffic flows, UniFi gateway required
- Ubiquiti: Layer 3 adoption, TCP 8080, option 43 format, DNS
unifi - Ubiquiti: Local DNS and Fixed IP, gateway only
- Ubiquiti: Switch settings and VLAN troubleshooting, management VLAN, native VLAN, DHCP Guarding
- Ubiquiti: DHCP Guarding, trusted server IP
- Ubiquiti: Fallback IP, 192.168.1.20
- Fortinet: config system dhcp server, reserved-address, options, 7-day default lease
- Fortinet: Option 43 for Ubiquiti
- Fortinet: LLDP reception and device detection
