网御防火墙常用命令1101[可修改版ppt]
- 格式:ppt
- 大小:1.40 MB
- 文档页数:25
FortiGate防火墙常用配置命令(可编辑修改word版)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 interfaceFortiGate (interface) # edit lanFortiGate (lan) # set ip 192.168.100.99/24FortiGate (lan) # end2、配置静态路由FortiGate (static) # edit 1FortiGate (1) # set device wan1FortiGate (1) # set dst 10.0.0.0 255.0.0.0FortiGate (1) # set gateway 192.168.57.1FortiGate (1) # end3、配置默认路由FortiGate (1) # set gateway 192.168.57.1FortiGate (1) # set device wan1FortiGate (1) # end4、添加地址FortiGate # config firewall addressFortiGate (address) # edit clientnetnew entry 'clientnet' addedFortiGate (clientnet) # set subnet 192.168.1.0 255.255.255.0 FortiGate (clientnet) # end5、添加 ip 池FortiGate (ippool) # edit nat-poolnew entry 'nat-pool' addedFortiGate (nat-pool) # set startip 100.100.100.1FortiGate (nat-pool) # set endip 100.100.100.100FortiGate (nat-pool) # end6、添加虚拟 ipFortiGate # config firewall vipFortiGate (vip) # edit webservernew entry 'webserver' addedFortiGate (webserver) # set extip 202.0.0.167FortiGate (webserver) # set extintf wan1FortiGate (webserver) # set mappedip 192.168.0.168 FortiGate (webserver) # end7、配置上网策略FortiGate # config firewall policyFortiGate (policy) # edit 1FortiGate (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 //开启 natend8、配置映射策略FortiGate # config firewall policyFortiGate (policy) #edit 2FortiGate (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 //日志开关end9、把 internal 交换接口修改为路由口确保关于 internal 口的路由、dhcp、防火墙策略都删除FortiGate # config system globalFortiGate (global) # set internal-switch-mode interfaceFortiGate (global) #end重启1、查看主机名,管理端口FortiGate # show system global2、查看系统状态信息,当前资源信息FortiGate # get system performance status3、查看应用流量统计FortiGate # get system performance firewall statistics4、查看 arp 表FortiGate # get system arp5、查看 arp 丰富信息FortiGate # diagnose ip arp list6、清楚 arp 缓存FortiGate # execute clear system arp table7、查看当前会话表FortiGate # diagnose sys session stat 或 FortiGate # diagnose sys session full- stat;8、查看会话列表FortiGate # diagnose sys session list9、查看物理接口状态FortiGate # get system interface physical10、查看默认路由配置FortiGate # show router static11、查看路由表中的静态路由FortiGate # get router info routing-table static12、查看 ospf 相关配置FortiGate # show router ospf13、查看全局路由表FortiGate # get router info routing-table all1、查看 HA 状态FortiGate # get system ha status2、查看主备机是否同步FortiGate # diagnose sys ha showcsum3.诊断命令:FortiGate # diagnose debug application ike -1execute 命令:FortiGate #execute ping 8.8.8.8 //常规 ping 操作FortiGate #execute ping-options source 192.168.1.200 //指定ping 数据包的源地址 192.168.1.200FortiGate #execute ping 8.8.8.8 //继续输入 ping 的目标地址,即可通过 192.168.1.200 的源地址执行 ping 操作FortiGate #execute traceroute 8.8.8.8FortiGate #execute telnet 2.2.2.2 //进行 telnet 访问FortiGate #execute ssh 2.2.2.2 //进行ssh 访问FortiGate #execute factoryreset //恢复出厂设置FortiGate #execute reboot //重启设备FortiGate #execute shutdown //关闭设备。
防⽕墙配置中必备的六个主要命令防⽕墙的基本功能,是通过六个命令来完成的。
⼀般情况下,除⾮有特殊的安全需求,这个六个命令基本上可以搞定防⽕墙的配置。
下⾯笔者就结合CISCO的防⽕墙,来谈谈防⽕墙的基本配置,希望能够给⼤家⼀点参考。
第⼀个命令:interfaceInterface是防⽕墙配置中最基本的命令之⼀,他主要的功能就是开启关闭接⼝、配置接⼝的速度、对接⼝进⾏命名等等。
在买来防⽕墙的时候,防⽕墙的各个端都都是关闭的,所以,防⽕墙买来后,若不进⾏任何的配置,防⽌在企业的⽹络上,则防⽕墙根本⽆法⼯作,⽽且,还会导致企业⽹络不同。
1、配置接⼝速度在防⽕墙中,配置接⼝速度的⽅法有两种,⼀种是⼿⼯配置,另外⼀种是⾃动配置。
⼿⼯配置就是需要⽤户⼿⼯的指定防⽕墙接⼝的通信速度;⽽⾃动配置的话,则是指防⽕墙接⼝会⾃动根据所连接的设备,来决定所需要的通信速度。
如:interface ethernet0 auto --为接⼝配置“⾃动设置连接速度”Interface ethernet2 100ful --为接⼝2⼿⼯指定连接速度,100MBIT/S。
这⾥,参数ethernet0或者etnernet2则表⽰防⽕墙的接⼝,⽽后⾯的参数表⽰具体的速度。
笔者建议在配置接⼝速度的时候,要注意两个问题。
⼀是若采⽤⼿⼯指定接⼝速度的话,则指定的速度必须跟他所连接的设备的速度相同,否则的话,会出现⼀些意外的错误。
如在防⽕墙上,若连接了⼀个交换机的话,则交换机的端⼝速度必须跟防⽕墙这⾥设置的速度相匹配。
⼆是虽然防⽕墙提供了⾃动设置接⼝速度的功能,不过,在实际⼯作中,作者还是不建议⼤家采⽤这个功能。
因为这个⾃动配置接⼝速度,会影响防⽕墙的性能。
⽽且,其有时候也会判断失误,给⽹络造成通信故障。
所以,在⼀般情况下,⽆论是笔者,还是思科的官⽅资料,都建议⼤家采⽤⼿⼯配置接⼝速度。
2、关闭与开启接⼝防⽕墙上有多个接⼝,为了安全起见,打开的接⼝不⽤的话,则需要及时的进⾏关闭。
网络防火墙是保障网络安全的重要工具,通过限制网络流量和实施访问控制,防火墙可以有效地阻止恶意攻击和未经授权的访问。
为了正确地管理和配置网络防火墙,掌握一些常用的管理命令和技巧是非常有必要的。
一、命令行界面管理网络防火墙通常提供命令行界面,使管理员能够通过输入命令来配置和管理防火墙。
对于Linux系统来说,常用的命令行工具是iptables。
通过iptables,管理员可以设置各种规则和策略,以控制网络流量的进出。
1. 查看当前的规则和策略:使用命令"iptables -L"可以列出当前的防火墙规则和策略。
这对于了解当前防火墙配置的状态非常有用。
管理员可以查看已经定义的规则、策略以及它们的顺序。
2. 添加新的规则:命令"iptables -A"用于添加一个新的规则到防火墙中。
管理员需要指定规则的类型(输入、输出或转发),以及规则所适用的源IP地址、目标IP地址和端口号等信息。
例如,"iptables -A INPUT -s/24 -p tcp --dport 22 -j ACCEPT"将允许从/24网络的主机访问防火墙上的SSH服务。
3. 删除已有的规则:使用命令"iptables -D"可以删除已经存在的规则。
管理员需要指定规则的类型和规则的编号。
例如,"iptables -D INPUT 2"将删除INPUT链上的第二条规则。
4. 保存和加载规则集:在对防火墙进行配置和修改后,管理员需要保存规则集,以便在系统重启后能够重新加载。
通过命令"iptables-save"可以将当前的规则集保存到文件中。
而通过命令"iptables-restore"可以从文件中加载规则集。
二、图形界面管理除了命令行界面,一些网络防火墙还提供了图形界面用于管理和配置。
这种类型的管理界面通常提供了可视化的操作,使得管理者可以更直观地配置和监视防火墙。