A real-life situation
Corbridge Freight, a fictional company, is replacing an old firewall at its head office with two FortiGates in an HA pair. The installer racks both units, connects the Internet to the ports labelled WAN, plugs the HA ports into the core switch "because there was a free VLAN", and enables HTTPS on the WAN interface so a contractor can manage the firewalls from home. Within a month, the logs show thousands of login attempts from the Internet, and a switch reboot causes both FortiGates to become primary at once.
Every one of these problems was decided at the port-planning stage, before any policy was written. This lesson covers what each port is for and how to plan them.
What the ports on a FortiGate are
Front panels differ a lot between models, so the first step with any FortiGate is to read its QuickStart guide or hardware guide. These are the port types you will meet:
| Port type | Typical names in FortiOS | What it is for |
|---|---|---|
| WAN | wan1, wan2 | Internet or WAN connections; often set to DHCP client by default |
| LAN / internal | internal1… grouped as internal or lan | Desktop models: several copper ports joined in a hardware switch with one IP address |
| DMZ | dmz | A separate network for servers reachable from outside |
| Numbered data ports | port1, port2… | Mid-range and larger models: general-purpose interfaces for any role |
| Fibre cage ports | x1, x2… or numbered | SFP, SFP+, SFP28, QSFP+ or QSFP28 cages for 1 to 100 Gbps with a transceiver |
| Management | mgmt, mgmt1 | A port intended for administration only, often with a factory default address |
| HA | ha, ha1, ha2 | Ports intended for heartbeat links between cluster members |
| Console | none (not an interface) | RJ-45 serial port, and a USB console on some newer models, for CLI access without IP |
| USB (type A) | none | A USB drive for firmware or configuration, or a 3G/4G modem on some models |
Names, numbers and defaults vary by model and sometimes by firmware release. Labels on the case show the intended role; FortiOS treats most of them as ordinary interfaces you can configure for any role.
Which ports a model has, which network processor serves each port, whether the MGMT and HA ports can carry data traffic, and which transceiver speeds a cage accepts are all model specific. The hardware guide for your model is the reference, and the port-to-processor mapping matters for offloading.
FortiGate VM ports
A FortiGate VM has no physical ports. Each virtual NIC that the hypervisor attaches appears as port1, port2 and so on, in the order the hypervisor presents them, and port1 is normally used for first access. There is no console port: you use the hypervisor's console window instead. If interfaces come up in an unexpected order after adding NICs, compare the MAC addresses in FortiOS with the ones in the hypervisor.
Logical interfaces built on ports
A physical port is the starting point. FortiOS builds logical interfaces on top of ports, and policies can use either:
- VLAN: one 802.1Q VLAN on a parent port; many networks on one cable.
- Aggregate: several ports bundled with LACP; redundant: several ports with one active.
- Hardware switch / software switch: several ports acting as one switched network with one IP address.
- Loopback and tunnel interfaces: virtual interfaces that need no port of their own.
Learn more: FortiGate Interfaces, VLANs, Aggregates and Zones
Management: in-band or out-of-band
In-band management means administrators reach the FortiGate over the same networks that carry user traffic, for example HTTPS to the LAN interface. Out-of-band (OOB) management uses a separate network, often a dedicated switch and VLAN, that carries only management traffic.
| In-band | Out-of-band | |
|---|---|---|
| Cost | No extra cabling | A management switch and cabling |
| When the data network fails | You may lose access exactly when you need it | Access stays available |
| Exposure | Management shares a network with users | Only the management network can reach it |
| Fits | Small sites | Data centres, HA clusters, regulated networks |
The console port is the last line of OOB access. It works with no IP configuration at all, which is why a console server (or at least a known console cable) for every important FortiGate saves long outages.
- 1. Data: User traffic uses port1 and port2 on the primary unit.
- 2. Heartbeat: Two direct cables between ha1 and ha2 carry heartbeats and sync.
- 3. Management: Admins reach each unit's own mgmt port over the OOB network.
The two OOB switches form one management network (10.0.9.0/24), joined to each other and to the administrators' VPN or jump host outside the picture. No user traffic crosses it.
Administrative access per interface
Every interface has an allowaccess list: the management protocols the FortiGate itself answers on that interface. Anything not in the list is ignored there. It controls traffic to the FortiGate, not traffic through it.
| Option | Allows | Typical interfaces |
|---|---|---|
https | Web GUI | Management, trusted LAN |
ssh | CLI over SSH | Management, trusted LAN |
ping | Replies to ping | Most internal interfaces; WAN only if needed for monitoring |
snmp | SNMP polling | Management, towards the monitoring server |
fgfm | FortiManager management | The interface FortiManager connects to |
http | Unencrypted GUI (redirects to HTTPS by default) | Rarely needed |
config system interface
edit mgmt
set ip 10.0.9.1 255.255.255.0
set allowaccess ping https ssh snmp
next
edit port1
set allowaccess ping
next
endThe management port answers the GUI, SSH, SNMP and ping; the Internet-facing port1 answers ping only. set replaces the whole list, so type every protocol you want to keep.
⚠ Do not remove the access you are using
Removing https or ssh from the interface you are connected through ends your session as soon as you type next. Change management access from a different interface or from the console, and keep console access available.
Edit Interface: mgmt
- Name
- mgmt
- Role
- LAN
- IP/Netmask
- 10.0.9.1/255.255.255.0
- IPv4
- HTTPS HTTP PING FMG-Access SSH SNMPOnly these protocols are answered on this interface.
Administrative Access
Trusted hosts
allowaccess decides where the FortiGate listens. Trusted hosts decide who may log in: each administrator account can list up to ten source subnets, and logins from anywhere else are refused.
config system admin
edit admin
set trusthost1 10.0.9.0 255.255.255.0
next
endThe admin account can now log in only from the management subnet. Set trusted hosts on every administrator account: one account without them leaves logins open from any source that can reach a management interface.
For extra control, the management ports can be changed (admin-sport and admin-ssh-port under config system global), and local-in policies can filter traffic to the FortiGate itself by source, interface and service.
Learn more: Admin Accounts, Backups and Firmware
Management in an HA cluster
In an FGCP cluster, configuration is synchronised, so both units would normally share the same interface addresses, and only the primary answers them. To reach each unit on its own, for monitoring, SNMP or firmware checks, you can reserve a management interface per unit. Its address is not synchronised, so each unit keeps its own.
config system ha
set ha-mgmt-status enable
config ha-mgmt-interfaces
edit 1
set interface mgmt
set gateway 10.0.9.254
next
end
endReserves mgmt as each unit's own management interface, with its own gateway. Give mgmt a different address on each unit (10.0.9.1 and 10.0.9.2, for example). A reserved interface can't be used in policies.
The reserved management interface works the same way in 7.4 and 7.6, but the restrictions on which interface can be reserved, and related options, have changed between releases. Check the HA chapter of the Administration Guide for your release before configuring it.
HA heartbeat links
Cluster members exchange heartbeats several times a second, and use the same links to synchronise configuration and, if enabled, sessions. If every heartbeat link fails while both units are still running, each unit believes the other is gone and both become primary: a split brain, with two devices answering for the same addresses.
- Use two heartbeat links, so one failed cable or port doesn't break the cluster.
- Connect them directly, unit to unit, where the units are close. If they must cross switches, use dedicated switches or isolated VLANs that carry nothing else.
- Keep data off them. Heartbeat ports should not also carry user traffic; a busy data link can delay heartbeats and trigger false failovers.
- Match ports on both units. FGCP clusters need identical models, so ha1 on one unit connects to ha1 on the other.
config system ha
set hbdev "ha1" 50 "ha2" 50
endSets ha1 and ha2 as heartbeat interfaces with equal priority. The heartbeat priority decides which link is used first; the other takes over if it fails.
Learn more: High Availability with FGCP
The console port
- Connector: RJ-45 on most models, with an RJ-45 to DB-9 or USB serial cable; some newer models also have a USB console port.
- Settings: by default on most models 9600 baud, 8 data bits, no parity, 1 stop bit, no flow control.
- Why it matters: it works when no interface has an address, when management access has been removed by mistake, and during firmware upgrades, where it shows boot messages that no network session can.
Identifying ports from the CLI
Before cabling, confirm that the port you are about to use is the one you think it is, that it has link, and at what speed.
FGT1 # get system interface physical == [onboard] ==[mgmt] mode: static ip: 10.0.9.1 255.255.255.0 status: up speed: 1000Mbps (Duplex: full) ==[port1] mode: static ip: 203.0.113.2 255.255.255.252 status: up speed: 1000Mbps (Duplex: full) ==[x1] mode: static ip: 0.0.0.0 0.0.0.0 status: down speed: n/a ...
status: down points at the cable, the transceiver or the other end.FGT1 # get hardware nic port1 Name: port1 ... Link: up Speed: 1000 Duplex: full ... Current_HWaddr 00:09:0f:xx:xx:xx Permanent_HWaddr 00:09:0f:xx:xx:xx ...
diagnose hardware deviceinfo nic port1 gives the same information, often with more detail. Rising error counters with a working link usually mean a cable, transceiver or duplex problem.Speed and duplex
Ports auto-negotiate by default. If the device at the other end has a fixed speed, set the same fixed speed and duplex on both sides; a mismatch (one side auto, the other fixed) commonly ends in a half-duplex link with errors and poor performance.
config system interface
edit port5
set speed 1000full
next
endFixes port5 at 1 Gbps full duplex. Use set speed auto to return to auto-negotiation. The values offered depend on the port and transceiver; press ? after set speed to see them.
⚠ Changing speed drops the link
The link renegotiates as soon as the change is saved, interrupting every network that uses the port. Change speed on a production port only in a maintenance window, and agree the setting with whoever manages the other end.
Planning a port map
Write the port map before installation, and keep it with the network documentation. Here is the plan for Corbridge Freight's HA pair, using a hypothetical mid-range model with ten copper ports, two SFP+ cages, two HA ports and one MGMT port:
| Port | Role | Connects to | Address | allowaccess |
|---|---|---|---|---|
port1 | WAN (ISP 1) | ISP router | 203.0.113.2/30 | ping |
port2 | LAN | Core switch, trunk | 10.0.1.1/24 (+ VLANs) | ping |
port3 | DMZ | DMZ switch | 10.0.2.1/24 | ping |
x1 + x2 | Aggregate to data centre core (planned) | Core, LACP, 10G SR optics | Unassigned | none |
ha1, ha2 | HA heartbeat | The other unit, direct cables | Set by FGCP | n/a |
mgmt | Reserved management | OOB switch | 10.0.9.1 / 10.0.9.2 | https ssh snmp ping |
| Console | Emergency access | Console server | n/a | n/a |
A good port map also records the cable or patch panel ID, the switch port at the other end, the transceiver type, and spare ports reserved for growth.
Verification
get system interface physical: every planned port is up at the expected speed; unused ports are down.get system ha status: both units are in the cluster and heartbeats are seen on both links.- From the admin PC on the OOB network, reach each unit by its own management address with HTTPS and SSH.
- From the Internet side, confirm the WAN address doesn't answer HTTPS or SSH.
Common mistakes and how to fix them
Management exposed on the WAN interface
HTTPS or SSH is in the WAN interface's allowaccess list, often added once "for a quick remote fix". The logs show constant failed logins from Internet addresses, and any future vulnerability in the management interface is reachable from anywhere.
Show the fix
Remove https, ssh and http from the WAN interface (keep ping only if monitoring needs it). Give remote administrators a VPN that lands on the management network, or manage through FortiManager. If WAN management truly can't be avoided, restrict it with trusted hosts on every admin account and a local-in policy, and use multi-factor authentication.
HA heartbeat through a switch shared with data
The heartbeat ports are connected through the core switch. A switch reboot, a spanning-tree change or a broadcast storm interrupts heartbeats, and both units become primary.
Show the fix
Connect two heartbeat links directly between the units. If distance makes that impossible, use dedicated switches, or VLANs that carry nothing but heartbeat traffic, on separate physical paths. Check the result with get system ha status.
Splitting the hardware switch and losing the LAN
On a desktop model, an administrator removes one port from the built-in LAN hardware switch to use it as a DMZ. The change is refused, or it succeeds and the administrator's own connection drops because they were plugged into that port.
Show the fix
Connect to a port that stays in the switch (or use the console) before changing members. A port can only leave the switch when nothing else references it, so remove it from DHCP, policies and other objects first. After removal it becomes a separate interface that needs its own address, access settings and policies. On many desktop models the hardware switch is edited in Network › Interfaces, or under config system virtual-switch in the CLI; check your model.
Wrong transceiver
A new SFP+ port shows status: down although the cable is plugged in. The optic is multimode short-range (SR) while the fibre run is single-mode, or the module is a speed the cage doesn't support, or it isn't a supported module for this model.
Show the fix
Match the transceiver to the fibre type, distance and speed at both ends (SR with multimode fibre, LR with single-mode, and the same wavelength on both sides). Use modules listed as supported for the model. If a 10G cage holds a 1G module, the port speed may need to be set manually; check the hardware guide.
Enterprise design guidance
- Separate the three kinds of connection: data ports, heartbeat ports and management ports, each with its own cabling.
- Build an OOB network for firewalls, switches and console servers in data centres and large sites, reachable through its own VPN or jump host.
- Plan for offload: on models with several network processors, ports on the same NP can offload sessions between each other more efficiently. The hardware acceleration guide lists the mapping.
- Leave spare ports on both units of a cluster, in matching positions, for later growth.
- Standardise: use the same port roles across every site with the same model, so configurations and runbooks stay alike.
Best practices
- Allow management protocols only on the management interface or trusted internal interfaces.
- Set trusted hosts on every administrator account.
- Use two direct heartbeat links that carry no data traffic.
- Keep a tested console path to every important FortiGate.
- Document a port map before installation and update it with every change.
🛠 Practical exercise: map the ports of a FortiGate you can reach
On a lab FortiGate VM (or a hardware unit you are allowed to inspect), run get system interface physical and list every port with its status, address and speed. Run show system interface and record each port's allowaccess list. Mark any interface that answers HTTPS or SSH and isn't a management or trusted network, and write the commands that would fix it. Finally, draw a port map table for a two-unit HA pair at a fictional site, including heartbeat, management and console connections.
Key takeaways
- Port labels suggest a role; the configuration decides it. Check the model's hardware guide.
allowaccesscontrols where the FortiGate answers management protocols; trusted hosts control who may log in.- Out-of-band management and a console path keep access available when the data network fails.
- Use two direct heartbeat links that carry no data, and a reserved management interface per HA unit.
- Plan a port map, including transceivers and spare ports, before installation.
Check yourself
port1 faces the Internet. Its allowaccess list is ping https ssh. What is the risk?
Both HA heartbeat links run through the core switch. After a switch reboot, both units report themselves as primary. Why?
get system interface physical shows x1 with status: down. The fibre is plugged in and the other end uses LR optics. The FortiGate has an SR module. What is wrong?
An admin account has trusted host 10.0.9.0/24. The administrator tries to log in from 10.0.1.25 on a LAN interface that allows HTTPS. What happens?
Each unit in an HA cluster must be reachable on its own address for SNMP monitoring. What do you configure?
Next in Fortinet Fundamentals: what happens behind the ports, in Security processors and hardware acceleration.