How to connect Fortigate console from Linux? Fortigate is one of the best physical firewalls in the world today. For system administrators, working with Fortigate is not to be missed.
What is minicom?
Table of Contents
Minicom is a command-line application that allows you to connect to serial ports to communicate with physical devices such as routers, switches, and firewalls.
Why do I mention Minicom? This is because I will use this tool to connect to the Fortigate firewall.
To install Minicom on Ubuntu or Linux Mint, type the following command.
sudo apt-get install minicom
Connect your computer to the Fortigate firewall
Yes, now you need a console cable to connect your computer to Fortigate.
It looks like this.
On the Fortigate firewall that supports the USB MGMT port and Console port, connect to the Console port of the device, port number 3
in the image below.
Connect Fortigate console from Linux
Now open up the terminal and type the command below to see which device is connected to the serial port on your computer.
danie@danie-laptop:~$ dmesg | grep tty
[ 0.083833] printk: console [tty0] enabled
[ 5.079930] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
And you can see that the firewall is connecting to usb 1-2
, so the path to the serial port is /dev/ttyUSB0
.
Then type the following command to run the minicom tool.
sudo minicom -s /dev/ttyUSB0
Next, use the up & down keys to navigate to the Serial port setup
menu.
+-------[configuration]-------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as _dev_ttyUSB0 |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+-----------------------------+
Then you press the A
key to change the path to the serial port connected above.
+-----------------------------------------------------------------------+
| A - Serial Device : /dev/ttyUSB0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 9600 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
Press the E
key to change the Bits
number to match the Fortigate firewall.
Depending on the different device type, specifications may differ. With the Fortigate firewall, note the Bits setting is 9600 8N1
and you can read more at this page.
Then press Enter
to exit port setting. Then scroll down to the menu Save setup as _dev_ttyUSB0
to save the configuration.
Finally, you scroll down and click Exit
to return to the command manipulation window of minicom.
The terminal windows will look like this, you can type the fortigate commands on this.
Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Aug 13 2017, 15:25:34.
Port /dev/ttyUSB0, 13:17:34
Press CTRL-A Z for help on special keys
FG100D3G12800663 #
Conclusion
These are all steps for you to connect to the Fortigate console from a Linux computer. You know, most of the instructions on the internet guide you to connect from a Windows computer, quite a bit for Linux. I hope this article can be helpful for those who are using Linux.
(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).