Some FortiGate commands you might need

This is a repost of a post from an old blog, made on December 27, 2011, that used to be on:

http://adminramble.com/fortigate-useful-commands/

Original post:

I been using FortiGate devices for a few months now, and I have mostly been doing the administration through the web interface, but even that will require you to do some stuff through CLI.

Here are some of the commands you might need.

(If you don’t have a CLI on your dashboard, you can add it by clicking on plus sign on a Widget button on top of your dashboard and selecting a CLI Console from it.)

To execute all of this commands you need to click with your mouse inside the CLI Console widget so you can type in it.

 HOW TO PING OR TRACEROUTE AN ADRESS FROM A FORTIGATE UNIT:
  • type “execute ping” or “execute traceroute” followed by an address you want to ping e.g.“execute ping 10.10.10.10″
HOW TO SHUTDOWN OR REBOOT A FORTIGATE UNIT FROM A CLI:
  • type “execute shutdown” or “execute reboot”
HOW TO CHANGE AN ADMIN USER PASSWORD:
  • type “config system admin”
  • type “edit” followed by a user you want to reset the password for, e.g. “edit Joe”
  • type “set password” followed by a new password, e.g. “set password NewPass1
  • type “end” to finish the procedure
HOW TO RESET A LOST PASSWORD ON A FORTIGATE UNIT:
  • start some terminal emulator and connect to the device using a a console cable. Depending on which device you use it will be a RJ-45 to Serial or Serial to Serial cable
  • Reboot the device and immediately it starts up login with user “maintainer” and password “bcpb%deviceserialnumber%” e.g. “bcpbFGT60C1A01102345″ (This should be done inside 14 seconds i think, i took me a few tries before i managed to do it, also the serial number is case sensitive)
  • change the user password as described above
    config system admin
    edit %user%
    set password %password%
    end
HOW TO RESET FORTIGATE TO FACTORY DEFAULTS:
  • type “execute factoryreset”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.