Configuring Network Settings using the CLI

This topic describes the steps to configure your network settings using the CLI. For details about each command, refer to the Command Line Interface section.

  1. Set the IP address and netmask of the LAN interface:
    config system interface
      edit <port>
      set ip <ip_address> <netmask>
      set allowaccess (http https ping ssh telnet)
    end
    
    where:
    • <port> can be one of port1- port4.
    • <ip_address> is the interface IP address.
    • <netmask> is the interface netmask.
    Sample Command:
    config system interface
     edit port1
     set ip 192.168.100.159 255.255.255.0
     set allowaccess ping https ssh
    end
    
  2. Set the primary and optionally the secondary DNS server:
    config system dns
      set primary <dns-server_ip>
      set secondary <dns-server_ip>
    end
    
    where:
    • <dns-server_ip> is the primary or secondary DNS IP server address
    Sample Command:
    config system dns
     set primary 65.39.139.52
     set secondary 65.39.139.62
    end
    
  3. Set the default gateway:
    config system route
      edit <seq_num>
      set device <port>
      set gateway <gateway_ip>
    end
    
    where:
    • <seq_num> is an unused routing sequence number starting from 1 to create a new route.
    • <port> is the port used for this route.
    • <gateway_ip> is the default gateway IP address for this network.
    Sample Command:
    config system route
     edit 1
     set device port1
     set gateway 172.30.62.254
    end
    
  4. Set a network protocol (NTP) server:
    config system ntp
        set server <server_ip>
        set status (enable | disable)
    end
    
    where:
    • <server_ip> is the IP address or fully qualified domain name of the NTP server.
    Sample Command:
    config system ntp
     set server 172.30.62.81
     set status enable
    end
    
Related concepts
Network Configuration
Interface
DNS
Routing



FortiDB 5.0.0 Handbook
1st Edition , July 11 2013
© Copyright 2013 Fortinet Inc. All rights reserved.
Latest documentation: http://docs.fortinet.com/fdb.html