MCE典型配置
【需求】
路由器MCE經過多實例CE實現×××互通
【組網圖】
【配置腳本-OSPF多實例方式】
MCE配置腳本
#
sysname MCE
#
radius scheme system
#
ip ***-instance ***a /建立***a/
route-distinguisher 100:1 /配置RD,可不用配置RT/
#
ip ***-instance ***b /建立***b/
route-distinguisher 200:1 /配置RD,可不用配置RT/
#
domain system
#
interface Ethernet1/0/0
#
interface Ethernet1/0/0.10
ip binding ***-instance ***a
ip address 192.168.15.2 255.255.255.0
vlan-type dot1q vid 10
#
interface Ethernet1/0/0.20
ip binding ***-instance ***b
ip address 192.168.16.2 255.255.255.0
vlan-type dot1q vid 20
#
interface NULL0
#
interface LoopBack10
ip binding ***-instance ***a
ip address 192.168.16.1 255.255.255.0
#
interface LoopBack20
ip binding ***-instance ***b
ip address 192.168.26.1 255.255.255.0
#
ospf 10 ***-instance ***a
/ospf
進程10
和***a
綁定/
***
-instance-capability simple /
配置路由器成爲多實例CE /
import-route direct
area 0.0.0.0
network 192.168.15.0 0.0.0.255
network 192.168.16.0 0.0.0.255
#
ospf 20 ***-instance ***b
/ospf
進程20
和***b
綁定/
***
-instance-capability simple /
配置路由器成爲多實例CE /
area 0.0.0.0
network 192.168.25.0 0.0.0.255
network 192.168.26.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
RT1配置腳本
#
sysname RT1
#
router id 1.1.1.1
#
mpls lsr-id 1.1.1.1
#
radius scheme system
#
mpls
#
mpls ldp
#
ip ***-instance ***a
route-distinguisher 100:1
***-target 100:1 export-extcommunity
***-target 100:1 import-extcommunity
#
ip ***-instance ***b
route-distinguisher 200:1
***-target 200:1 export-extcommunity
***-target 200:1 import-extcommunity
#
domain system
#
interface Ethernet1/0/0
#
interface Ethernet1/0/0.10
ip binding ***-instance ***a
ip address 192.168.15.1 255.255.255.0
vlan-type dot1q vid 10
#
interface Ethernet1/0/0.20
ip binding ***-instance ***b
ip address 192.168.25.1 255.255.255.0
vlan-type dot1q vid 20
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.0.1 255.255.255.252
mpls
mpls ldp enable
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface LoopBack11
ip binding ***-instance ***a
ip address 192.168.11.1 255.255.255.0
#
interface LoopBack21
ip binding ***-instance ***b
ip address 192.168.21.1 255.255.255.0
#
bgp 100
undo synchronization
group inter internal
peer 2.2.2.2 group inter
peer 2.2.2.2 connect-interface LoopBack0
#
ipv4-family ***-instance ***a
import-route direct
import-route ospf 10 /
引入ospf 10
路由/
undo synchronization
#
ipv4-family ***-instance ***b
import-route direct
import-route ospf 20 /
引入ospf 20
路由/
undo synchronization
#
ipv4-family ***v4
peer inter enable
peer 2.2.2.2 group inter
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.0.0.0 0.0.0.3
network 10.0.0.8 0.0.0.3
#
ospf 10 ***-instance ***a
/ospf
進程10
和***a
綁定/
import-route bgp /
引入BGP
私網路由/
import-route direct
area 0.0.0.0
network 192.168.15.0 0.0.0.255
#
ospf 20 ***-instance ***b
/ospf
進程20
和***b
綁定/
import-route bgp /
引入BGP
私網路由/
import-route direct
area 0.0.0.0
network 192.168.25.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return
注:RT2
、RT3
的配置和普通MPLS/×××
的配置一致,能夠參考前面的典型配置
【配置腳本-靜態路由方式】
MCE配置腳本
#
sysname MCE
#
radius scheme system
#
ip ***-instance ***a /建立***a/
route-distinguisher 100:1 /配置RD,可不用配置RT/
#
ip ***-instance ***b /建立***b/
route-distinguisher 200:1 /配置RD,可不用配置RT/
#
domain system
#
interface Ethernet1/0/0
#
interface Ethernet1/0/0.10 /建立子接口/
ip binding ***-instance ***a /綁定到***a/
ip address 192.168.15.2 255.255.255.0
vlan-type dot1q vid 10
#
interface Ethernet1/0/0.20 /建立子接口/
ip binding ***-instance ***b /綁定到***b/
ip address 192.168.16.2 255.255.255.0
vlan-type dot1q vid 20
#
interface NULL0
#
interface LoopBack10
ip binding ***-instance ***a
ip address 192.168.16.1 255.255.255.0
#
interface LoopBack20
ip binding ***-instance ***b
ip address 192.168.26.1 255.255.255.0
#
ip route-static ***-instance ***a 0.0.0.0 0.0.0.0 192.168.15.1 preference 60
/在***a內建立缺省路由/
ip route-static ***-instance ***b 0.0.0.0 0.0.0.0 192.168.25.1 preference 60
/在***b內建立缺省路由/
#
user-interface con 0
user-interface vty 0 4
#
return
RT1配置腳本
#
sysname RT1
#
router id 1.1.1.1
#
mpls lsr-id 1.1.1.1
#
radius scheme system
#
mpls
#
mpls ldp
#
ip ***-instance ***a
route-distinguisher 100:1
***-target 100:1 export-extcommunity
***-target 100:1 import-extcommunity
#
ip ***-instance ***b
route-distinguisher 200:1
***-target 200:1 export-extcommunity
***-target 200:1 import-extcommunity
#
domain system
#
interface Ethernet1/0/0
#
interface Ethernet1/0/0.10 /建立子接口/
ip binding ***-instance ***a /綁定到***a/
ip address 192.168.15.1 255.255.255.0
vlan-type dot1q vid 10
#
interface Ethernet1/0/0.20 /建立子接口/
ip binding ***-instance ***b /綁定到***b/
ip address 192.168.25.1 255.255.255.0
vlan-type dot1q vid 20
#
interface Serial2/0/0
link-protocol ppp
ip address 10.0.0.1 255.255.255.252
mpls
mpls ldp enable
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface LoopBack11
ip binding ***-instance ***a
ip address 192.168.11.1 255.255.255.0
#
interface LoopBack21
ip binding ***-instance ***b
ip address 192.168.21.1 255.255.255.0
#
bgp 100
undo synchronization
group inter internal
peer 2.2.2.2 group inter
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 group inter
peer 4.4.4.4 connect-interface LoopBack0
#
ipv4-family ***-instance ***a
import-route direct
import-route static /
引入靜態路由/
undo synchronization
#
ipv4-family ***-instance ***b
import-route direct
import-route static /
引入靜態路由/
undo synchronization
#
ipv4-family ***v4
peer inter enable
peer 2.2.2.2 group inter
peer 4.4.4.4 group inter
#
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 10.0.0.0 0.0.0.3
network 10.0.0.8 0.0.0.3
#
ip route-static ***-instance ***a 192.168.16.0 255.255.255.0 192.168.15.2 pref
erence
60 /
在***a
內建立靜態路由/
ip route-static ***-instance ***b 192.168.26.0 255.255.255.0 192.168.25.2 pref
erence
60 /
在***b
內建立靜態路由/
#
user-interface con 0
user-interface vty 0 4
#
return
注:RT2
、RT3
的配置和普通MPLS/×××
的配置一致,能夠參考前面的典型配置
【驗證】
在MCE中***a、***b均可以學習到私網路由,並能夠ping通
[MCE]disp ip rout ***-instance ***a
***a Route Information
Routing Table: ***a Route-Distinguisher: 100:1
Destination/Mask Protocol Pre Cost Nexthop Interface
192.168.11.0/24 O_ASE 150 1 192.168.15.1 Ethernet1/0/0.10
192.168.12.0/24 O_ASE 150 1 192.168.15.1 Ethernet1/0/0.10
192.168.13.0/24 O_ASE 150 1 192.168.15.1 Ethernet1/0/0.10
192.168.15.0/24 DIRECT 0 0 192.168.15.2 Ethernet1/0/0.10
192.168.15.2/32 DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.16.0/24 DIRECT 0 0 192.168.16.1 LoopBack10
192.168.16.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
[MCE]
【提示】
一、 使用OSPF方式,須要在PE1上進行OSPF和BGP路由的相互引入,來實現路由的互通
二、 建立***的VRF只是爲了將接口和OSPF進程綁定到對應的***,所以能夠不用配置RT