FortiGate Initial Config via CLI

Configure Network Interfaces

Example:

  • Set wan1 interface to static IP address 198.51.100.244/255.255.255.240
  • Configured default route of 198.51.100.241.
  • Allow ping and HTTPS on wan1 interface
  • Set LAN interface to 192.168.100.1/255.255.255.192
  • Set LAN interface’s DHCP scope address range as 192.168.100.30-59
  • Change lease time from default of 7 days to 2 hours
config system interface
 edit wan1
  set mode static
  set ip 198.51.100.244/28
  set allowaccess ping https fgfm
 next
 edit lan
  set ip 192.168.100.1/26
 end
config router static
 edit 0 
  set gateway 198.51.100.241
  set distance 1
  set device wan1
 end
config sys dhcp server
 edit 1
  set default-gateway 192.168.100.1
  set netmask 255.255.255.192
  set lease-time 7200
  config ip-range
   edit 1
    set start-ip 192.168.100.30
    set end-ip 192.168.100.59
   end
  end

Other useful commands

Change the admin user password:

config system admin
 edit admin
 set password MyNewPassword end

Create a secondary admin user

config system admin
    edit secondadminusername
      set accprofile super_admin
      set password MyPasswordGoesHere

Get L1 and L3 status of all interfaces

get system interface physical

Disabled/Enable an interface

config system interface
 edit lan
  set status down
 next
 edit lan
  set status up
 end

Enable sending of LLDP information

config system global
    set lldp-transmission enable
end

Check the route table

get router info routing-table all

Check the ARP Table

get system arp

Get the software version and serial number

get system status

Ping something

execute ping 8.8.8.8

Reboot the firewall

execute reboot

 

 

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s