Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Fortinet Layer by Layer Cheat Sheet

Command/ActionDescriptionDangerous
get system interfaceCheck interface status, speed, and duplex settings.Safe
Physical checkVerify cable conditions and connections.Safe
diag phy infoDisplay physical layer information, including PHY chips.Safe
diag hardware deviceinfo nicDisplay NIC information for all interfaces.Safe
diag test application port-phy <port>Run diagnostics on the physical port (use port number).Dangerous
get hardware nic <interface>Get detailed information about a specific network interface.Safe
diag switch-controller phy-infoShow physical layer info for switch interfaces.Safe
diag sniffer packet <interface>Capture real-time traffic on an interface for analysis.Dangerous
diag hardware test interface <iface>Perform a hardware-based test on specified interface.Dangerous
LED checkCheck LEDs on device for status indicators.Safe
diag cable-diagnostics tdr <port>Run Time-Domain Reflectometer on port to check cable quality.Dangerous
get system performance statusCheck system performance and resource usage.Safe
diag netlink interface listList interfaces with detailed state and settings.Safe
diag debug enableEnable debugging before running detailed diagnostic commands.Dangerous
diag debug disableDisable debugging after diagnostics are complete.Safe
diag hardware test allPerform comprehensive hardware tests (use with caution).Dangerous
get hardware statusCheck the status of hardware components.Safe
diag switch-controller detect-poeDetect Power over Ethernet status on switch ports.Safe
get system ha statusCheck the High Availability status and configurations.Safe
diag hardware sensor listList sensors and their current readings.Safe
diag system topDisplay top CPU-consuming processes (helpful for load issues).Safe
diag debug flow trace start 100Start packet flow tracing (number of packets to trace).Dangerous
diag debug flow trace stopStop packet flow tracing.Safe
diag switch mac-address listList MAC addresses learned by switch ports.Safe
Re-seat connectionPhysically re-seat the connection to ensure good contact.Safe
diag test hardware loopback <iface>Test loopback on a specified interface.Dangerous
diag netlink link listShow link layer information for all interfaces.Safe
get router info ospf neighborCheck OSPF neighbors to verify link layer connectivity.Safe
diag vpn tunnel listList all active VPN tunnels (indirect link layer check).Safe
diag switch-controller switch-infoGet information and status of managed switches.Safe
Command/ActionDescriptionDangerous
get system interfaceVerify VLAN IDs and tagging settings.Safe
diag switch-controller dump-macDisplay MAC address table on managed switches.Safe
diag hardware switch-macShow MAC addresses learned by switch ports.Safe
diag sniffer packet <interface> 'vlan'Capture VLAN-tagged packets on a specified interface.Dangerous
get switch vlanDisplay VLAN configuration across switch interfaces.Safe
diag netlink brctl showShow bridge information and associated interfaces.Safe
diag lldp neighbors listList LLDP neighbors to verify device connectivity.Safe
get system stpShow Spanning Tree Protocol status and configuration.Safe
diag switch vlan dumpDump VLAN table entries for troubleshooting VLAN issues.Safe
get hardware switch port-summarySummarize switch port status and configurations.Safe
diag netlink interface listList network interfaces and verify their state and settings.Safe
diag switch-controller switch-infoGet information about managed switches.Safe
get system arpDisplay the ARP table to check Layer 2 IP-to-MAC resolutions.Safe
diag debug enableEnable debug mode before running diagnostic commands.Dangerous
diag debug disableDisable debug mode after completing diagnostics.Safe
diag test application switch 1Test switch functionality for errors (use with caution).Dangerous
get system lacpDisplay LACP (Link Aggregation Control Protocol) status.Safe
diag switch error-countersCheck for error counters on switch interfaces.Safe
diag switch mclag-icap infoDisplay multi-chassis link aggregation group info.Safe
diag switch-controller mac-policy listList MAC policies applied to switch ports.Safe

Layer 3: Network Layer Checks

Command/ActionDescriptionDangerous
get system interfaceCheck IP address and subnet mask configuration.Safe
get router info routing-table allCheck routes to peers are present with correct next hops.Safe
get router info routing-table detailsShow detailed routing information.Safe
diag ip route listList all routes and their metrics.Safe
get system interface listShow all interfaces with IP configurations.Safe
diag route lookup <ip_address>Perform a route lookup to determine the route to a specific IP.Safe
get router info kernelDisplay kernel routing table entries.Safe
get router info ospf neighborCheck OSPF neighbor relationships.Safe
get router info ospf databaseDisplay OSPF database entries.Safe
diag vpn tunnel listList all active VPN tunnels.Safe
diag firewall proute listDisplay policy-based routes.Safe
get system sdwanDisplay SD-WAN status and rules.Safe
get system sdwan health-checkShow SD-WAN health check information.Safe
diag debug flow trace start 100Trace the first 100 packets to debug routing decisions (use carefully).Dangerous
diag sniffer packet any 'host <ip_address>' 4 0 aSniff packets to or from an IP address (use with caution).Dangerous
get router info bgp networkCheck BGP advertised networks.Safe
get router info bgp pathsExamine BGP path information.Safe
get system session listList current sessions (helpful for verifying NAT or policy enforcement).Safe
diag sys session clearClear current sessions (use with caution, as this may disrupt traffic).Dangerous
get firewall policyReview firewall policies affecting traffic flow.Safe
get firewall addrgrpDisplay configured address groups for firewall policies.Safe

Layer 4: BGP Session Checks

Command/ActionDescriptionDangerous
diag ip router listConfirm BGP session state.Safe
get router info bgp summaryCheck BGP sessions and configurations.Safe
get router info bgp neighborsVerify BGP neighbor configurations.Safe
get router info bgp neighbors <neighbor IP> received-routesCheck routes received from BGP neighbors.Safe
get router info bgp neighbors <neighbor IP> advertised-routesCheck routes advertised to BGP neighbors.Safe

Layer 7: Application Checks

Command/ActionDescriptionDangerous
Review BGP configurationCheck for route-maps, prefix-lists, or filter-lists.Safe
diag log report | grep BGPSearch logs for BGP related error messages.Safe
Last updated on 9 Feb 2024
Published on 9 Feb 2024