ensp ospf 镜像 nat acl指令汇总

8 篇文章 0 订阅
6 篇文章 0 订阅

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只能应用在入方向上)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Grimm·

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值