企业站点间后门链路是低速率链路,用于冗余使用,主链路通过ISP主干网(MP-BGP)进行通信
1. 配置公网IP地址[R1]配置命令参考 # isis 1 is-level level-2 network-entity 49.0000.0000.0000.0001.00 is-name R1 # interface GigabitEthernet0/0/1 ip address 12.0.0.1 255.255.255.0 isis enable 1 # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 isis enable 1 [R2]配置命令参考 # isis 1 is-level level-2 network-entity 49.0000.0000.0000.0002.00 is-name R2 # interface GigabitEthernet0/0/0 ip address 12.0.0.2 255.255.255.0 isis enable 1 # interface GigabitEthernet0/0/1 ip address 23.0.0.2 255.255.255.0 isis enable 1 # interface LoopBack0 ip address 2.2.2.2 255.255.255.255 isis enable 1 # [R3]配置命令参考 # isis 1 is-level level-2 network-entity 49.0000.0000.0000.0003.00 is-name R3 # interface GigabitEthernet0/0/1 ip address 23.0.0.3 255.255.255.0 isis enable 1 # interface LoopBack0 ip address 3.3.3.3 255.255.255.255 isis enable 1 #1.1 配置MPLS LDP
[R1]mpls lsr-id 1.1.1.1 [R1]mpls [R1-mpls]q [R1]mpls ldp [R1-GigabitEthernet0/0/1]mpls [R1-GigabitEthernet0/0/1]mpls ldp [R2]mpls lsr-id 2.2.2.2 [R2]mpls [R2-mpls]mpls ldp [R2-mpls-ldp]q [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]mpls ldp [R2-GigabitEthernet0/0/0]mpls [R2-GigabitEthernet0/0/1]mpls [R2-GigabitEthernet0/0/1]mpls ldp [R3]mpls lsr-id 3.3.3.3 [R3]mpls [R3]mpls ldp [R3-GigabitEthernet0/0/1]mpls [R3-GigabitEthernet0/0/1]mpls ldp2. 配置MP-BGP R1配置命令参考
ip vpn-instance 1 ipv4-family route-distinguisher 1:4 vpn-target 100:300 export-extcommunity vpn-target 300:100 import-extcommunity bgp 123 peer 3.3.3.3 as-number 123 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization undo peer 3.3.3.3 enable # ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable ipv4-family vpn-instance 1R3配置命令参考
ip vpn-instance 1 ipv4-family route-distinguisher 3:5 vpn-target 300:100 export-extcommunity vpn-target 100:300 import-extcommunity bgp 123 peer 1.1.1.1 as-number 123 peer 1.1.1.1 connect-interface LoopBack0 # ipv4-family unicast undo synchronization undo peer 1.1.1.1 enable # ipv4-family vpnv4 policy vpn-target peer 1.1.1.1 enable # ipv4-family vpn-instance 13. PE 与 CE设备配置OSPF(PE上做双向引入) R1配置命令参考
R1: ospf 1 router-id 1.1.1.1 vpn-instance 1 import-route bgp area 0.0.0.0 interface GigabitEthernet0/0/0 ip binding vpn-instance 1 ip address 192.168.14.1 255.255.255.0 ospf enable 1 area 0.0.0.0 bgp 123 peer 3.3.3.3 as-number 123 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization import-route ospf 1 undo peer 3.3.3.3 enable # ipv4-family vpnv4 policy vpn-target peer 3.3.3.3 enable # ipv4-family vpn-instance 1 import-route ospf 1 #R4配置命令参考
ospf 1 router-id 4.4.4.4 area 0.0.0.0 interface GigabitEthernet0/0/0 ip address 192.168.14.4 255.255.255.0 ospf enable 1 area 0.0.0.0 interface LoopBack0 ip address 4.4.4.4 255.255.255.255 ospf enable 1 area 0.0.0.0R3、R5自行配置 查看R4的ospf的lsdb
[R4]dis ospf lsdb OSPF Process 1 with Router ID 4.4.4.4 link State Database Area: 0.0.0.0 Type linkState ID AdvRouter Age Len Sequence Metric Router 4.4.4.4 4.4.4.4 1021 48 80000005 1 Router 1.1.1.1 1.1.1.1 1413 36 80000003 1 Network 192.168.14.4 4.4.4.4 1412 32 80000001 0 Sum-Net 5.5.5.5 1.1.1.1 342 28 80000001 2
可以看出 5.5.5.5路由条目是3类LSA,
若R4、R5后门链路启用ospf,会生成1类5.5.5.5的LSA,
由于1类LSA优先级高于3类LSA,R4优选后门链路与R5通信,
如何如何使得R4优选主干链路与R5通信,后门链路冗余备份,
这里使用sham-link(伪链路)解决,思考:还有其他方法解决吗?自行实验测试
4.配置sham-link R1配置命令参考(R3同理自行配置)interface LoopBack10
ip binding vpn-instance 1 //绑定实例1中
ip address 10.1.1.1 255.255.255.255
bgp 123
ipv4-family vpn-instance 1
network 10.1.1.1 255.255.255.255 //通告路由
ospf 1 router-id 1.1.1.1 vpn-instance 1
area 0.0.0.0
sham-link 10.1.1.1 10.3.3.3 cost 1 //创建伪连接 ,注意cost值应小于后门链路的cost
查看R4上的LSDB
其中1类LSA是sham-link传递的
三类LSA是R3引入ospf传递的
练习 关掉R1、R3之间的sham-link 直接在R4、R5之间启用sham-link 会得到相同的效果吗,自行实验


