Connecting to the CLI
You can connect to the CLI using a direct console connection, SSH, or the CLI console in the GUI.
You can access the CLI outside of the GUI in three ways:
- Console connection: Connect your computer directly to the console port of your FortiProxy.
- SSH access: Connect your computer through any network interface attached to one of the network ports on your FortiProxy.
To open a CLI console, click the _> icon in the top right corner of the GUI. The console opens on top of the GUI. It can be minimized and multiple consoles can be opened. On many GUI pages, the CLI console can be opened with that pages specific commands already shown by clicking Edit in CLI in the right-side gutter.
To edit policies and objects directly in the CLI, right-click on the element and select Edit in CLI.
Console connection
A direct console connection to the CLI is created by directly connecting your management computer or console to the FortiProxy using its DB-9 or RJ-45 console port.
Direct console access to the FortiProxy may be required if:
- You are installing the FortiProxy for the first time and it is not configured to connect to your network.
- You are restoring the firmware using a boot interrupt. Network access to the CLI will not be available until after the boot process has completed, making direct console access the only option.
To connect to the FortiProxy console, you need:
- A console cable to connect the console port on the FortiProxy to a communications port on the computer. Depending on your device, this is one of:
- null modem cable (DB-9 to DB-9)
- DB-9 to RJ-45 cable (a DB-9-to-USB adapter can be used)
- USB to RJ-45 cable
- A computer with an available communications port
- Terminal emulation software
To connect to the CLI using a direct console connection:
- Using the console cable, connect the FortiProxy unit’s console port to the serial communications (COM) port on your management computer.
- Start a terminal emulation program on the management computer, select the COM port, and use the following settings:
Bits per second
9600
Data bits
8
Parity
None
Stop bits
1
Flow control
None
- Press Enter on the keyboard to connect to the CLI.
- Log in to the CLI using your username and password (default: admin and no password).
You can now enter CLI commands, including configuring access to the CLI through SSH.
SSH access
SSH access to the CLI is accomplished by connecting your computer to the FortiProxy using one of its network ports. You can either connect directly, using a peer connection between the two, or through any intermediary network.
|
If you do not want to use an SSH client and you have access to the GUI, you can access the CLI through the network using the CLI console in the GUI. |
SSH must be enabled on the network interface that is associated with the physical network port that is used.
If your computer is not connected either directly or through a switch to the FortiProxy, you must also configure the FortiProxy with a static route to a router that can forward packets from the FortiProxy to the computer. This can be done using a local console connection, or in the GUI.
To connect to the FortiProxy CLI using SSH, you need:
- A computer with an available serial communications (COM) port and RJ-45 port
- An appropriate console cable
- Terminal emulation software
- A network cable
- Prior configuration of the operating mode, network interface, and static route.
To enable SSH access to the CLI using a local console connection:
- Using the network cable, connect the FortiProxy unit’s port either directly to your computer’s network port, or to a network through which your computer can reach the FortiProxy.
- Note the number of the physical network port.
- Using direct console connection, connect and log into the CLI.
- Enter the following command:
config system interface edit <interface_str> append allowaccess ssh next end
Where
<interface_str>
is the name of the network interface associated with the physical network port, such asport1
. - Confirm the configuration using the following command to show the interface’s settings:
show system interface <interface_str>
For example:
show system interface port1 config system interface edit "port1" set vdom "root" set ip 192.168.1.99 255.255.255.0 set allowaccess ping https ssh set type hard-switch set stp enable set role lan set snmp-index 6 next end
Connecting using SSH
Once the FortiProxy is configured to accept SSH connections, use an SSH client on your management computer to connect to the CLI.
The following instructions use PuTTy. The steps may vary in other terminal emulators.
To connect to the CLI using SSH:
- On your management computer, start PuTTy.
- In the Host Name (or IP address) field, enter the IP address of the network interface that you are connected to and that has SSH access enabled.
- Set the port number to 22, if it is not set automatically.
- Select SSH for the Connection type.
- Click Open. The SSH client connect to the FortiProxy.
The SSH client may display a warning if this is the first time that you are connecting to the FortiProxy and its SSH key is not yet recognized by the SSH client, or if you previously connected to the FortiProxy using a different IP address or SSH key. This is normal if the management computer is connected directly to the FortiProxy with no network hosts in between.
- Click Yes to accept the FortiProxy's SSH key.
The CLI displays the log in prompt.
- Enter a valid administrator account name, such as
admin
, then press Enter. - Enter the administrator account password, then press Enter.
The CLI console shows the command prompt (FortiProxy hostname followed by a
#
). You can now enter CLI commands.
|
If three incorrect log in or password attempts occur in a row, you will be disconnected. If this occurs, wait for one minute, then reconnect and attempt to log in again. |