示例:标记 Diffserv 代码点至 802.1P PCP,以在服务提供商的 VPLS 网络中承载 CoS 配置文件
此配置示例说明了如何通过虚拟专用 LAN 服务 (VPLS) 网络实施服务等级 (CoS) 功能。
要求
为了验证此过程,此示例使用流量生成器。流量生成器可以是基于硬件的,也可以是基于服务器或主机上运行的软件。
运行 Junos OS 的设备上广泛支持此过程中的功能。此处展示的示例已在运行 Junos OS 10.4 版的 MX 系列路由器上进行了测试和验证。
概述
VPLS 网络创建一个虚拟专用 LAN,为服务提供商的客户提供以太网 LAN 的非常接近的近似值。在 VPLS 网络中,并非所有客户都需要连接到单个 LAN。相反,客户可以分布在两个或多个 LAN 中。简单来说,VPLS 网络通过数据包交换网络连接各个 LAN,使其显示为单个 LAN。有关典型 VPLS 拓扑的示例 ,请参阅图 1 。

Junos OS 包含多个可能满足您的需求的 DiffServ 代码点 (DSCP) 默认重写规则。您可以使用命令显示它们 show class-of-service rewrite-rule
。下表显示了部分默认重写 DSCP 规则映射。
您还可以定义自己的自定义重写规则表,或者混合使用默认重写规则和您创建的自定义表。此示例使用默认重写规则。
来自转发类的映射 |
PLP 值 |
映射到 DSCP/DSCP IPv6/EXP/IP 代码点别名 |
---|---|---|
加速转发 |
低 |
英 孚 |
加速转发 |
高 |
英 孚 |
保证转发 |
低 |
af11 |
保证转发 |
高 |
af12 (DSCP/DSCP IPv6/EXP) |
尽力而为 |
低 |
是 |
尽力而为 |
高 |
是 |
网络控制 |
低 |
nc1/cs6 |
网络控制 |
高 |
nc2/cs7 |
Junos OS 使用下表中为 MPLS 表头的 EXP 字段显示的 MPLS CoS 值。
转发类 |
丢失优先级 |
EXP 代码点 |
---|---|---|
尽力而为 |
低 |
000 |
尽力而为 |
高 |
001 |
加速转发 |
低 |
010 |
加速转发 |
高 |
011 |
保证转发 |
低 |
100 |
保证转发 |
高 |
101 |
网络控制 |
低 |
110 |
网络控制 |
高 |
111 |
除了提供必要的信息以完成此示例的目的外,此示例还包括重新创建 VPLS 网络所需的所有命令,如图 2 所示。此示例不包括配置 VPLS 网络所需的任务的完整说明。如果需要有关配置 VPLS 网络的更多信息,请参阅 http://juniper.net/documentation 路由设备的 VPLS 用户指南 和 http://tools.ietf.org/html/rfc4761 上的 RFC 4761。
本文不全面解释所需的 CoS 任务和底层算法。有关更多信息,请参阅 Miguel Barreiros 和 Peter Lundqvist 的 QOS 支持网络 — 工具和基础 。许多在线书店和 www.juniper.net/books 都提供这本书。
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 CE1
set interfaces ge-1/0/1 unit 0 description to-Host1 set interfaces ge-1/0/1 unit 0 family inet address 172.16.50.2/30 set interfaces ge-1/0/1 unit 0 family inet filter input ip-v4 set interfaces ge-1/0/5 vlan-tagging set interfaces ge-1/0/5 unit 512 description to_PE1 set interfaces ge-1/0/5 unit 512 vlan-id 512 set interfaces ge-1/0/5 unit 512 family inet address 10.10.1.1/24 set interfaces lo0 unit 1 description loopback-interface set interfaces lo0 unit 1 family inet address 192.168.0.1/32 set protocols ospf area 0.0.0.0 interface ge-1/0/5.512 set protocols ospf area 0.0.0.0 interface ge-1/0/1.0 passive set protocols ospf area 0.0.0.0 interface lo0.1 passive set firewall family inet filter ip-v4 term tcp80 from port 80 set firewall family inet filter ip-v4 term tcp80 then dscp ef set firewall family inet filter ip-v4 term 12345 from port 12345 set firewall family inet filter ip-v4 term 12345 then dscp be set firewall family inet filter ip-v4 term accept then accept set class-of-service classifiers ieee-802.1 dscp1 forwarding-class expedited-forwarding loss-priority low code-points ef set class-of-service classifiers ieee-802.1 dscp1 forwarding-class best-effort loss-priority low code-points be set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class expedited-forwarding loss-priority low code-point 010 set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class best-effort loss-priority low code-point 000 set class-of-service interfaces ge-1/0/5 unit 512 classifiers ieee-802.1 dscp1 set class-of-service interfaces ge-1/0/5 unit 512 rewrite-rules ieee-802.1 ieee1-c2
设备 PE1
set interfaces ge-1/0/6 vlan-tagging set interfaces ge-1/0/6 encapsulation vlan-vpls set interfaces ge-1/0/6 unit 512 description to_vpls set interfaces ge-1/0/6 unit 512 encapsulation vlan-vpls set interfaces ge-1/0/6 unit 512 vlan-id 512 set interfaces ge-1/0/9 description to_P1 set interfaces ge-1/0/9 unit 0 family inet address 10.30.0.1/30 set interfaces ge-1/0/9 unit 0 family mpls set interfaces lo0 unit 0 description loopback-interface set interfaces lo0 unit 0 family inet address 10.255.70.31/32 set protocols mpls interface ge-1/0/9.0 set protocols bgp group to_PE2 type internal set protocols bgp group to_PE2 local-address 10.255.70.31 set protocols bgp group to_PE2 family l2vpn signaling set protocols bgp group to_PE2 neighbor 172.30.14.1 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface ge-1/0/9.0 set protocols ldp interface ge-1/0/9.0 set protocols ldp interface lo0.0 set routing-options router-id 10.255.70.31 set routing-options autonomous-system 64511 set routing-instances vpls_a instance-type vpls set routing-instances vpls_a interface ge-1/0/6.512 set routing-instances vpls_a route-distinguisher 64511:1 set routing-instances vpls_a vrf-target target:64511:1 set routing-instances vpls_a protocols vpls no-tunnel-services set routing-instances vpls_a protocols vpls site 1 site-identifier 1 set routing-instances vpls_a protocols vpls site 1 interface ge-1/0/6.512
设备 P1
set interfaces ge-1/0/3 description to_P2 set interfaces ge-1/0/3 unit 0 family inet address 10.40.0.1/30 set interfaces ge-1/0/3 unit 0 family mpls set interfaces ge-1/0/9 description to_PE1 set interfaces ge-1/0/9 unit 0 family inet address 10.30.0.2/30 set interfaces ge-1/0/9 unit 0 family mpls set interfaces lo0 unit 0 description loopback-interface set interfaces lo0 unit 0 family inet address 192.168.16.1/32 set protocols mpls interface ge-1/0/9.0 set protocols mpls interface ge-1/0/3.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-1/0/3.0 set protocols ospf area 0.0.0.0 interface ge-1/0/9.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-1/0/3.0 set protocols ldp interface ge-1/0/9.0 set protocols ldp interface lo0.0 set routing-options router-id 192.168.16.1
设备 P2
set interfaces ge-2/0/6 description to_P1 set interfaces ge-2/0/6 unit 0 family inet address 10.40.0.2/30 set interfaces ge-2/0/6 unit 0 family mpls set interfaces ge-2/0/8 description to_PE2 set interfaces ge-2/0/8 unit 0 family inet address 10.50.0.1/30 set interfaces ge-2/0/8 unit 0 family mpls set interfaces lo0 unit 0 description loopback-interface set interfaces lo0 unit 0 family inet address 192.168.13.1/32 set protocols mpls interface ge-2/0/6.0 set protocols mpls interface ge-2/0/8.0 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-2/0/6.0 set protocols ospf area 0.0.0.0 interface ge-2/0/8.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-2/0/6.0 set protocols ldp interface ge-2/0/8.0 set protocols ldp interface lo0.0 set routing-options router-id 192.168.13.1
设备 PE2
set interfaces ge-2/0/8 description to-R1 set interfaces ge-2/0/8 unit 0 family inet address 10.50.0.2/30 set interfaces ge-2/0/8 unit 0 family mpls set interfaces ge-2/1/1 vlan-tagging set interfaces ge-2/1/1 encapsulation vlan-vpls set interfaces ge-2/1/1 unit 512 description to_vpls set interfaces ge-2/1/1 unit 512 encapsulation vlan-vpls set interfaces ge-2/1/1 unit 512 vlan-id 512 set interfaces lo0 unit 0 description loopback-interface set interfaces lo0 unit 0 family inet address 172.30.14.1/32 set protocols mpls interface ge-2/0/8.0 set protocols bgp group to_PE1 type internal set protocols bgp group to_PE1 local-address 172.30.14.1 set protocols bgp group to_PE1 family l2vpn signaling set protocols bgp group to_PE1 neighbor 10.255.70.31 set protocols ospf traffic-engineering set protocols ospf area 0.0.0.0 interface ge-2/0/8.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-2/0/8.0 set protocols ldp interface lo0.0 set routing-options router-id 172.30.14.1 set routing-options autonomous-system 64511 set routing-instances vpls_a instance-type vpls set routing-instances vpls_a interface ge-2/1/1.512 set routing-instances vpls_a route-distinguisher 64511:1 set routing-instances vpls_a vrf-target target:64511:1 set routing-instances vpls_a protocols vpls no-tunnel-services set routing-instances vpls_a protocols vpls site 2 site-identifier 2 set routing-instances vpls_a protocols vpls site 2 interface ge-2/1/1.512
设备 CE2
set interfaces ge-2/0/7 unit 0 description to-Host2 set interfaces ge-2/0/7 unit 0 family inet address 172.16.80.2/30 set interfaces ge-2/0/7 unit 0 family inet filter input ip-v4 set interfaces ge-2/1/2 vlan-tagging set interfaces ge-2/1/2 unit 512 description to-PE2 set interfaces ge-2/1/2 unit 512 vlan-id 512 set interfaces ge-2/1/2 unit 512 family inet address 10.10.1.2/24 set interfaces lo0 unit 1 description loopback-interface set interfaces lo0 unit 1 family inet address 192.168.0.2/32 set protocols ospf area 0.0.0.0 interface lo0.1 passive set protocols ospf area 0.0.0.0 interface ge-2/0/7.0 passive set protocols ospf area 0.0.0.0 interface ge-2/1/2.512 set firewall family inet filter ip-v4 term tcp80 from port 80 set firewall family inet filter ip-v4 term tcp80 then dscp ef set firewall family inet filter ip-v4 term 12345 from port 12345 set firewall family inet filter ip-v4 term 12345 then dscp be set firewall family inet filter ip-v4 term accept then accept set class-of-service classifiers ieee-802.1 dscp1 forwarding-class expedited-forwarding loss-priority low code-points ef set class-of-service classifiers ieee-802.1 dscp1 forwarding-class best-effort loss-priority low code-points be set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class expedited-forwarding loss-priority low code-point 010 set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class best-effort loss-priority low code-point 000 set class-of-service interfaces ge-2/1/2 unit 512 rewrite-rules ieee-802.1 ieee1-c2 set class-of-service interfaces ge-2/1/2 unit 512 classifiers ieee-802.1 dscp1
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 CE1:
配置设备接口。
[edit ] user@CE1# set interfaces ge-1/0/1 unit 0 description to-Host1 user@CE1# set interfaces ge-1/0/1 unit 0 family inet address 172.16.50.2/30 user@CE1#set interfaces ge-1/0/1 unit 0 family inet filter input ip-v4 user@CE1#set interfaces lo0 unit 1 description loopback-interface user@CE1# set interfaces lo0 unit 1 family inet address 192.168.0.1/32
配置 VLAN 参数。
[edit ] user@CE1# set interfaces ge-1/0/5 vlan-tagging user@CE1# set interfaces ge-1/0/5 unit 512 description to_PE1 user@CE1# set interfaces ge-1/0/5 unit 512 vlan-id 512 user@CE1# set interfaces ge-1/0/5 unit 512 family inet address 10.10.1.1/24
配置服务等级参数。
[edit ] user@CE1# set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class expedited-forwarding loss-priority low code-point 010 user@CE1# set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class best-effort loss-priority low code-point 000 user@CE1# set class-of-service classifiers ieee-802.1 dscp1 forwarding-class expedited-forwarding loss-priority low code-points ef user@CE1# set class-of-service classifiers ieee-802.1 dscp1 forwarding-class best-effort loss-priority low code-points be user@CE1# set class-of-service interfaces ge-1/0/5 unit 512 rewrite-rules ieee-802.1 ieee1-c2 user@CE1# set class-of-service interfaces ge-1/0/5 unit 512 classifiers ieee-802.1 dscp1
配置协议参数。
[edit ] user@CE1# set protocols ospf area 0.0.0.0 interface ge-1/0/5.512 user@CE1# set protocols ospf area 0.0.0.0 interface ge-1/0/1.0 passive user@CE1# set protocols ospf area 0.0.0.0 interface lo0.0 passive
配置防火墙 DSCP 重写参数。
[edit ] user@CE1# set firewall family inet filter ip-v4 term tcp80 from port 80 user@CE1# set firewall family inet filter ip-v4 term tcp80 then dscp ef user@CE1# set firewall family inet filter ip-v4 term 12345 from port 12345 user@CE1# set firewall family inet filter ip-v4 term 12345 then dscp be user@CE1# set firewall family inet filter ip-v4 term accept then accept
逐步过程
要配置设备 PE1:
配置设备接口。
[edit ] user@PE1# set interfaces ge-1/0/9 description to_P1 user@PE1# set interfaces ge-1/0/9 unit 0 family inet address 10.30.0.1/30 user@PE1# set interfaces ge-1/0/9 unit 0 family mpls user@PE1# set interfaces lo0 unit 0 description loopback-interface user@PE1# set interfaces lo0 unit 0 family inet address 10.255.70.31/32
配置 VLAN 参数。
[edit ] user@PE1# set interfaces ge-1/0/6 vlan-tagging user@PE1# set interfaces ge-1/0/6 encapsulation vlan-vpls user@PE1# set interfaces ge-1/0/6 unit 512 description to_vpls user@PE1# set interfaces ge-1/0/6 unit 512 encapsulation vlan-vpls user@PE1# set interfaces ge-1/0/6 unit 512 vlan-id 512
配置协议参数。
[edit ] user@PE1# set protocols mpls interface ge-1/0/9.0 user@PE1# set protocols bgp group to_PE2 type internal user@PE1# set protocols bgp group to_PE2 local-address 10.255.70.31 user@PE1# set protocols bgp group to_PE2 family l2vpn signaling user@PE1# set protocols bgp group to_PE2 neighbor 172.30.14.1 user@PE1# set protocols ospf traffic-engineering user@PE1# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@PE1# set protocols ospf area 0.0.0.0 interface ge-1/0/9.0 user@PE1# set protocols ldp interface ge-1/0/9.0 user@PE1# set protocols ldp interface lo0.0
配置路由选项参数。
[edit ] user@PE1# set routing-options router-id 10.255.70.31 user@PE1# set routing-options autonomous-system 64511
配置路由实例参数。
[edit ] user@PE1# set routing-instances vpls_a instance-type vpls user@PE1# set routing-instances vpls_a interface ge-1/0/6.512 user@PE1# set routing-instances vpls_a route-distinguisher 64511:1 user@PE1# set routing-instances vpls_a vrf-target target:64511:1 user@PE1# set routing-instances vpls_a protocols vpls no-tunnel-services user@PE1# set routing-instances vpls_a protocols vpls site 1 site-identifier 1 user@PE1# set routing-instances vpls_a protocols vpls site 1 interface ge-1/0/6.512
逐步过程
要配置设备 P1:
配置设备接口。
[edit ] user@P1# set interfaces ge-1/0/3 description to_P2 user@P1# set interfaces ge-1/0/3 unit 0 family inet address 10.40.0.1/30 user@P1# set interfaces ge-1/0/3 unit 0 family mpls user@P1# set interfaces ge-1/0/9 description to_PE1 user@P1# set interfaces ge-1/0/9 unit 0 family inet address 10.30.0.2/30 user@P1# set interfaces ge-1/0/9 unit 0 family mpls user@P1# set interfaces lo0 unit 0 description loopback-interface user@P1# set interfaces lo0 unit 0 family inet address 192.168.16.1/32
配置协议参数。
[edit ] user@P1# set protocols mpls interface ge-1/0/9.0 user@P1# set protocols mpls interface ge-1/0/3.0 user@P1# set protocols ospf traffic-engineering user@P1# set protocols ospf area 0.0.0.0 interface ge-1/0/3.0 user@P1# set protocols ospf area 0.0.0.0 interface ge-1/0/9.0 user@P1# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@P1# set protocols ldp interface ge-1/0/3.0 user@P1# set protocols ldp interface ge-1/0/9.0 user@P1# set protocols ldp interface lo0.0
配置路由选项参数。
[edit ] user@P1# set routing-options router-id 192.168.16.1
逐步过程
要配置设备 P2:
配置设备接口。
[edit ] user@P2# set interfaces ge-2/0/6 description to_P1 user@P2#set interfaces ge-2/0/6 unit 0 family inet address 10.40.0.2/30 user@P2# set interfaces ge-2/0/6 unit 0 family mpls user@P2# set interfaces ge-2/0/8 description to_PE2 user@P2# set interfaces ge-2/0/8 unit 0 family inet address 10.50.0.1/30 user@P2# set interfaces ge-2/0/8 unit 0 family mpls user@P2# set interfaces lo0 unit 0 description loopback-interface user@P2# set interfaces lo0 unit 0 family inet address 192.168.13.1/32
配置协议参数。
[edit ] user@P2# set protocols mpls interface ge-2/0/6.0 user@P2# set protocols mpls interface ge-2/0/8.0 user@P2# set protocols ospf traffic-engineering user@P2# set protocols ospf area 0.0.0.0 interface ge-2/0/6.0 user@P2# set protocols ospf area 0.0.0.0 interface ge-2/0/8.0 user@P2# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@P2# set protocols ldp interface ge-2/0/6.0 user@P2# set protocols ldp interface ge-2/0/8.0 user@P2# set protocols ldp interface lo0.0
配置路由选项参数。
[edit ] user@P2# set routing-options router-id 192.168.13.1
逐步过程
要配置设备 PE2:
配置设备接口。
[edit ] user@PE2# set interfaces ge-2/0/8 description to-R1 user@PE2# set interfaces ge-2/0/8 unit 0 family inet address 10.50.0.2/30 user@PE2# set interfaces ge-2/0/8 unit 0 family mpls user@PE2# set interfaces lo0 unit 0 description loopback-interface user@PE2# set interfaces lo0 unit 0 family inet address 172.30.14.1/32
配置 VLAN 参数。
[edit ] user@PE2# set interfaces ge-2/1/1 vlan-tagging user@PE2# set interfaces ge-2/1/1 encapsulation vlan-vpls user@PE2# set interfaces ge-2/1/1 unit 512 description to_vpls user@PE2# set interfaces ge-2/1/1 unit 512 encapsulation vlan-vpls user@PE2# set interfaces ge-2/1/1 unit 512 vlan-id 512
配置协议参数。
[edit ] user@PE2# set protocols mpls interface ge-2/0/8.0 user@PE2# set protocols bgp group to_PE1 type internal user@PE2# set protocols bgp group to_PE1 local-address 172.30.14.1 user@P2# set protocols bgp group to_PE1 family l2vpn signaling user@PE2# set protocols bgp group to_PE1 neighbor 10.255.70.31 user@PE2# set protocols ospf traffic-engineering user@PE2# set protocols ospf area 0.0.0.0 interface ge-2/0/8.0 user@PE2# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@PE2# set protocols ldp interface ge-2/0/8.0 user@PE2# set protocols ldp interface lo0.0
配置路由选项参数。
[edit ] user@PE2# set routing-options router-id 172.30.14.1 user@PE2# set routing-options autonomous-system 64511
配置路由实例参数。
[edit ] user@P2# set routing-instances vpls_a instance-type vpls user@PE2# set routing-instances vpls_a interface ge-2/1/1.512 user@PE2# set routing-instances vpls_a route-distinguisher 64511:1 user@PE2# set routing-instances vpls_a vrf-target target:64511:1 user@PE2# set routing-instances vpls_a protocols vpls no-tunnel-services user@PE2# set routing-instances vpls_a protocols vpls site 2 site-identifier 2 user@PE2# set routing-instances vpls_a protocols vpls site 2 interface ge-2/1/1.512
逐步过程
要配置设备 CE2:
配置设备接口。
[edit ] user@CE2# set interfaces ge-2/0/7 unit 0 description to-Host2 user@CE2# set interfaces ge-2/0/7 unit 0 family inet address 172.16.80.2/30 user@CE2# set interfaces ge-2/0/7 unit 0 family inet filter input ip-v4 user@CE2# set interfaces lo0 unit 1 description loopback-interface user@CE2# set interfaces lo0 unit 1 family inet address 192.168.0.2/32
配置 VLAN 参数
[edit ] user@CE2# set interfaces ge-2/1/2 vlan-tagging user@CE2# set interfaces ge-2/1/2 unit 512 description to-PE2 user@CE2# set interfaces ge-2/1/2 unit 512 vlan-id 512 user@CE2# set interfaces ge-2/1/2 unit 512 family inet address 10.10.1.2/24
配置服务等级参数。
[edit ] user@CE2# set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class expedited-forwarding loss-priority low code-point 010 user@CE2# set class-of-service rewrite-rules ieee-802.1 ieee1-c2 forwarding-class best-effort loss-priority low code-point 000 user@CE2# set class-of-service classifiers ieee-802.1 dscp1 forwarding-class expedited-forwarding loss-priority low code-points ef user@CE2# set class-of-service classifiers ieee-802.1 dscp1 forwarding-class best-effort loss-priority low code-points be user@CE2# set class-of-service interfaces ge-2/1/2 unit 512 rewrite-rules ieee-802.1 ieee1-c2 user@CE2# set class-of-service interfaces ge-2/1/2 unit 512 classifiers ieee-802.1 dscp1
配置协议参数。
[edit ] user@CE2# set protocols ospf area 0.0.0.0 interface lo0.0 passive user@CE2# set protocols ospf area 0.0.0.0 interface ge-2/0/7.0 passive user@CE2# set protocols ospf area 0.0.0.0 interface ge-2/1/2.512
配置防火墙 DSCP 重写参数。
[edit ] user@CE2# set firewall family inet filter ip-v4 term tcp80 from port 80 user@CE2# set firewall family inet filter ip-v4 term tcp80 then dscp ef user@CE2# set firewall family inet filter ip-v4 term 12345 from port 12345 user@CE2# set firewall family inet filter ip-v4 term 12345 then dscp be user@CE2# set firewall family inet filter ip-v4 term accept then accept
结果
在配置模式下,输入 、 show interfaces
show class-of-service
、 show protocols
show routing-options, show routing-instances,
和 show firewall
, 命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@CE1# show interfaces ge-1/0/1 { unit 0 { description to-Host1; family inet { filter { input ip-v4; } address 172.16.50.2/30; } } } ge-1/0/5 { vlan-tagging; unit 512 { description to_PE1; vlan-id 512; family inet { address 10.10.1.1/24; } } } lo0 { unit 1 { description loopback-interface; family inet { address 192.168.0.1/32; } } }
user@CE1# show class-of-service classifiers { ieee-802.1 dscp1 { forwarding-class expedited-forwarding { loss-priority low code-points ef; } forwarding-class best-effort { loss-priority low code-points be; } } } interfaces { ge-1/0/5 { unit 512 { classifiers { ieee-802.1 dscp1; } rewrite-rules { ieee-802.1 ieee1-c2; } } } } rewrite-rules { ieee-802.1 ieee1-c2 { forwarding-class expedited-forwarding { loss-priority low code-point 010; } forwarding-class best-effort { loss-priority low code-point 000; } } }
user@CE1# show protocols ospf { area 0.0.0.0 { interface ge-1/0/5.512; interface ge-1/0/1.0 { passive; } interface lo0.1 { passive; } } }
user@CE1# show firewall family inet { filter ip-v4 { term tcp80 { from { port 80; } then dscp ef; } term 12345 { from { port 12345; } then dscp be; } term accept { then accept; } } }
完成设备 CE1 配置后,请从配置模式进入 commit
。
user@PE1# show interfaces ge-1/0/6 { vlan-tagging; encapsulation vlan-vpls; unit 512 { description to_vpls; encapsulation vlan-vpls; vlan-id 512; } } ge-1/0/9 { description to_P1; unit 0 { family inet { address 10.30.0.1/30; } family mpls; } } lo0 { unit 0 { description loopback-interface; family inet { address 10.255.70.31/32; } } }
user@PE1# show protocols mpls { interface ge-1/0/9.0; } bgp { group to_PE2 { type internal; local-address 10.255.70.31; family l2vpn { signaling; } neighbor 172.30.14.1; } } ospf { traffic-engineering; area 0.0.0.0 { interface lo0.0 { passive; } interface ge-1/0/9.0; } } ldp { interface ge-1/0/9.0; interface lo0.0; }
user@PE1# show routing-options router-id 10.255.70.31; autonomous-system 64511;
user@PE1# show routing-instances vpls_a { instance-type vpls; interface ge-1/0/6.512; route-distinguisher 64511:1; vrf-target target:64511:1; protocols { vpls { no-tunnel-services; site 1 { site-identifier 1; interface ge-1/0/6.512; } } } }
完成设备 PE1 配置后,请从配置模式进入 commit
。
user@P1# show interfaces ge-1/0/3 { description to_P2; unit 0 { family inet { address 10.40.0.1/30; } family mpls; } } ge-1/0/9 { description to_PE1; unit 0 { family inet { address 10.30.0.2/30; } family mpls; } } lo0 { unit 0 { description loopback-interface; family inet { address 192.168.16.1/32; } } } lo0 { unit 0 { description loopback-interface; family inet { address 192.168.16.1/32; } } }
user@P1# show protocols mpls { interface ge-1/0/9.0; interface ge-1/0/3.0; } ospf { traffic-engineering; area 0.0.0.0 { interface ge-1/0/3.0; interface ge-1/0/9.0; interface lo0.0 { passive; } } } ldp { interface ge-1/0/3.0; interface ge-1/0/9.0; interface lo0.0; }
user@P1# show routing-options router-id 192.168.16.1;
完成设备 P1 配置后,请从配置模式进入 commit
。
user@P2# show interfaces ge-2/0/6 { description to_P1; unit 0 { family inet { address 10.40.0.2/30; } family mpls; } } ge-2/0/8 { description to_PE2; unit 0 { family inet { address 10.50.0.1/30; } family mpls; } } lo0 { unit 0 { description loopback-interface; family inet { address 192.168.13.1/32; } } }
user@P2# show protocols mpls { interface ge-2/0/6.0; interface ge-2/0/8.0; } ospf { traffic-engineering; area 0.0.0.0 { interface ge-2/0/6.0; interface ge-2/0/8.0; interface lo0.0 { passive; } } } ldp { interface ge-2/0/6.0; interface ge-2/0/8.0; interface lo0.0; }
user@P2# show routing-options router-id 192.168.13.1;
完成设备 P2 配置后,请从配置模式进入 commit
。
user@PE2# show interfaces ge-2/0/8 { description to-R1; unit 0 { family inet { address 10.50.0.2/30; } family mpls; } } ge-2/1/1 { vlan-tagging; encapsulation vlan-vpls; unit 512 { description to_vpls; encapsulation vlan-vpls; vlan-id 512; } } lo0 { unit 0 { description loopback-interface; family inet { address 172.30.14.1/32; } } }
user@PE2# show protocols mpls { interface ge-2/0/8.0; } bgp { group to_PE1 { type internal; local-address 172.30.14.1; family l2vpn { signaling; } neighbor 10.255.70.31; } } ospf { traffic-engineering; area 0.0.0.0 { interface ge-2/0/8.0; interface lo0.0 { passive; } } } ldp { interface ge-2/0/8.0; interface lo0.0; }
user@PE2# show routing-options router-id 172.30.14.1; autonomous-system 64511;
user@PE2# show routing-instances vpls_a { instance-type vpls; interface ge-2/1/1.512; route-distinguisher 64511:1; vrf-target target:64511:1; protocols { vpls { no-tunnel-services; site 2 { site-identifier 2; interface ge-2/1/1.512; } } } }
完成设备 PE2 配置后,请从配置模式进入 commit
。
user@CE2# show interfaces ge-2/0/7 { unit 0 { description to-Host2; family inet { filter { input ip-v4; } address 172.16.80.2/30; } } } ge-2/1/2 { vlan-tagging; unit 512 { description to-PE2; vlan-id 512; family inet { address 10.10.1.2/24; } } } lo0 { unit 1 { description loopback-interface; family inet { address 192.168.0.2/32; } } } user@CE2# show class-of-service classifiers { ieee-802.1 dscp1 { forwarding-class expedited-forwarding { loss-priority low code-points ef; } forwarding-class best-effort { loss-priority low code-points be; } } } interfaces { ge-2/1/2 { unit 512 { classifiers { ieee-802.1 dscp1; } rewrite-rules { ieee-802.1 ieee1-c2; } } } } rewrite-rules { ieee-802.1 ieee1-c2 { forwarding-class expedited-forwarding { loss-priority low code-point 010; } forwarding-class best-effort { loss-priority low code-point 000; } } } user@CE2# show protocols ospf { area 0.0.0.0 { interface lo0.1 { passive; } interface ge-2/0/7.0 { passive; } interface ge-2/1/2.512; } } user@CE2# show firewall family inet { filter ip-v4 { term tcp80 { from { port 80; } then dscp ef; } term 12345 { from { port 12345; } then dscp be; } term accept { then accept; } } }
完成设备 CE2 配置后,请从配置模式进入 commit
。
验证
通过验证从设备 CE1 到设备 CE2 维护 DSCP 别名,确认配置工作正常。
清除防火墙计数器
目的
确认防火墙计数器已清除。
行动
在设备 CE2 上,运行 clear firewall all
命令将防火墙计数器重置为 0。
user@CE2> clear firewall all
从 TCP HTTP 端口 80 和 12345 向网络发送流量并验证结果
目的
将流量发送到网络,可在设备 CE2 上验证。
行动
如果要验证从设备主机1 传输到设备主机2 的流量是否仍具有正确的 DSCP 别名,请在设备 CE2 上配置新防火墙。以下命令将创建并应用显示每个代码点别名的流量计数的防火墙过滤器:
user@CE2# set firewall family inet filter count term be from dscp be user@CE2# set firewall family inet filter count term be then count be user@CE2# set firewall family inet filter count term ef from dscp ef user@CE2# set firewall family inet filter count term ef then count ef user@CE2# set firewall family inet filter count term accept then accept user@CE2# set interfaces ge-2/0/7 unit 0 family inet filter output count
完成设备 CE2 配置后,请从配置模式进入 commit
。
完成测试后,可以将计数过滤器保留到位,也可以将其移除。
在设备上,Host1 使用流量生成器将源端口为 80 的 20 个 TCP 数据包发送到网络。
-s 标志设置源端口。-k 标记会使源端口保持稳定,而不是递增。-c 标志将数据包数设置为 20。
使用 12345 的源端口重复该任务。
[user@host1]# hping 172.16.80.1 -s 80 -k -c 20 [user@host1]# hping 172.16.80.1 -s 12345 -k -c 20
在设备 CE2 上,使用
show firewall
命令显示防火墙计数器。user@CE2> show firewall show firewall Filter: __CE2/count Counters: Name Bytes Packets be 800 20 ef 800 20
意义
设备 CE1 设置的代码点别名在 VPLS 主干中维护,在设备 CE2 上看起来完好无损。