Fortigate防火墙常用命令

摘要:
命令结构#config配置策略、对象等#get查看相关对象的参数#show查看配置文件#diagnose Diagnostic Command#execute常见工具命令,如pingterrert,执行命令。
  1. 命令结构

    #config 对策略,对象等进行配置

    #get  查看相关对象的参数

    #show 查看配置文件

    #diagnose 诊断命令 

    #execute  常用的工具命令,如ping treacert,执行某条命令。

    #exit  退出

    #end 保存退出


  2.常用命令

  1、配置接口地址

   FortiGate # config system interface

   FortiGate (interface) # edit port1

   FortiGate (port1) # set ip 192.168.8.99/24

   FortiGate (port1) # end

  2.配置静态路由

  FortiGate (static) # edit 1

       FortiGate (1) # set device wan1

       FortiGate (1) # set dst 10.0.0.0 255.0.0.0

       FortiGate (1) # set gateway 192.168.57.1

       FortiGate (1) # end

  3.配置默认路由

  FortiGate (1) # set gateway 192.168.57.1

       FortiGate (1) # set device wan1

       FortiGate (1) # end

  4.添加地址

  FortiGate # config firewall address

       FortiGate (address) # edit clientnet

        new entry 'clientnet' added

       FortiGate (clientnet) # set subnet 192.168.1.0 255.255.255.0

       FortiGate (clientnet) # end

  5.添加ip池

  FortiGate (ippool) # edit nat-pool

        new entry 'nat-pool' added

       FortiGate (nat-pool) # set startip 100.100.100.1

       FortiGate (nat-pool) # set endip 100.100.100.100

       FortiGate (nat-pool) # end

  6.添加虚拟ip

  FortiGate # config firewall vip

       FortiGate (vip) # edit webserver

        new entry 'webserver' added

       FortiGate (webserver) # set extip 202.0.0.167

       FortiGate (webserver) # set extintf wan1

       FortiGate (webserver) # set mappedip 192.168.0.168

       FortiGate (webserver) # end

  7、配置上网策略

       FortiGate # config firewall policy

       FortiGate (policy) # edit 1        

       FortiGate (1)#set srcintf internal //源接口

       FortiGate (1)#set dstintf wan1    //目的接口

       FortiGate (1)#set srcaddr all        //源地址

       FortiGate (1)#set dstaddr all       //目的地址

       FortiGate (1)#set action accept      //动作

       FortiGate (1)#set schedule always    //时间

       FortiGate (1)#set service ALL          //服务

       FortiGate (1)#set logtraffic disable     //日志开关

       FortiGate (1)#set nat enable               //开启nat

       end

  8、配置映射策略

       FortiGate # config firewall policy

       FortiGate (policy) #edit 2

       FortiGate (2)#set srcintf wan1  //源接口

       FortiGate (2)#set dstintf internal //目的接口

       FortiGate (2)#set srcaddr all          //源地址

       FortiGate (2)#set dstaddr FortiGate1  //目的地址,虚拟ip映射,事先添加好的

       FortiGate (2)#set action accept     //动作

       FortiGate (2)#set schedule always //时间

       FortiGate (2)#set service ALL     //服务

       FortiGate (2)#set logtraffic all   //日志开关

       end

  9、把internal交换接口修改为路由口

       确保关于internal口的路由、dhcp、防火墙策略都删除

       FortiGate # config system global

       FortiGate (global) # set internal-switch-mode interface

       FortiGate (global) #end

       重启

--------------------------------------

     1、查看主机名,管理端口

            FortiGate # show system global

     2、查看系统状态信息,当前资源信息

            FortiGate # get system performance status

     3、查看应用流量统计

           FortiGate # get system performance firewall statistics

     4、查看arp表  

           FortiGate # get system arp

     5、查看arp丰富信息

           FortiGate # diagnose ip arp list

     6、清楚arp缓存

            FortiGate # execute clear system arp table

     7、 查看当前会话表

            FortiGate # diagnose sys session stat 或 FortiGate # diagnose sys session full-stat;

     8、 查看会话列表

            FortiGate # diagnose sys session list

     9、查看物理接口状态

           FortiGate # get system interface physical

    10、查看默认路由配置

          FortiGate # show router static

    11、查看路由表中的静态路由

          FortiGate # get router info routing-table static

    12、查看ospf相关配置

           FortiGate # show router ospf

    13、查看全局路由表

          FortiGate # get router info routing-table all

-----------------------------------------------

    1、查看HA状态

        FortiGate # get system ha status

    2、查看主备机是否同步

     FortiGate # diagnose sys ha showcsum

---------------------------------------------------

   3.诊断命令:

      FortiGate # diagnose debug application ike -1

  ---------------------------------------------------

      execute 命令:

       FortiGate #execute  ping  8.8.8.8                                       //常规ping操作

       FortiGate #execute  ping-options source  192.168.1.200    //指定ping数据包的源地址 192.168.1.200

       FortiGate #execute  ping  8.8.8.8                                        //继续输入ping的目标地址,即可通过192.168.1.200的源地址执行ping操作

       FortiGate #execute  traceroute   8.8.8.8                  

       FortiGate #execute  telnet 2.2.2.2      //进行telnet访问                  

       FortiGate #execute  ssh  2.2.2.2        //进行ssh 访问

       FortiGate #execute  factoryreset        //恢复出厂设置

       FortiGate #execute  reboot              //重启设备

       FortiGate #execute  shutdown            //关闭设备

免责声明:文章转载自《Fortigate防火墙常用命令》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇C#对DataGridView进行添加、修改、删除数据操作apache2.2安装和配置(安装版)下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

在Centos7中,从主机 Windows 上无法远程访问 Linux 上rabbitmq的解决方法

  当在 Linux 上配置好 Rabbitmq服务器后,如果从主机中无法访问到 Linux 中的Rabbitmq服务器时,需要做如下的检查: 1. Rabbitmq是否启动成功 在控制台输入: ps -ef | grep rabbitmq 命令含义:从当前所有进程中查找是否含有rabbitmq进程 如果有内容显示,则说明 Rabbitmq启动成功   否...

阿里云Centos7安装mysql教程

1 基本安装过程 1.查看系统是否安装了mysql软件 # rpm -qa|grep -i mysql 2.将已经安装过的软件卸载掉。注意:这样的卸载是不彻底,不过这里够用了 # yum remove '软件名' 3.CentOS 7的yum源中默认是没有mysql的。所以,为了解决这个问题我们首先下载安装mysql的repo源。 # wget http:...

防火墙规则修改

防火墙规则netsh advfirewall firewall命令 命令 说明 add 添加新入站或出站防火墙规则 delete 删除所有匹配的防火墙规则 set 为现有规则的属性设置新值 show 显示指定的防火墙规则 add rule命令 netsh advfirewall firewall add rule name=...

华为USG防火墙配置NAT映射回流解决内网通过公网映射访问内部服务器

标题有点绕,问题就是在公网出接口上配置了内网某台服务器的端口映射,内网的普通用户通过内网地址访问正常,但无法通过公网IP进行正常访问,拓扑图如下:   上图以出接口地址100.100.100.100:80映射为192.168.1.11:80为例,实际问题为192.168.1.100与192.168.1.110无法通过100.100.100.100:80进...

nginx安装以及自启动脚本

前提条件:centos7,网络已经配置好 1、安装nginx1.1、安装依赖库 yum install gcc-c++ yum install -y pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel 1.2、将从官网上下载下来的nginx-1.1...

DeBian防火墙的开关以及状态

查看防火墙现有规则: ufw status 开启/关闭防火墙: ufw enable //开启 ufw disable //关闭 开启指定tcp或者udp端口: ufw allow 22/tcp 同时开启tcp与udp端口: ufw allow 445 删除53端口: ufw delete allow 53 拒绝指定tcp或者udp端口: allow/...