配置MPLS原始流量统计示例
对MPLS原始流量进行统计,可以得到标签的流量信息。
组网需求
如图3-19所示,DeviceA、DeviceB和DeviceC均支持MPLS,运行OSPF作为MPLS骨干网上的IGP。
DeviceA和DeviceB、DeviceB和DeviceC之间建立本地LDP(Label Distribution Protocol)会话;DeviceA和DeviceC之间建立远端LDP会话。在DeviceB部署MPLS流量的NetStream统计。
配置思路
采用如下的思路配置MPLS网络的流量统计:
配置各路由器之间的LDP会话。
分别在建立远端会话的两端路由器上指定各自的远端对等体及其地址。
NetStream信息输出的目的地址、目的端口、源地址。
数据准备
为完成此配置例,需准备如下的数据:
各路由器接口的IP地址如图3-19,OSPF进程号为1,所在的区域为Area0。
DeviceA的远端对等体为DeviceC,其名称为Devicec,IP地址为3.3.3.9。
DeviceC的远端对等体为DeviceA,其名称为Devicea,IP地址为1.1.1.9。
NetStream业务板的槽位号,本举例中Netstream业务板位于1号槽位。
操作步骤
- 配置各接口的IP地址
# 按照图3-19配置各接口IP地址和掩码,包括Loopback接口,具体配置过程略。
- 配置各路由器之间的LDP会话
# 配置OSPF协议发布各路由器接口所连网段和标签交换路由器LSR(Label Switching Routeran) ID的主机路由,使能路由器和接口的MPLS基本能力,使能LDP。
关于的静态MPLS TE隧道的配置方法,请参见《HUAWEI NE40E-M系列NE40E 配置指南-MPLS》中的“MPLS基本配置”。
- 使能DeviceB接口GigabitEthernet0/1/0的NetStream统计功能
# 配置单板的NetStream采样处理方式。
[*DeviceB] slot 1 [*DeviceB-slot-1] ip netstream sampler to slot self [*DeviceB-slot-1] return
# 配置DeviceB接口GigabitEthernet0/1/0的NetStream 入统计和出统计功能。
[*DeviceB] interface GigabitEthernet 0/1/0 [*DeviceB-GigabitEthernet0/1/0] ip netstream inbound [*DeviceB-GigabitEthernet0/1/0] ip netstream outbound [*DeviceB-GigabitEthernet0/1/0] quit
# 配置对MPLS报文既采集内层IP报文也采集标签。
[*DeviceB] ip netstream mpls-aware label-and-ip
# 配置版本5输出目的地址,目的端口和源地址。
[*DeviceB] ip netstream export host 192.168.1.2 2100 [*DeviceB] ip netstream export source 10.1.2.1
# 配置NetStream采样,采样方式为固定报文采样。
[*DeviceB] ip netstream sampler fix-packets 10000 inbound [*DeviceB] ip netstream sampler fix-packets 10000 outbound [*DeviceB] commit
- 检查配置效果
# 配置成功后,在用户视图下执行命令display ip netstream cache origin slot 1,NetStream流缓存区的信息以及统计输出报文信息。
<HUAWEI> display ip netstream cache origin slot 1 DstIf SrcIf DstP Msk Pro Tos SrcP Msk Flags Ttl Packets Bytes NextHop Direction DstIP DstAs SrcIP SrcAs BGP: BGP NextHop TopLabelType Label1 Exp1 Bottom1 Label2 Exp2 Bottom2 Label3 Exp3 Bottom3 TopLabelIpAddress VlanId VniId -------------------------------------------------------------------------- Unknown GigabitEthernet0/1/0 0 0 253 0 0 0 0 60 3 384 0.0.0.0 in 192.172.133.151 0 192.172.131.151 0 0.0.0.0 UNKNOWN 0 0 0 0 0 0 0 0 0 0.0.0.0 0 0 Unknown GigabitEthernet0/1/1 0 0 253 0 0 0 0 60 1 128 0.0.0.0 in 192.173.81.232 0 192.173.79.232 0 0.0.0.0 UNKNOWN 0 0 0 0 0 0 0 0 0 0.0.0.0 0 0
配置文件
DeviceA的配置文件
# sysname DeviceA # mpls lsr-id 1.1.1.9 # mpls lsp-trigger all # mpls ldp # mpls ldp remote-peer Devicec remote-ip 3.3.3.9 # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 1.1.1.9 0.0.0.0 # return
DeviceB的配置文件
# slot 1 ip netstream sampler to slot self # sysname DeviceB # ip netstream sampler fix-packets 10000 inbound ip netstream sampler fix-packets 10000 outbound ip netstream export source 10.1.2.1 ip netstream export host 192.168.1.2 2100 # mpls lsr-id 2.2.2.9 # mpls lsp-trigger all # mpls ldp # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 ip netstream inbound ip netstream outbound mpls mpls ldp # interface GigabitEthernet0/2/0 undo shutdown ip address 10.1.2.1 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 10.1.1.0 0.0.0.255 network 10.1.2.0 0.0.0.255 network 2.2.2.9 0.0.0.0 # return
DeviceC的配置文件
# sysname DeviceC # ip netstream mpls-aware label-and-ip # mpls lsr-id 3.3.3.9 # mpls lsp-trigger all # mpls ldp # mpls ldp remote-peer Devicea remote-ip 1.1.1.9 # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.2.2 255.255.255.0 mpls mpls ldp # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # ospf 1 area 0.0.0.0 network 4.1.1.0 0.0.0.255 network 3.3.3.9 0.0.0.0 # return