示例:在移动回传场景中配置伪线冗余
此示例说明如何在移动回传场景中配置第 2 层和第 3 层分段互连的伪线冗余。
要求
此示例可使用以下硬件和软件组件进行配置:
Junos OS 13.2 或更高版本
ACX5000 系列路由器作为接入 (A) 路由器
适用于提供商边缘 (PE) 路由器的 MX 系列 5G 通用路由平台或 M 系列多服务边缘路由器
用作传输标签交换路由器的 PTX 系列数据包传输路由器
适用于核心路由器的 T 系列核心路由器
PE 路由器也可以是 T 系列核心路由器,但这并不典型。根据您的扩展要求,核心路由器也可以是 MX 系列 5G 通用路由平台或 M 系列多服务边缘路由器。客户边缘 (CE) 设备可以是瞻博网络或其他供应商提供的其他路由器或交换机。
配置此示例之前,不需要除设备初始化之外的特殊配置。
概述
配置
程序
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 CE1
set interfaces ge-1/3/3 vlan-tagging set interfaces ge-1/3/3 unit 600 vlan-id 600 set interfaces ge-1/3/3 unit 600 family inet address 10.41.0.104/24 set interfaces lo0 unit 0 family inet address 192.168.0.104/32 primary set protocols ospf area 0.0.0.0 interface ge-1/3/3.600 set protocols ospf area 0.0.0.0 interface lo0.0 set routing-options static route 192.168.0.0/8 next-hop 10.41.0.1 set routing-options static route 10.53.0.0/16 next-hop 10.41.0.1 set routing-options router-id 192.168.0.104
设备 A1
set interfaces ge-1/3/0 unit 0 family inet address 10.20.0.100/24 set interfaces ge-1/3/0 unit 0 family iso set interfaces ge-1/3/0 unit 0 family mpls set interfaces ge-1/3/1 unit 0 family inet address 10.10.0.100/24 set interfaces ge-1/3/1 unit 0 family iso set interfaces ge-1/3/1 unit 0 family mpls set interfaces ge-1/3/2 vlan-tagging set interfaces ge-1/3/2 encapsulation vlan-ccc set interfaces ge-1/3/2 unit 600 encapsulation vlan-ccc set interfaces ge-1/3/2 unit 600 vlan-id 600 set interfaces ge-1/3/2 unit 600 family ccc set interfaces lo0 unit 0 family inet address 192.168.0.100/32 primary set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0100.00 set routing-options router-id 192.168.0.100 set routing-options autonomous-system 64510 set routing-options forwarding-table export pplb set protocols rsvp interface ge-1/3/0.0 set protocols rsvp interface ge-1/3/1.0 set protocols rsvp interface lo0.0 set protocols mpls interface ge-1/3/0.0 set protocols mpls interface ge-1/3/1.0 set protocols isis interface ge-1/3/0.0 set protocols isis interface ge-1/3/1.0 set protocols isis interface lo0.0 set protocols ldp interface ge-1/3/0.0 set protocols ldp interface ge-1/3/1.0 set protocols ldp interface lo0.0 set protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600 virtual-circuit-id 1 set protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600 pseudowire-status-tlv set protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600 revert-time 10 maximum 60 set protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600 backup-neighbor 192.168.0.102 virtual-circuit-id 2 set protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600 backup-neighbor 192.168.0.102 hot-standby set policy-options policy-statement pplb then load-balance per-packet
设备 PE1
set interfaces ge-0/1/1 unit 0 family inet address 10.21.0.101/24 set interfaces ge-0/1/1 unit 0 family iso set interfaces ge-0/1/1 unit 0 family mpls set interfaces ge-0/1/2 unit 0 family inet address 10.31.0.101/24 set interfaces ge-0/1/2 unit 0 family iso set interfaces ge-0/1/2 unit 0 family mpls set interfaces ge-0/1/3 unit 0 family inet address 10.10.0.101/24 set interfaces ge-0/1/3 unit 0 family iso set interfaces ge-0/1/3 unit 0 family mpls set interfaces lt-1/2/0 unit 600 encapsulation vlan-ccc set interfaces lt-1/2/0 unit 600 vlan-id 600 set interfaces lt-1/2/0 unit 600 peer-unit 601 set interfaces lt-1/2/0 unit 601 encapsulation vlan set interfaces lt-1/2/0 unit 601 vlan-id 600 set interfaces lt-1/2/0 unit 601 peer-unit 600 set interfaces lt-1/2/0 unit 601 family inet filter input icmp_inet set interfaces lt-1/2/0 unit 601 family inet filter output icmp_inet set interfaces lt-1/2/0 unit 601 family inet address 10.41.0.101/24 vrrp-group 0 virtual-address 10.41.0.1 set interfaces lt-1/2/0 unit 601 family inet address 10.41.0.101/24 vrrp-group 0 accept-data set interfaces lo0 unit 0 family inet address 192.168.0.101/32 primary set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0003.00 set interfaces lo0 unit 1 family inet address 192.168.1.101/32 set routing-options router-id 192.168.0.101 set routing-options autonomous-system 64511 set protocols rsvp interface ge-0/1/1.0 set protocols rsvp interface ge-0/1/2.0 set protocols rsvp interface ge-0/1/3.0 set protocols rsvp interface lo0.0 set protocols mpls label-switched-path to_PE3 to 192.168.0.103 set protocols mpls label-switched-path to_PE2 to 192.168.0.102 set protocols mpls interface ge-0/1/1.0 set protocols mpls interface ge-0/1/2.0 set protocols mpls interface ge-0/1/3.0 set protocols bgp local-address 192.168.0.101 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp peer-as 64511 set protocols bgp group ibgp neighbor 192.168.0.102 set protocols bgp group ibgp neighbor 192.168.0.103 set protocols isis interface ge-0/1/1.0 set protocols isis interface ge-0/1/2.0 set protocols isis interface ge-0/1/3.0 set protocols isis interface lo0.0 set protocols ldp interface ge-0/1/1.0 set protocols ldp interface ge-0/1/2.0 set protocols ldp interface ge-0/1/3.0 set protocols ldp interface lo0.0 set protocols l2circuit neighbor 192.168.0.100 interface lt-1/2/0.600 virtual-circuit-id 1 set protocols l2circuit neighbor 192.168.0.100 interface lt-1/2/0.600 pseudowire-status-tlv hot-standby-vc-on set policy-options policy-statement l3vpn_export term primary from condition primary set policy-options policy-statement l3vpn_export term primary then local-preference add 300 set policy-options policy-statement l3vpn_export term primary then community set l3vpn set policy-options policy-statement l3vpn_export term primary then accept set policy-options policy-statement l3vpn_export term standby from condition standby set policy-options policy-statement l3vpn_export term standby then local-preference add 30 set policy-options policy-statement l3vpn_export term standby then community set l3vpn set policy-options policy-statement l3vpn_export term standby then accept set policy-options policy-statement l3vpn_export term default then community set l3vpn set policy-options policy-statement l3vpn_export term default then accept set policy-options policy-statement l3vpn_import term 1 from community l3vpn set policy-options policy-statement l3vpn_import term 1 then accept set policy-options policy-statement l3vpn_import term default then reject set policy-options policy-statement ospf_export term 0 from community l3vpn set policy-options policy-statement ospf_export term 0 then accept set policy-options community l3vpn members target:64511:600 set policy-options condition primary if-route-exists address-family ccc lt-1/2/0.600 set policy-options condition primary if-route-exists address-family ccc table mpls.0 set policy-options condition primary if-route-exists address-family ccc peer-unit 601 set policy-options condition standby if-route-exists address-family ccc lt-1/2/0.600 set policy-options condition standby if-route-exists address-family ccc table mpls.0 set policy-options condition standby if-route-exists address-family ccc standby set policy-options condition standby if-route-exists address-family ccc peer-unit 601 set firewall family inet filter icmp_inet interface-specific set firewall family inet filter icmp_inet term 0 from source-address 10.41.0.101/32 except set firewall family inet filter icmp_inet term 0 from source-address 10.0.0.0/8 set firewall family inet filter icmp_inet term 0 from protocol icmp set firewall family inet filter icmp_inet term 0 then count icmp_inet set firewall family inet filter icmp_inet term 0 then log set firewall family inet filter icmp_inet term 0 then accept set firewall family inet filter icmp_inet term 1 then accept set routing-instances l3vpn instance-type vrf set routing-instances l3vpn interface lt-1/2/0.601 set routing-instances l3vpn interface lo0.1 set routing-instances l3vpn route-distinguisher 192.168.1.101:64511 set routing-instances l3vpn vrf-import l3vpn_import set routing-instances l3vpn vrf-export l3vpn_export set routing-instances l3vpn vrf-table-label set routing-instances l3vpn protocols ospf export ospf_export set routing-instances l3vpn protocols ospf area 0.0.0.0 lt-1/2/0.601 set routing-instances l3vpn protocols ospf area 0.0.0.0 lo0.1
设备 PE2
set interfaces ge-0/3/0 unit 0 family inet address 10.20.0.102/24 set interfaces ge-0/3/0 unit 0 family iso set interfaces ge-0/3/0 unit 0 family mpls set interfaces ge-0/3/1 unit 0 family inet address 10.21.0.102/24 set interfaces ge-0/3/1 unit 0 family iso set interfaces ge-0/3/1 unit 0 family mpls set interfaces ge-0/3/3 unit 0 family inet address 10.32.0.102/24 set interfaces ge-0/3/3 unit 0 family iso set interfaces ge-0/3/3 unit 0 family mpls set interfaces lt-1/2/0 unit 600 encapsulation vlan-ccc set interfaces lt-1/2/0 unit 600 vlan-id 600 set interfaces lt-1/2/0 unit 600 peer-unit 601 set interfaces lt-1/2/0 unit 601 encapsulation vlan set interfaces lt-1/2/0 unit 601 vlan-id 600 set interfaces lt-1/2/0 unit 601 peer-unit 600 set interfaces lt-1/2/0 unit 601 family inet filter input icmp_inet set interfaces lt-1/2/0 unit 601 family inet filter output icmp_inet set interfaces lt-1/2/0 unit 601 family inet address 10.41.0.102/24 vrrp-group 0 virtual-address 10.41.0.1 set interfaces lt-1/2/0 unit 601 family inet address 10.41.0.102/24 vrrp-group 0 accept-data set interfaces lo0 unit 0 family inet address 192.168.0.102/32 primary set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0102.00 set interfaces lo0 unit 1 family inet address 192.168.1.102/32 set routing-options router-id 192.168.0.102 set routing-options autonomous-system 64511 set protocols rsvp interface ge-0/3/0.0 set protocols rsvp interface ge-0/3/1.0 set protocols rsvp interface ge-0/3/3.0 set protocols rsvp interface lo0.0 set protocols mpls label-switched-path to_PE1 to 192.168.0.101 set protocols mpls label-switched-path to_PE3 to 192.168.0.103 set protocols mpls interface ge-0/3/0.0 set protocols mpls interface ge-0/3/1.0 set protocols mpls interface ge-0/3/3.0 set protocols bgp local-address 192.168.0.102 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp peer-as 64511 set protocols bgp group ibgp neighbor 192.168.0.101 set protocols bgp group ibgp neighbor 192.168.0.103 set protocols isis interface ge-0/3/0.0 set protocols isis interface ge-0/3/1.0 set protocols isis interface ge-0/3/3.0 set protocols isis interface lo0.0 set protocols ldp interface ge-0/3/0.0 set protocols ldp interface ge-0/3/1.0 set protocols ldp interface ge-0/3/3.0 set protocols ldp interface lo0.0 set protocols l2circuit neighbor 192.168.0.100 interface lt-1/2/0.600 virtual-circuit-id 2 set protocols l2circuit neighbor 192.168.0.100 interface lt-1/2/0.600 pseudowire-status-tlv hot-standby-vc-on set policy-options policy-statement l3vpn_export term primary from condition primary set policy-options policy-statement l3vpn_export term primary then local-preference add 300 set policy-options policy-statement l3vpn_export term primary then community set l3vpn set policy-options policy-statement l3vpn_export term primary then accept set policy-options policy-statement l3vpn_export term standby from condition standby set policy-options policy-statement l3vpn_export term standby then local-preference add 30 set policy-options policy-statement l3vpn_export term standby then community set l3vpn set policy-options policy-statement l3vpn_export term standby then accept set policy-options policy-statement l3vpn_export term default then community set l3vpn set policy-options policy-statement l3vpn_export term default then accept set policy-options policy-statement l3vpn_import term 1 from community l3vpn set policy-options policy-statement l3vpn_import term 1 then accept set policy-options policy-statement l3vpn_import term default then reject set policy-options policy-statement ospf_export term 0 from community l3vpn set policy-options policy-statement ospf_export term 0 then accept set policy-options community l3vpn members target:64511:600 set policy-options condition primary if-route-exists address-family ccc lt-1/2/0.600 set policy-options condition primary if-route-exists address-family ccc table mpls.0 set policy-options condition primary if-route-exists address-family ccc peer-unit 601 set policy-options condition standby if-route-exists address-family ccc lt-1/2/0.600 set policy-options condition standby if-route-exists address-family ccc table mpls.0 set policy-options condition standby if-route-exists address-family ccc standby set policy-options condition standby if-route-exists address-family ccc peer-unit 601 set firewall family inet filter icmp_inet interface-specific set firewall family inet filter icmp_inet term 0 from source-address 10.41.0.102/32 except set firewall family inet filter icmp_inet term 0 from source-address 10.0.0.0/8 set firewall family inet filter icmp_inet term 0 from protocol icmp set firewall family inet filter icmp_inet term 0 then count icmp_inet set firewall family inet filter icmp_inet term 0 then log set firewall family inet filter icmp_inet term 0 then accept set firewall family inet filter icmp_inet term 1 then accept set routing-instances l3vpn instance-type vrf set routing-instances l3vpn interface lt-1/2/0.601 set routing-instances l3vpn interface lo0.1 set routing-instances l3vpn route-distinguisher 192.168.1.102:64511 set routing-instances l3vpn vrf-import l3vpn_import set routing-instances l3vpn vrf-export l3vpn_export set routing-instances l3vpn vrf-table-label set routing-instances l3vpn protocols ospf export ospf_export set routing-instances l3vpn protocols ospf area 0.0.0.0 interface lt-1/2/0.601 set routing-instances l3vpn protocols ospf area 0.0.0.0 interface lo0.1
设备 PE3
set interfaces ge-2/0/3 unit 0 family inet address 10.32.0.103/24 set interfaces ge-2/0/3 unit 0 family iso set interfaces ge-2/0/3 unit 0 family mpls set interfaces ge-2/0/5 unit 0 family inet address 10.53.0.103/24 set interfaces ge-2/0/5 unit 0 family mpls set interfaces ge-2/1/8 unit 0 family inet address 10.31.0.103/24 set interfaces ge-2/1/8 unit 0 family iso set interfaces ge-2/1/8 unit 0 family mpls set interfaces lo0 unit 0 family inet address 192.168.0.103/32 primary set interfaces lo0 unit 0 family iso address 49.0002.0192.0168.0103.00 set interfaces lo0 unit 1 family inet address 192.168.1.103/32 set routing-options router-id 192.168.0.103 set routing-options autonomous-system 64511 set protocols rsvp interface ge-2/0/3.0 set protocols rsvp interface ge-2/1/8.0 set protocols rsvp interface lo0.0 set protocols mpls label-switched-path to_PE1 to 192.168.0.101 set protocols mpls label-switched-path to_PE2 to 192.168.0.102 set protocols mpls interface ge-2/0/3.0 set protocols mpls interface ge-2/1/8.0 set protocols bgp local-address 192.168.0.103 set protocols bgp group ibgp family inet-vpn any set protocols bgp group ibgp peer-as 64511 set protocols bgp group ibgp neighbor 192.168.0.101 set protocols bgp group ibgp neighbor 192.168.0.102 set protocols isis interface ge-2/0/3.0 set protocols isis interface ge-2/1/8.0 set protocols isis interface lo0.0 set protocols ldp interface ge-2/0/3.0 set protocols ldp interface ge-2/1/8.0 set protocols ldp interface lo0.0 set policy-options policy-statement l3vpn_ospf_export term 0 from protocol direct set policy-options policy-statement l3vpn_ospf_export term 0 then accept set policy-options policy-statement l3vpn_ospf_import term 0 from protocol bgp set policy-options policy-statement l3vpn_ospf_import term 0 from community l3vpn set policy-options policy-statement l3vpn_ospf_import term 0 then accept set policy-options policy-statement ospf_export term 0 from community l3vpn set policy-options policy-statement ospf_export term 0 then accept set policy-options community l3vpn members target:64511:600 set routing-instances l3vpn instance-type vrf set routing-instances l3vpn interface ge-2/0/5.0 set routing-instances l3vpn interface lo0.1 set routing-instances l3vpn route-distinguisher 192.168.0.103:64511 set routing-instances l3vpn vrf-target target:64511:600 set routing-instances l3vpn vrf-table-label set routing-instances l3vpn protocols ospf export ospf_export set routing-instances l3vpn protocols ospf area 0.0.0.0 interface ge-2/0/5.0 set routing-instances l3vpn protocols ospf area 0.0.0.0 interface lo0.1
设备 CE2
set interfaces ge-2/0/8 unit 0 family inet address 10.53.0.105/24 set interfaces lo0 unit 0 family inet address 192.168.0.105/32 primary 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 set routing-options router-id 192.168.0.105
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 A1:
-
配置接口。
在面向核心的接口上启用 MPLS。ISO 地址家族也已启用,因为 IS-IS 用作提供商网络中的内部网关协议 (IGP)。
在面向客户的界面上,无需启用 MPLS。在此接口上,启用 CCC 封装和地址族 CCC。
[edit interfaces] user@A1# set ge-1/3/0 unit 0 family inet address 10.20.0.100/24 user@A1# set ge-1/3/0 unit 0 family iso user@A1# set ge-1/3/0 unit 0 family mpls user@A1# set ge-1/3/1 unit 0 family inet address 10.10.0.100/24 user@A1# set ge-1/3/1 unit 0 family iso user@A1# set ge-1/3/1 unit 0 family mpls user@A1# set ge-1/3/2 vlan-tagging user@A1# set ge-1/3/2 encapsulation vlan-ccc user@A1# set ge-1/3/2 unit 600 encapsulation vlan-ccc user@A1# set ge-1/3/2 unit 600 vlan-id 600 user@A1# set ge-1/3/2 unit 600 family ccc user@A1# set lo0 unit 0 family inet address 192.168.0.100/32 primary user@A1# set lo0 unit 0 family iso address 49.0002.0192.0168.0100.00
-
在面向核心的接口和环路接口上配置 RSVP。
RSVP 用于第 3 层域中。
[edit protocols rsvp] user@A1# set interface ge-1/3/0.0 user@A1# set interface ge-1/3/1.0 user@A1# set interface lo0.0
-
在面向核心的接口和环路接口上配置 LDP。
LDP 用于第 2 层域中。
[edit protocols ldp] user@A1# set interface ge-1/3/0.0 user@A1# set interface ge-1/3/1.0 user@A1# set interface lo0.0
-
在面向核心的接口上配置 MPLS。
[edit protocols mpls] user@A1# set interface ge-1/3/0.0 user@A1# set interface ge-1/3/1.0
-
在面向核心的接口和环路接口上配置内部网关协议,如 IS-IS 或 OSPF。
[edit protocols isis] user@A1# set interface ge-1/3/0.0 user@A1# set interface ge-1/3/1.0 user@A1# set interface lo0.0
-
在面向客户边缘的接口上,配置第 2 层电路。
hot-standby
在具有主动和备用虚拟电路 (VCS) 的路由器上配置语句(我们的拓扑中的设备 A1)。您必须在接入路由器上包含该pseudowire-status-tlv
语句。如果没有状态TLV信令,则无法将备用标志播发至远程提供商边缘 (PE) 设备。还应
revert-time
在maximum
接入路由器上配置语句和选项。如果没有该revert-time
语句,还原完成后,所有 VPC 的流量都不会过渡到主路径。revert-time
如果已定义延迟,但maximum
延迟没有,则在恢复计时器到期后,将立即还原 VPC。最大选项允许分散还原 PC,而不是一次恢复所有。[edit protocols l2circuit neighbor 192.168.0.101 interface ge-1/3/2.600] user@A1# set virtual-circuit-id 1 user@A1# set pseudowire-status-tlv user@A1# set revert-time 10 maximum 60 user@A1# set backup-neighbor 192.168.0.102 virtual-circuit-id 2 user@A1# set backup-neighbor 192.168.0.102 hot-standby
-
要让单一列表的下一跃点推送到其他接入路由器,请配置按数据包的负载平衡。
[edit policy-options policy-statement pplb] user@A1# set then load-balance per-packet
-
应用按数据包的负载平衡策略。
[edit routing-options forwarding-table] user@A1# set export pplb
-
配置自治系统 (AS) ID 和路由器 ID。
[edit routing-options] user@A1# set router-id 192.168.0.100 user@A1# set autonomous-system 64510
同样,配置任何其他接入设备。
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要配置设备 PE1:
配置接口。
在面向核心的接口上启用 MPLS。
[edit interfaces] user@PE1# set ge-0/1/1 unit 0 family inet address 10.21.0.101/24 user@PE1# set ge-0/1/1 unit 0 family iso user@PE1# set ge-0/1/1 unit 0 family mpls user@PE1# set ge-0/1/2 unit 0 family inet address 10.31.0.101/24 user@PE1# set ge-0/1/2 unit 0 family iso user@PE1# set ge-0/1/2 unit 0 family mpls user@PE1# set ge-0/1/3 unit 0 family inet address 10.10.0.101/24 user@PE1# set ge-0/1/3 unit 0 family iso user@PE1# set ge-0/1/3 unit 0 family mpls user@PE1# set lo0 unit 0 family inet address 192.168.0.101/32 primary user@PE1# set lo0 unit 0 family iso address 49.0002.0192.0168.0003.00 user@PE1# set lo0 unit 1 family inet address 192.168.1.101/32
在聚合路由器的设备 PE1 和设备 PE2 上,配置一对逻辑隧道接口以表示 LT(x) 和 LT(y)。
该解决方案使用逻辑隧道 (lt-) 配对接口来拼接第 2 层和第 3 层域。
第 2 层伪线在用电路交叉连接 (CCC) 地址家族定义的某个逻辑隧道接口 LT(x) 上终止。第 3 层 VPN 将终止使用 IPv4 (inet) 地址系列定义的第二个逻辑隧道接口 LT (y)。LT(x) 和 LT(y) 已配对。
[edit interfaces] user@PE1# set lt-1/2/0 unit 600 encapsulation vlan-ccc user@PE1# set lt-1/2/0 unit 600 vlan-id 600 user@PE1# set lt-1/2/0 unit 600 peer-unit 601 user@PE1# set lt-1/2/0 unit 601 encapsulation vlan user@PE1# set lt-1/2/0 unit 601 vlan-id 600 user@PE1# set lt-1/2/0 unit 601 peer-unit 600 user@PE1# set lt-1/2/0 unit 601 family inet filter input icmp_inet user@PE1# set lt-1/2/0 unit 601 family inet filter output icmp_inet
(可选)将唯一 VRRP 地址与设备 PE1 和设备 PE2 关联。
在这种情况下,设备 PE1 和设备 PE2 都承担定义的 VIP IPv4 地址的主要状态,因此路由器之间不会交换 VRRP hello 消息。
[edit interfaces lt-1/2/0 unit 601 family inet address 10.41.0.101/24] user@PE1# set vrrp-group 0 virtual-address 10.41.0.1 user@PE1# set vrrp-group 0 accept-data
配置 IS-IS 或其他 IGP。
[edit protocols isis] user@PE1# set interface ge-0/1/1.0 user@PE1# set interface ge-0/1/2.0 user@PE1# set interface ge-0/1/3.0 user@PE1# set interface lo0.0
在面向核心的接口上配置 MPLS。
[edit protocols mpls] user@PE1# set interface ge-0/1/1.0 user@PE1# set interface ge-0/1/2.0 user@PE1# set interface ge-0/1/3.0
配置到其他 PE 设备的标签交换路径。
BGP 是一种策略驱动型协议,因此还可以配置和应用任何所需的路由策略。例如,您可能需要将静态路由导出到 BGP 中。
[edit protocols mpls] user@PE1# set label-switched-path to_PE3 to 192.168.0.103 user@PE1# set label-switched-path to_PE2 to 192.168.0.102
在面向核心的接口和环路接口上配置 LDP。
[edit protocols ldp] user@PE1# set interface ge-0/1/1.0 user@PE1# set interface ge-0/1/2.0 user@PE1# set interface ge-0/1/3.0 user@PE1# set interface lo0.0
在面向核心的接口和环路接口上配置 RSVP。
[edit protocols rsvp] user@PE1# set interface ge-0/1/1.0 user@PE1# set interface ge-0/1/2.0 user@PE1# set interface ge-0/1/3.0 user@PE1# set interface lo0.0
配置内部 BGP (IBGP)。
[edit protocols bgp] user@PE1# set local-address 192.168.0.101 user@PE1# set group ibgp family inet-vpn any user@PE1# set group ibgp peer-as 64511 user@PE1# set group ibgp neighbor 192.168.0.102 user@PE1# set group ibgp neighbor 192.168.0.103
在逻辑隧道接口上配置第 2 层电路。
如果您希望在
hot-standby-vc-on
到达PW_FWD_STDBY状态TLV时建立热备用伪线,请配置语句。[edit protocols l2circuit neighbor 192.168.0.100 interface lt-1/2/0.600] user@PE1# set virtual-circuit-id 1 user@PE1# set pseudowire-status-tlv hot-standby-vc-on
定义一对条件,以应用于第 3 层 VPN 实例中定义的出口策略。
在条件
primary
和条件standby
中,匹配路由都与接口 lt-1/2/0.600 (y) 相对应,因为出口路由会出现在路由表 mpls.0 中,表示任何给定伪线。这些条件之间的差异在属性中
standby
。PW_FWD_STDBY状态TLV到达设备 PE1 或设备 PE2 后,Junos OS 符合条件standby
,因此,只会执行策略中的l3vpn
期限standby
。另一方面,如果PW_FWD_STDBY状态TLV不存在,则策略仅匹配条件primary
,然后在策略中l3vpn
执行术语primary
。此外,对于基于隧道的逻辑 CCC 服务,您必须指定与逻辑隧道 CCC 接口 LT(x) 关联的逻辑隧道接口 LT(y)。(请参阅了解伪线冗余移动回传场景。)最后,对于基于 CCC 的条件,Junos OS 仅允许 mpls.0 作为匹配路由表。
address
对于属性,Junos OS 仅允许使用逻辑接口单元格式(例如,lt-0/0/0.0)的字符串。[edit policy-options condition primary if-route-exists address-family ccc] user@PE1# set lt-1/2/0.600 user@PE1# set table mpls.0 user@PE1# set peer-unit 601 [edit policy-options condition standby if-route-exists address-family ccc] user@PE1# set lt-1/2/0.600 user@PE1# set table mpls.0 user@PE1# set standby user@PE1# set peer-unit 601
配置第 3 层 VPN 导出策略。
如果第 2 层虚拟电路 (VC) 为主,则相应的提供商边缘 (PE) 路由设备会使用较高的本地优先级播发附件电路的 (AC) 子网。所有聚合 PE 设备最初都会使用相同的本地优先级播发 AC 的子网。
如果第 2 层 VC 处于活动状态,则此路由策略允许播发更高的本地优先级值。
[edit policy-options policy-statement l3vpn_export] user@PE1# set term primary from condition primary user@PE1# set term primary then local-preference add 300 user@PE1# set term primary then community set l3vpn user@PE1# set term primary then accept user@PE1# set term standby from condition standby user@PE1# set term standby then local-preference add 30 user@PE1# set term standby then community set l3vpn user@PE1# set term standby then accept user@PE1# set term default then community set l3vpn user@PE1# set term default then accept
配置第 3 层 VPN 社区成员。
[edit policy-options community l3vpn] user@PE1# set members target:64511:600
基于第 3 层 VPN 社区配置第 3 层 VPN 导入策略。
[edit policy-options policy-statement l3vpn_import] user@PE1# set term 1 from community l3vpn user@PE1# set term 1 then accept user@PE1# set term default then reject
基于第 3 层 VPN 社区配置 OSPF 导出策略。
[edit policy-options policy-statement ospf_export term 0] user@PE1# set from community l3vpn user@PE1# set then accept
(可选)配置防火墙过滤器以检查流量走的路径。
[edit firewall family inet filter icmp_inet] user@PE1# set interface-specific user@PE1# set term 0 from source-address 10.41.0.101/32 except user@PE1# set term 0 from source-address 10.0.0.0/8 user@PE1# set term 0 from protocol icmp user@PE1# set term 0 then count icmp_inet user@PE1# set term 0 then log user@PE1# set term 0 then accept user@PE1# set term 1 then accept
配置路由实例。
此路由实例位于第 2 层域中,其中设备 PE1 和设备 PE2 通过多路访问媒体(以太网)互连到城域网。您必须在
vrf-table-label
设备 PE1 和设备 PE2 上包括 ' 语句,以启用与逻辑隧道 (lt-) 接口对应的直接子网前缀到第 3 层域的播发。设备 PE1 和设备 PE2 使用 OSPF 进行与设备 CE1 的第 3 层 VPN 通信。
[edit routing-instances l3vpn] user@PE1# set instance-type vrf user@PE1# set interface lt-1/2/0.601 user@PE1# set interface lo0.1 user@PE1# set route-distinguisher 192.168.1.101:64511 user@PE1# set vrf-import l3vpn_import user@PE1# set vrf-export l3vpn_export user@PE1# set vrf-table-label user@PE1# set protocols ospf export ospf_export user@PE1# set protocols ospf area 0.0.0.0 interface lt-1/2/0.601 user@PE1# set protocols ospf area 0.0.0.0 interface lo0.1
配置自治系统 (AS) ID 和路由器 ID。
[edit routing-options] user@PE1# set router-id 192.168.0.101 user@PE1# set autonomous-system 64511
同样,配置设备 PE2。
结果
在配置模式下,输入 、 show interfaces
show firewall
、 show protocols
、 show policy-options
、 show routing-options
和show routing-instances
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
设备 A1
user@A1# show interfaces
ge-1/3/0 {
unit 0 {
family inet {
address 10.20.0.100/24;
}
family iso;
family mpls;
}
}
ge-1/3/1 {
unit 0 {
family inet {
address 10.10.0.100/24;
}
family iso;
family mpls;
}
}
ge-1/3/2 {
vlan-tagging;
encapsulation vlan-ccc;
unit 600 {
encapsulation vlan-ccc;
vlan-id 600;
family ccc;
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.100/32 {
primary;
}
}
family iso {
address 49.0002.0192.0168.0100.00;
}
}
}
user@A1# show protocols
rsvp {
interface ge-1/3/0.0;
interface ge-1/3/1.0;
interface lo0.0;
}
mpls {
interface ge-1/3/0.0;
interface ge-1/3/1.0;
}
isis {
interface ge-1/3/0.0;
interface ge-1/3/1.0;
interface lo0.0;
}
ldp {
interface ge-1/3/0.0;
interface ge-1/3/1.0;
interface lo0.0;
}
l2circuit {
neighbor 192.168.0.101 {
interface ge-1/3/2.600 {
virtual-circuit-id 1;
pseudowire-status-tlv;
backup-neighbor 192.168.0.102 {
virtual-circuit-id 2;
hot-standby;
}
}
}
}
user@A1# show policy-options
policy-statement pplb {
then {
load-balance per-packet;
}
}
user@A1# show routing-options
autonomous-system 64510;
router-id 192.168.0.100;
forwarding-table {
export pplb;
}
设备 PE1
user@PE1# show interfaces
ge-0/1/1 {
unit 0 {
family inet {
address 10.21.0.101/24;
}
family iso;
family mpls;
}
}
ge-0/1/2 {
unit 0 {
family inet {
address 10.31.0.101/24;
}
family iso;
family mpls;
}
}
ge-0/1/3 {
unit 0 {
family inet {
address 10.10.0.101/24;
}
family iso;
family mpls;
}
}
lt-1/2/0 {
unit 600 {
encapsulation vlan-ccc;
vlan-id 600;
peer-unit 601;
}
unit 601 {
encapsulation vlan;
vlan-id 600;
peer-unit 600;
family inet {
filter {
input icmp_inet;
output icmp_inet;
}
address 10.41.0.101/24 {
vrrp-group 0 {
virtual-address 10.41.0.1;
accept-data;
}
}
}
}
}
lo0 {
unit 0 {
family inet {
address 192.168.0.101/32 {
primary;
}
}
family iso {
address 49.0002.0192.0168.0003.00;
}
}
unit 1 {
family inet {
address 192.168.1.101/32;
}
}
}
user@PE1# show firewall
family inet {
filter icmp_inet {
interface-specific;
term 0 {
from {
source-address {
10.41.0.101/32 except;
10.0.0.0/8;
}
protocol icmp;
}
then {
count icmp_inet;
log;
accept;
}
}
term 1 {
then accept;
}
}
}
user@PE1# show protocols
rsvp {
interface ge-0/1/1.0;
interface ge-0/1/2.0;
interface ge-0/1/3.0;
interface lo0.0;
}
mpls {
label-switched-path to_PE3 {
to 192.168.0.103;
}
label-switched-path to_PE2 {
to 192.168.0.102;
}
interface ge-0/1/1.0;
interface ge-0/1/2.0;
interface ge-0/1/3.0;
}
bgp {
local-address 192.168.0.101;
group ibgp {
family inet-vpn {
any;
}
peer-as 64511;
neighbor 192.168.0.102;
neighbor 192.168.0.103;
}
}
isis {
interface ge-0/1/1.0;
interface ge-0/1/2.0;
interface ge-0/1/3.0;
interface lo0.0;
}
ldp {
interface ge-0/1/1.0;
interface ge-0/1/2.0;
interface ge-0/1/3.0;
interface lo0.0;
}
l2circuit {
neighbor 192.168.0.100 {
interface lt-1/2/0.600 {
virtual-circuit-id 1;
pseudowire-status-tlv hot-standby-vc-on;
}
}
}
user@PE1# show policy-options
policy-statement l3vpn_export {
term primary {
from condition primary;
then {
local-preference add 300;
community set l3vpn;
accept;
}
}
term standby {
from condition standby;
then {
local-preference add 30;
community set l3vpn;
accept;
}
}
term default {
then {
community set l3vpn;
accept;
}
}
}
policy-statement l3vpn_import {
term 1 {
from community l3vpn;
then accept;
}
term default {
then reject;
}
}
policy-statement ospf_export {
term 0 {
from community l3vpn;
then accept;
}
}
community l3vpn members target:64511:600;
condition primary {
if-route-exists {
address-family {
ccc {
lt-1/2/0.600;
table mpls.0;
peer-unit 601;
}
}
}
}
condition standby {
if-route-exists {
address-family {
ccc {
lt-1/2/0.600;
table mpls.0;
standby;
peer-unit 601;
}
}
}
}
user@PE1# show routing-options
router-id 192.168.0.101;
autonomous-system 64511;
user@PE1# show routing-instances
l3vpn {
instance-type vrf;
interface lt-1/2/0.601;
interface lo0.1;
route-distinguisher 192.168.1.101:64511;
vrf-import l3vpn_import;
vrf-export l3vpn_export;
vrf-table-label;
protocols {
ospf {
export ospf_export;
area 0.0.0.0 {
interface lt-1/2/0.601;
interface lo0.1;
}
}
}
}
完成设备配置后,请从配置模式进入 commit
。
验证
确认配置工作正常。
检查第 2 层电路
目的
建立第 2 层虚拟电路 (VC) 后,命令的 show l2circuit connections
输出将显示有源和热备用 VC。此外,还显示了热备用 VC 的控制平面详细信息。
行动
在操作模式下,输入 show l2circuit connections extensive
命令。
user@A1> show l2circuit connections extensive Layer-2 Circuit Connections: Legend for connection status (St) EI -- encapsulation invalid NP -- interface h/w not present MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down CM -- control-word mismatch Up -- operational VM -- vlan id mismatch CF -- Call admission control failure OL -- no outgoing label IB -- TDM incompatible bitrate NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration BK -- Backup Connection ST -- Standby Connection CB -- rcvd cell-bundle size bad SP -- Static Pseudowire LD -- local site signaled down RS -- remote site standby RD -- remote site signaled down HS -- Hot-standby Connection XX -- unknown Legend for interface status Up -- operational Dn -- down Neighbor: 192.168.0.101 Interface Type St Time last up # Up trans ge-1/3/2.600(vc 1) rmt Up Jan 24 11:00:26 2013 1 Remote PE: 192.168.0.101, Negotiated control-word: Yes (Null) Incoming label: 299776, Outgoing label: 299776 Negotiated PW status TLV: Yes local PW status code: 0x00000000, Neighbor PW status code: 0x00000000 Local interface: ge-1/3/2.600, Status: Up, Encapsulation: VLAN Connection History: Jan 24 11:00:26 2013 status update timer Jan 24 11:00:26 2013 PE route changed Jan 24 11:00:26 2013 Out lbl Update 299776 Jan 24 11:00:26 2013 In lbl Update 299776 Jan 24 11:00:26 2013 loc intf up ge-1/3/2.600 Neighbor: 192.168.0.102 Interface Type St Time last up # Up trans ge-1/3/2.600(vc 2) rmt HS ----- ---- Remote PE: 192.168.0.102, Negotiated control-word: Yes (Null) Incoming label: 299792, Outgoing label: 299776 Negotiated PW status TLV: Yes local PW status code: 0x00000020, Neighbor PW status code: 0x00000000 Local interface: ge-1/3/2.600, Status: Up, Encapsulation: VLAN user@PE1> show l2circuit connections extensive Layer-2 Circuit Connections: Legend for connection status (St) EI -- encapsulation invalid NP -- interface h/w not present MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down CM -- control-word mismatch Up -- operational VM -- vlan id mismatch CF -- Call admission control failure OL -- no outgoing label IB -- TDM incompatible bitrate NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration BK -- Backup Connection ST -- Standby Connection CB -- rcvd cell-bundle size bad SP -- Static Pseudowire LD -- local site signaled down RS -- remote site standby RD -- remote site signaled down HS -- Hot-standby Connection XX -- unknown Legend for interface status Up -- operational Dn -- down Neighbor: 192.168.0.100 Interface Type St Time last up # Up trans lt-1/2/0.600(vc 1) rmt Up Jan 24 11:06:36 2013 1 Remote PE: 192.168.0.100, Negotiated control-word: Yes (Null) Incoming label: 299776, Outgoing label: 299776 Negotiated PW status TLV: Yes local PW status code: 0x00000000, Neighbor PW status code: 0x00000000 Local interface: lt-1/2/0.600, Status: Up, Encapsulation: VLAN Connection History: Jan 24 11:06:36 2013 status update timer Jan 24 11:06:36 2013 PE route changed Jan 24 11:06:36 2013 Out lbl Update 299776 Jan 24 11:06:36 2013 In lbl Update 299776 Jan 24 11:06:36 2013 loc intf up lt-1/2/0.600 user@PE2> show l2circuit connections extensive Layer-2 Circuit Connections: Legend for connection status (St) EI -- encapsulation invalid NP -- interface h/w not present MM -- mtu mismatch Dn -- down EM -- encapsulation mismatch VC-Dn -- Virtual circuit Down CM -- control-word mismatch Up -- operational VM -- vlan id mismatch CF -- Call admission control failure OL -- no outgoing label IB -- TDM incompatible bitrate NC -- intf encaps not CCC/TCC TM -- TDM misconfiguration BK -- Backup Connection ST -- Standby Connection CB -- rcvd cell-bundle size bad SP -- Static Pseudowire LD -- local site signaled down RS -- remote site standby RD -- remote site signaled down HS -- Hot-standby Connection XX -- unknown Legend for interface status Up -- operational Dn -- down Neighbor: 192.168.0.100 Interface Type St Time last up # Up trans lt-1/2/0.600(vc 2) rmt Up Jan 24 10:55:31 2013 1 Remote PE: 192.168.0.100, Negotiated control-word: Yes (Null) Incoming label: 299776, Outgoing label: 299792 Negotiated PW status TLV: Yes local PW status code: 0x00000000, Neighbor PW status code: 0x00000020 Local interface: lt-1/2/0.600, Status: Up, Encapsulation: VLAN Connection History: Jan 24 10:55:31 2013 status update timer Jan 24 10:55:31 2013 PE route changed Jan 24 10:55:31 2013 Out lbl Update 299792 Jan 24 10:55:31 2013 In lbl Update 299776 Jan 24 10:55:31 2013 loc intf up lt-1/2/0.600
意义
从设备 PE1 和设备 PE2 的角度来看,针对接入路由器建立了单个第 2 层电路,因此命令的 CLI 输出 show l2circuit connections
中没有备用设备信息。请注意,没有为充当热备用的 VC 提供计时和摆动信息。Junos OS 仅允许针对活动 VC 跟踪这些计数器。
检查策略条件
目的
在 PE 设备上,验证作为 L3 VPN 出口策略一部分定义的不同条件的状态,其中 10.41.0.0/24 与逻辑隧道 (y) 子网相对应。
行动
在操作模式下,输入 show policy conditions detail
命令。
user@PE1> show policy conditions detail Configured conditions: Condition primary (static), event: Existence of a route in a specific routing table Dependent routes: 10.41.0.0/24, generation 8 192.168.0.104/32, generation 8 Condition standby (static), event: Existence of a route in a specific routing table Dependent routes: None Condition tables: Table mpls.0, generation 0, dependencies 0, If-route-exists conditions: primary (static) standby (static) Table l3vpn.inet.0, generation 12, dependencies 2
user@PE2> show policy conditions detail Configured conditions: Condition primary (static), event: Existence of a route in a specific routing table Dependent routes: 10.41.0.0/24, generation 18 Condition standby (static), event: Existence of a route in a specific routing table Dependent routes: 10.41.0.0/24, generation 18 Condition tables: Table mpls.0, generation 0, dependencies 0, If-route-exists conditions: primary (static) standby (static) Table l3vpn.inet.0, generation 367, dependencies 2