ospf
 [Huawei]router id 2.0.0.1
 interface GigabitEthernet0/0/0
 [Huawei-GigabitEthernet0/0/0]ip address 40.1.2.1 255.255.255.0
 [Huawei-GigabitEthernet0/0/0]ospf network- type p2p //设置接口的宣告类型
 [Huawei]ospf a //创建/进入ospf进程a
 [Huawei-ospf-1]area b //创建/进入b区域
 [Huawei-ospf-1]import-route direct cost 50 type 2//注入直连路由
 [Huawei-ospf-1]import-router rip cost 100 type 2//注入rip路由
 [Huawei-ospf-1]import-route static cost 150 type 2 //注入静态路由
 [Huawei-ospf-1]default-route-advertise always cost 200 type 1 //注入默认路由(无论是否存在默认路由)
 [Huawei-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255 //宣告网段
 [Huawei-ospf-1-area-0.0.0.1]vlink-peer 3.0.0.1 //与router id为3.0.0.1的路由器(对端ABR)建立虚连接
 [Huawei-ospf-1-area-0.0.0.1]stub //配置该区域为stub区域(同区域所有路由器都必须配置)
 [Huawei-ospf-1-area-0.0.0.1]stub no summary //配置totally stub区域(只能在ABR上配置)
 [Huawei-ospf-1-area-0.0.0.1]nsaa //配置该区域为nssa区域(同区域所有路由器都必须配置)
 [Huawei-ospf-1-area-0.0.0.1]nssa no summary //配置totally nssa区域(只能在ABR上配置)
 [Huawei-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.248.0 //区域间路由汇总
 [Huawei-ospf-1]asbr-summary 172.17.0.0 255.255.248.0 //外部路由汇总display ospf peer (brief/1.1.1.1/last-nbr-down) //ospf邻居信息
 display ospf interface (g0/0/0 /all) //ospf接口信息
 display ospf routing (router-id 1.1.1.1)//ospf路由表信息
 display ospf lsdb //ospf 链路状态数据库信息
 display ospf nexthop //查看OSPf的下一跳信息
 display ospf abr-asbr(1.1.1.1) //查看OSPF ABR和ASBR信息
 display ospf vlink //查看虚链路信息
 display ospf lsdb router self-originate//查看一类lsa
 display ospf lsdb network self-originate//查看二类lsa
 display ospf lsdb summary 192.168.1.0//查看1.0网段的三类lsa
 display ospf lsdb ase self-originate//查看四类lsa
 display ospf lsdb asbr self-originate//查看五类lsa镜像
 [Huawei]observe-port 1 interface ethe0/0/3 //配置观察端口(可多个)
 [Huawei]interface ethe0/0/1
 [Huawei-Ethernet0/0/1]port-mirroring to observe-port 1 inbound/outbound/both//配置镜像端口入方向/出方向/双向 
 [Huawei]vlan 2
 [Huawei-vlan2]mirroring to observe-port 1 inbound //配置镜像端口(只能入方向防止重复)
 [Huawei-vlan2]mac-mirroring mac地址 to observe-port 1 inbound //配置mac镜像(只能配置在vlan里)地址转换:
 [Huawei-Ethernet0/0/1]nat static global 1.1.1.1(外网地址)inside 192.168.1.1(内网地址) //配置静态nat
 [Huawei]acl 2001 //创建基本acl
 [Huawei-acl-basic-2001]description client filrer //acl描述
 [Huawei-acl-basic-2001]rule deny source 1.1.1.1 0.0.0.0 //配置acl规则:禁止源ip为1.1.1.1的流量通过
 [Huawei]nat address group 0 2.2.2.1 2.2.2.9 //配置动态nat转换地址池(公网地址)
 [Huawei-Ethernet0/0/1]nat outbound 2001 address group 0 //配置出方向的动态nat(必须匹配acl)
 [Huawei]nat address group 1 2.2.2.1 2.2.2.1 //配置napt nat转换地址池(公网地址)
 [Huawei-Ethernet0/0/1]nat outbound 2001 address group 1//配置出方向的动态napt(必须匹配acl)
 [Huawei-Ethernet0/0/1]nat outbound 2001 //配置出方向的easy ip(必须匹配acl)acl:
 [Huawei]acl 2001 //创建基本acl(对象只有源ip)
 [Huawei-acl-basic-2001]description client filrer //acl描述
 [Huawei-acl-basic-2001]step 2//配置步长
 [Huawei-acl-basic-2001]rule deny/permit source 1.1.1.1 0.0.0.0 //禁止/允许源ip为1.1.1.1的流量通过
 [Huawei]acl 3000 //创建高级acl(对象有源ip,目的ip,端口号,协议号,优先级等)
 [Huawei-acl-adv-3000]rule 1 deny/permit ip source 2.1.1.1 0 destination 3.1.1.1 0 //禁止/允许源ip为2.1.1.1且目的ip为3.1.1.1的流量通过(通配符为0的必须精确匹配,为1可随意)
 [Huawei-acl-adv-3000]rule deny ip source any //禁止所有流量通过
 [Huawei-acl-adv-3000]rule deny icmp source 3.1.1.1 0 //禁止源ip为3.1.1.1的icmp报文的流量通过
 [Huawei]acl 4000 //创建二层acl(匹配对象为二层信息,如源/目的mac,报文类型,封装模式等)
 [Huawei-acl-adv-4000]rule deny source/destination-mac mask //禁止源/目的mac为mask的流量通过
 [Huawei-acl-adv-4000]rule deny ether-ii/802.3/snap //禁止封装模式为ethernet ii/802.3/snap的流量通过
 [Huawei-acl-adv-4000]rule deny vlan-id/vlan id mask //禁止外层vlan-id/外层vlan-id的掩码的流量通过
 [Huawei]acl 5000 //创建自定义acl(匹配对象为报文偏移位置和偏移量)
 [Huawei-acl-user-5000]rule deny ipv4-head 0x01 0x000000ff 8 //禁止距ip头部片偏移为8字节且9 10字节为01的流量通过
 [Huawei-GigabitEthernet0/0/3]traffic-filter outbound/inbound acl a //将acl a应用在接口出/入方向(自定义acl只能应用在入方向上)