system-view #进入系统视图
sysname <name> #修改设备名称
save #保存配置
display current-configuration #查看当前配置
reboot #重启设备interface GigabitEthernet1/0/1 #进入接口视图
undo shutdown #启用接口
port link-type access/trunk/hybrid #设置端口模式
port access vlan 10 #将接口加入VLAN 10
port-group manual 1 #创建手动端口组(批量配置)vlan 10 #创建VLAN 10
port trunk permit vlan all #允许所有VLAN通过Trunk口
display vlan #查看VLAN信息
interface Vlan-interface10 #进入VLAN虚接口配置IPacl number 2000 #创建基本ACL
traffic-filter inbound acl 2000 #应用ACL到接口
port-security enable #启用端口安全interface Bridge-Aggregation1 #创建聚合组
link-aggregation mode dynamic #启用LACP动态协商
interface GigabitEthernet1/0/1 #进入接口
port link-aggregation group 1 #将成员端口加入聚合组stp enable #全局启用STP
stp mode rstp #配置为快速生成树模式
display stp brief #查看STP端口状态mirroring-group 1 local
#创建本地镜像组
mirroring-group 1 mirroring-port GigabitEthernet1/0/1 both
#配置镜像端口
mirroring-group 1 monitor-port GigabitEthernet1/0/2
#设置监控端口clock timezone BJ add 8 #设置时区(北京时间)
language-mode Chinese #切换中文界面
display version #查看设备版本信息interface GigabitEthernet0/0 #进入接口视图
ip address 192.168.1.1 255.255.255.0 #配置接口IP
interface LoopBack0 #创建环回接口
ip address 1.1.1.1 32 #配置环回地址ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 #配置默认路由
ospf 1 #启动OSPF进程
network 192.168.1.0 0.0.0.255 area 0 #宣告OSPF网络
bgp 65001 #启动BGP进程nat address-group 1 #创建NAT地址池
dhcp enable #全局启用DHCP
dhcp server ip-pool VLAN10 #配置DHCP地址池ike proposal 10 #创建IKE提议
encryption-algorithm aes-cbc-128 #设置加密算法
ipsec policy POLICY1 10 isakmp #创建IPSec策略
tunnel local 202.100.1.1 #指定本端公网IPinterface Vlan-interface10
vrrp vrid 1 virtual-ip 192.168.1.254
#配置虚拟IP
vrrp vrid 1 priority 120
#设置优先级user-interface vty 0 4
authentication-mode scheme
#启用AAA认证
protocol inbound ssh
#仅允许SSH登录acl number 3000
rule 5 permit ip source 192.168.1.0 0.0.0.255 destination 10.1.1.0 0.0.0.255
#精确匹配源/目的网段system-view #进入系统视图
sysname FW01 #命名防火墙
language-mode Chinese # 切换中文界面
interface GigabitEthernet1/0/1 #配置接口IP
save force #强制保存配置
reset saved-configuration #清除启动配置security-zone name Trust #创建安全区域
zone-pair security source Trust destination Untrust #配置域间策略
rule permit source 192.168.1.0 0.0.0.255 #允许指定网段流量aspf policy 1 #创建ASPF策略
detect http #启用HTTP应用检测
zone-pair security source Untrust destination Trust
aspf apply policy 1 #应用策略到安全域间acl advanced 3000
rule permit tcp source 192.168.1.0 0.0.0.255 destination 10.1.1.1 0 eq 80
#放行HTTP流量
packet-filter 3000 inbound
#应用ACL到接口入方向nat address-group 1
address 202.100.1.100 202.100.1.200
#配置地址池
nat outbound 3000 address-group 1
#关联ACL与地址池nat server protocol tcp global 202.100.1.1 8080 inside 192.168.1.100 80
#端口映射ike proposal 10
encryption-algorithm aes-cbc-128 # 配置IKE加密算法:ml-citation{ref="1" data="citationList"}
ipsec policy POLICY1 10 isakmp
security acl 3001 # 指定感兴趣流anti-ddos enable #启用防DDoS功能
blacklist enable #启用黑名单info-center loghost 192.168.1.100 facility local6
#发送日志到服务器
display firewall session table
#查看会话表display cpu-usage #查看CPU使用率
display memory #查看内存状态
display logbuffer #查看日志缓存
display power #显示电源状态
display arp #查看ARP表项
display ip routing-table #查看IPv4路由表
display ipv6 routing-table #查看IPv6路由表
display bgp peer #检查BGP邻居状态