主要是介绍FortiGate命令行

一, 命令结构

config      Configure object.                                      对策略,对象等进行配置 get         Get dynamic and system information.         查看相关关对象的参数信息 show        Show configuration.                                  查看配置文件 diagnose    Diagnose facility.                                      诊断命令 execute     Execute static commands.                        常用的工具命令,如 ping exit        Exit the CLI.                                                  退出

二,常用命令

常用配置命令:

1、配置接口地址:

FortiGate # config system interface FortiGate (interface) # edit lan FortiGate (lan) # set ip 192.168.100.99/24 FortiGate (lan) # end

2、配置静态路由

FortiGate # config router static FortiGate (static) # edit 0    //    “ 0 ”系统自动分配路由条目的序号 FortiGate (0) # set device wan1    // 出接口 FortiGate (0) # set dst 10.0.0.0 255.0.0.0    // 目的网段 FortiGate (0) # set gateway 192.168.57.1    // 网关IP FortiGate (0) # end

3、添加默认路由

FortiGate # config router static FortiGate (static) # edit 0  FortiGate (0) # set gateway 192.168.57.1 FortiGate (0) # set device wan1 FortiGate (0) # end

4、添加IP地址对象

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、添加DHCP地址池

FortiGate# config firewall ippool 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 FortiGate (1)#end

8、配置VIP映射策略

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 ngfw1  //目的地址,虚拟VIP映射,需要先配置好VIP条目才可以被调用 FortiGate (2)#set action accept     //动作 FortiGate (2)#set schedule always //时间 FortiGate (2)#set service ALL     //服务 FortiGate (2)#set logtraffic all   //日志开关 end

三 常用show命令:

1、查看设备信息、主机名,管理端口

FortiGate # show system global

2、查看系统状态信息和当前资源信息
FortiGate # get system status

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

14.查看HA状态

FortiGate # get system ha status

15.查看主备机是否同步

FortiGate # diagnose sys ha checksum

常用诊断命令:

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命令行相关推荐

  1. Fortigate 飞塔防火墙命令行常用操作 CLI

    文章目录 1.基本配置 1. 设备console口设置 2. 设置接口IP 3. 设置网关 4. 设置DNS 5. 设置NTP 6. 设置时区和主机名 7. 配置备份 2.HA相关 1. 查看HA状态 ...

  2. ECS(Linux)连接RDS,使用命令行方式连接实例

    使用命令行方式连接实例 通过命令行连接RDS MySQL数据库,连接方式如下: mysql -h<连接地址> -P<端口> -u<用户名> -p -D<数据库 ...

  3. 从命令行到IDE,版本管理工具Git详解(远程仓库创建+命令行讲解+IDEA集成使用)

    首先,Git已经并不只是GitHub,而是所有基于Git的平台,只要在你的电脑上面下载了Git,你就可以通过Git去管理"基于Git的平台"上的代码,常用的平台有GitHub.Gi ...

  4. 基于Golang的CLI 命令行程序开发

    基于Golang的CLI 命令行程序开发 [阅读时间:约15分钟] 一. CLI 命令行程序概述 二. 系统环境&项目介绍&开发准备 1.系统环境 2.项目介绍 3.开发准备 三.具体 ...

  5. 简单解决用VS编写hello world时命令行一闪而过

    一.在return 0;前一行加一个getchar(); 二.使用项目模板为 windows 桌面向导 c++ 3.命令行控制台一闪而过.这是我们使用空文件夹加载的项目,默认不是控制台应用程序,新建控 ...

  6. java命令行读入密码_java-在命令行上隐藏输入

    是的,可以做. 这称为命令行输入屏蔽. 您可以轻松实现此目的. 您可以使用单独的线程擦除输入的回显字符,并用星号替换. 使用下面显示的EraserThread类完成此操作 import java.io ...

  7. Redis 笔记(16)— info 指令和命令行工具(查看内存、状态、客户端连接数、监控服务器、扫描大key、采样服务器、执行批量命令等)

    Info 命令返回关于 Redis 服务器的各种信息和统计数值.通过给定可选的参数 section ,可以让命令只返回某一部分的信息. 1. 显示模块 server : 一般 Redis 服务器信息, ...

  8. Linux shell 学习笔记(10)— 处理用户输入(命令行读取参数、读取用户输入、超时处理)

    1. 命令行参数 向 shell 脚本传递数据的最基本方法是使用命令行参数.命令行参数允许在运行脚本时向命令行添加数据. $ ./addem 10 30 本例向脚本 addem 传递了两个命令行参数( ...

  9. 命令行带参数启动--命令行相关问题 代码规范

    20210106 其实cmd和Linux一样可以通过特殊符号换行的: Linux 为 \ 而cmd 为 ^ 命令行换行符 20201127 options 代码编写变量意义 20200728 a.py ...

最新文章

  1. AOP、注解实现日志收集
  2. 10本计算机视觉必读经典图书,入门篇 + 提升篇
  3. jsTree通过json数据初始化时,如何控制每个选项的图标(icon)显示
  4. 带你理解 只读事务(@Transactional(readOnly = true)
  5. NodeJS中的require和import
  6. Ubuntu18.04下C++编译tensorflow并在QT中使用
  7. OJ0428 二分查找F701
  8. matlab 保存不了文件,关于matlab文件无法保存的原因(转)
  9. 渗透测试漏流程(PTES)
  10. abb机器人编程指令写字_ABB机器人-编程基本指令之运动指令
  11. newifimini出厂固件_新路由newifi固件
  12. 智方8000系文具进销存管理系统 v11.27 bt
  13. 八爪鱼数据采集教程(一)
  14. 美化站长导航源码 自动收录+主动提交百度收录
  15. 计算机实训四 表格制作素材,计算机平面设计实训(第3版 赵荣胡昌杰)课件 素材平面图像设计实训04.ppt...
  16. windows10安装keras教程
  17. MATLAB软件基础学习篇——003
  18. mysql 当前时间减指定时间_Mysql从日期值减去5分钟
  19. 计算机网络——应用层之万维网(WWW)
  20. 外贸客户已读不回怎么办?看了这篇文章就明白了!

热门文章

  1. 阿里云centos7配置php mysql_阿里云centos7安装NGINX+MYSQL+PHP-FPM环境
  2. Eclipse英文版视频教程(from Carleton University)
  3. [机器学习笔记] 什么是经验风险?什么是结构风险?
  4. 国内首部创业纪实电影《燃点》进校园:如何靠近成功的2%
  5. 近期数学杯赛汇总,哪个含金量高?
  6. 中南大学2020大学生心里健康教育答案 —— 雨课堂
  7. JS实现PDF文件下载
  8. 关于苹果手机iFiles文件管理使用方法
  9. USB | 1. 技术演进及测试概览
  10. 【Visual C++】游戏开发笔记四十二 浅墨DirectX教程之十 游戏输入控制利器 DirectInput专场