IDC-LKT-Backbone#show mpls ldp neighbor Peer LDP Ident: 10.0.0.4:0; Local LDP Ident 10.0.0.1:0 TCP connection: 10.0.0.4.16043 - 10.0.0.1.646 State: Oper; Msgs sent/rcvd: 175/179; Downstream Up time: 02:25:20 LDP discovery sources: GigabitEthernet1, Src IP addr: 100.64.0.1 Addresses bound to peer LDP Ident: 10.0.0.4 100.64.0.1 202.97.1.2 Peer LDP Ident: 10.0.0.3:0; Local LDP Ident 10.0.0.1:0 TCP connection: 10.0.0.3.57153 - 10.0.0.1.646 State: Oper; Msgs sent/rcvd: 971/850; Downstream Up time: 02:20:36 LDP discovery sources: GigabitEthernet6, Src IP addr: 172.16.36.2 Addresses bound to peer LDP Ident: 172.16.36.2 Peer LDP Ident: 10.0.0.2:0; Local LDP Ident 10.0.0.1:0 TCP connection: 10.0.0.2.59507 - 10.0.0.1.646 State: Oper; Msgs sent/rcvd: 28/24; Downstream Up time: 00:03:56 LDP discovery sources: GigabitEthernet5, Src IP addr: 172.16.37.2 Addresses bound to peer LDP Ident: 172.16.37.2 10.0.0.2
1 2 3 4 5 6
IDC-LKT-Backbone#show mpls forwarding-table Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or Tunnel Id Switched interface 16 Pop Label 10.0.0.2/32 0 Gi5 172.16.37.2 17 Pop Label 10.0.0.4/32 0 Gi1 100.64.0.1 30 Pop Label 10.0.0.3/32 0 Gi6 172.16.36.2
1 2 3 4 5 6
IDC-LKT-Backbone#show mpls forwarding-table Local Outgoing Prefix Bytes Label Outgoing Next Hop Label Label or Tunnel Id Switched interface 16 Pop Label 10.0.0.2/32 0 Gi5 172.16.37.2 17 Pop Label 10.0.0.4/32 0 Gi1 100.64.0.1 30 Pop Label 10.0.0.3/32 0 Gi6 172.16.36.2
policy-options { policy-statement SERVICE:IPT:CN:EXPORT { term add-community-v4 { // 将 Premium 客户的网段宣告进 MP-BGP 协议中 from { protocol [ direct static ]; route-filter 192.0.1.0/24 exact; } then { community add internal-routes; } } term vrf-export { then { community add service:ipt:cn; // 如果从 VRF 导出,则携带该 ext-community 属性,上游收到后会将其放入对应的路由包内 accept; } } term last { then reject; } } policy-statement SERVICE:IPT:CN:IMPORT { term vrf-import { from community service:ipt:cn; // 导入路由器发过来的对应路由包的路由(携带该 ext-community 的路由) then accept; } term last { then reject; } } policy-statement SERVICE:IPT:INTL:EXPORT { term add-community-v4 { // 将 Standard 客户的网段宣告进 MP-BGP 协议中 from { protocol [ direct static ]; route-filter 192.0.2.0/24 exact; } then { community add internal-routes; } } term vrf-export { then { community add service:ipt:intl; // 如果从 VRF 导出,则携带该 ext-community 属性,上游收到后会将其放入对应的路由包内 accept; } } term last { then reject; } } policy-statement SERVICE:IPT:INTL:IMPORT { term vrf-import { from community service:ipt:intl; // 导入路由器发过来的对应路由包的路由(携带该 ext-community 的路由) then accept; } term last { then reject; } } community customer-routes members 65001:10001; // standard community, TE 用 community internal-routes members 65001:10000; // standard community, TE 用 community service:ipt:cn members target:65000:1000; // extend community,区分 VRF 路由用 community service:ipt:intl members target:65000:1001; // extend community,区分 VRF 路由用 }
IDC-LKT-Backbone#show ip route vrf IPT:PREMIUM:INTL:HK Routing Table: IPT:PREMIUM:INTL:HK
B* 0.0.0.0/0 [20/0], 21:38:31, Null0 1.0.0.0/24 is subnetted, 1 subnets B 1.2.4.0 [20/0] via 62.0.0.1, 21:38:32 8.0.0.0/32 is subnetted, 2 subnets B 8.8.4.4 [20/0] via 62.0.0.1, 21:38:32 B 8.8.8.8 [20/0] via 62.0.0.1, 21:38:32 114.0.0.0/24 is subnetted, 1 subnets B 114.114.114.0 [20/0] via 62.0.0.1, 21:38:32 B 192.0.1.0/24 [200/0] via 10.0.0.3, 21:34:06 B 192.0.2.0/24 [200/0] via 10.0.0.3, 21:34:06 B 192.0.3.0/24 [200/0] via 10.0.0.2, 19:17:15 B 192.0.4.0/24 [200/0] via 10.0.0.2, 19:17:15 IDC-LKT-Backbone#show ip route vrf IPT:PREMIUM:CTG:HK BGP Routing Table: IPT:PREMIUM:CTG:HK
B* 0.0.0.0/0 [20/0], 21:38:40, Null0 1.0.0.0/24 is subnetted, 1 subnets B 1.2.4.0 [20/0] via 59.43.0.1, 21:38:41 114.0.0.0/24 is subnetted, 1 subnets B 114.114.114.0 [20/0] via 59.43.0.1, 21:38:41 B 192.0.1.0/24 [200/0] via 10.0.0.3, 21:34:15 B 192.0.2.0/24 [200/0] via 10.0.0.3, 21:34:15 IDC-LKT-Backbone#show ip route vrf IXP:HKIX:HK BGP Routing Table: IXP:HKIX:HK
B* 0.0.0.0/0 [20/0], 21:38:51, Null0 8.0.0.0/32 is subnetted, 2 subnets B 8.8.4.4 [20/0] via 125.0.0.3, 14:46:20 B 8.8.8.8 [20/0] via 125.0.0.3, 14:46:20 B 192.0.1.0/24 [200/0] via 10.0.0.3, 21:34:26 B 192.0.2.0/24 [200/0] via 10.0.0.3, 21:34:26 IDC-LKT-Backbone#show ip route vrf SERVICE:IPT:CN Routing Table: SERVICE:IPT:CN
S* 0.0.0.0/0 is directly connected, Null0 1.0.0.0/24 is subnetted, 1 subnets B 1.2.4.0 [20/0] via 59.43.0.1 (IPT:PREMIUM:CTG:HK), 21:39:20 8.0.0.0/32 is subnetted, 2 subnets B 8.8.4.4 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:20 B 8.8.8.8 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:20 114.0.0.0/24 is subnetted, 1 subnets B 114.114.114.0 [20/0] via 59.43.0.1 (IPT:PREMIUM:CTG:HK), 21:39:20 B 192.0.1.0/24 [200/0] via 10.0.0.3, 21:34:55 B 192.0.2.0/24 [200/0] via 10.0.0.3, 21:34:55 IDC-LKT-Backbone#show ip route vrf SERVICE:IPT:INTL Routing Table: SERVICE:IPT:INTL
S* 0.0.0.0/0 is directly connected, Null0 1.0.0.0/24 is subnetted, 1 subnets B 1.2.4.0 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:24 8.0.0.0/32 is subnetted, 2 subnets B 8.8.4.4 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:24 B 8.8.8.8 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:24 114.0.0.0/24 is subnetted, 1 subnets B 114.114.114.0 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 21:39:24 B 192.0.1.0/24 [200/0] via 10.0.0.3, 21:34:59 B 192.0.2.0/24 [200/0] via 10.0.0.3, 21:34:59
root@IDC-LKT-RE> show route table SERVICE-IPT-CN.inet.0
SERVICE-IPT-CN.inet.0: 5 destinations, 5 routes (5 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[BGP/170] 21:38:09, MED 0, localpref 100, from 10.0.0.1 AS path: I, validation-state: unverified > to 172.16.36.1 via xe-0/0/6.0, Push 28 192.0.1.0/24 *[Direct/0] 21:38:53 > via xe-0/0/0.0 192.0.1.1/32 *[Local/0] 21:38:53 Local via xe-0/0/0.0
{master:0} root@IDC-LKT-RE> show route table SERVICE-IPT-INTL.inet.0
SERVICE-IPT-INTL.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden) + = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[BGP/170] 21:38:19, MED 0, localpref 100, from 10.0.0.1 AS path: I, validation-state: unverified > to 172.16.36.1 via xe-0/0/6.0, Push 29 192.0.2.0/24 *[Direct/0] 21:39:03 > via xe-0/0/1.0 192.0.2.1/32 *[Local/0] 21:39:03 Local via xe-0/0/1.0
配置 TKO 机房的路由器,使 TKO 与 LKT 机房建立三层互联,建立 TKO 机柜后,基于业务上的需求,我们希望 Premium 客户能直接通过 Local-loop 实现跨机房内网互通,实现高质量的连接效果,而 Standard 客户则通过 Transit 互通,不允许使用 Local-loop 进行传输。我们则需要进行以下的配置:
interface GigabitEthernet3 ip vrf forwarding SERVICE:IPT:CN ip address 192.0.0.1 255.255.255.0 negotiation auto no mop enabled no mop sysid // 绑定客户服务接口进 VRF instance
ip route vrf SERVICE:IPT:CN 0.0.0.0 0.0.0.0 202.97.1.1 global // 默认路由指向 Transit (基于业务要求,只允许使用本地的 Transit)
ip prefix-list export-local seq 5 permit 192.0.0.0/24 route-map export-local permit 100 match ip address prefix-list export-local // 控制 VRF Export map,导出路由至 Global 路由表
ip vrf SERVICE:IPT:CN route-target import 65000:1002 // Premium 路由包导入 TKO 机房的客户路由包的路由即可
配置完毕,我们来检查一下路由表:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
IDC-LKT-Backbone#show ip route vrf SERVICE:IPT:CN Routing Table: SERVICE:IPT:CN
S* 0.0.0.0/0 is directly connected, Null0 1.0.0.0/24 is subnetted, 1 subnets B 1.2.4.0 [20/0] via 59.43.0.1 (IPT:PREMIUM:CTG:HK), 1d01h 8.0.0.0/32 is subnetted, 2 subnets B 8.8.4.4 [20/0] via 62.0.0.1 (IPT:PREMIUM:INTL:HK), 1d01h B 8.8.8.8 [20/0] via 125.0.0.3 (IXP:HKIX:HK), 00:40:34 114.0.0.0/24 is subnetted, 1 subnets B 114.114.114.0 [20/0] via 59.43.0.1 (IPT:PREMIUM:CTG:HK), 1d01h B 192.0.0.0/24 [200/0] via 10.0.0.4, 1d01h // 已经收到来自 TKO 机房的路由 B 192.0.1.0/24 [200/0] via 10.0.0.3, 1d01h B 192.0.2.0/24 [200/0] via 10.0.0.3, 1d01h B 192.0.3.0/24 [200/0] via 10.0.0.2, 22:44:53 B 192.0.4.0/24 [200/0] via 10.0.0.2, 22:44:53
1 2 3 4 5 6 7 8
IDC-TKO-Backbone#show ip route vrf SERVICE:IPT:CN Routing Table: SERVICE:IPT:CN
S* 0.0.0.0/0 [1/0] via 202.97.1.1 192.0.0.0/24 is variably subnetted, 2 subnets, 2 masks C 192.0.0.0/24 is directly connected, GigabitEthernet3 L 192.0.0.1/32 is directly connected, GigabitEthernet3 // 已经收到来自 LKT 机房 Premium 路由包的客户路由 B 192.0.1.0/24 [200/0] via 10.0.0.3, 1d01h
acl number 2000 rule 5 permit source 192.0.4.0 0.0.0.255 // 建立 ACL 列表,匹配要使用 Standard 路由包的 IP 段 # traffic classifier std operator and if-match acl 2000 // 定义 traffic classifier # traffic behavior std redirect vpn-instance SERVICE:IPT:INTL // 定义动作,动作为使用 Standard 路由包转发 # traffic policy std match-extended classifier std behavior std precedence 5 // 定义规则链,当匹配到来源于 192.0.4.0/24 这个段的数据包时,使用 Standard 路由包进行转发
interface GigabitEthernet0/0/0 ip binding vpn-instance SERVICE:IPT:CN // 绑定客户接口到 Premium VRF instance ip address 192.0.3.1 255.255.255.0 ip address 192.0.4.1 255.255.255.0 sub traffic-policy std inbound // 在客户接口应用预定好的流量规则,将源为 Standard IP 段的流量重定向到 Standard 路由包内
那么我们现在配置完毕了,检查一下路由器的路由表吧!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<Transit-Router-HW>display ip routing-table vpn-instance SERVICE:IPT:CN protocol bgp Route Flags: R - relay, D - download to fib, T - to vpn-instance ------------------------------------------------------------------------------
Destination/Mask Proto Pre Cost Flags NextHop Interface
<Transit-Router-HW>display ip routing-table vpn-instance SERVICE:IPT:INTL protocol bgp Route Flags: R - relay, D - download to fib, T - to vpn-instance ------------------------------------------------------------------------------
Destination/Mask Proto Pre Cost Flags NextHop Interface