MPLS- ***的實驗配置

最近複習BGP有點High,網上有些配置都寫錯了,搞得很鬱悶,經過不斷的百度和show,終於搞定了,拓撲圖如下:

本次的PE-P-PE之間的IGP協議爲OSPF,1的PC-CE跑RIPv2(R1-R2)和OSPF(R4-R5)協議,2的PC-CE跑EIGRP(R6-R2)和靜態路由(R4-R7)協議


微信截圖_201810231717233.jpgspacer.gif

R1配置如下:----------------------------------------------------------------------------

ip cef

!

interface Loopback1

ip address 172.30.1.1 255.255.255.255

!

interface FastEthernet0/0

ip address 192.168.15.10 255.255.255.0

no shut

!

router rip

version 2

network 172.30.0.0

network 192.168.15.0

no auto-summary

R2配置如下:--------------------------------------------------------------------------------------

ip cef

!

no ip domain lookup

ip vrf ***1

rd 100:1

route-target export 100:1

route-target import 100:1

!

ip vrf ***2

rd 200:2

route-target export 200:2

route-target import 200:2

!

interface Loopback1

ip address 172.11.11.1 255.255.255.255

!

interface FastEthernet0/0

ip address 10.100.1.1 255.255.255.252

duplex auto

speed auto

mpls label protocol ldp

mpls ip

!

interface FastEthernet1/0

ip vrf forwarding ***1

ip address 192.168.15.1 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet1/1

ip vrf forwarding ***2

ip address 192.168.16.1 255.255.255.0

duplex auto

speed auto

!

router eigrp 1 1

no auto-summary

!

address-family ipv4 vrf ***2

redistribute bgp 65500 metric 100000 10 255 1 1500 1

network 192.168.16.0

no auto-summary

autonomous-system 1

exit-address-family

!

router ospf 1

log-adjacency-changes

network 10.100.1.0 0.0.0.3 area 0

network 172.11.11.1 0.0.0.0 area 0

!

router rip

version 2

no auto-summary

!

address-family ipv4 vrf ***1

redistribute bgp 65500 metric 10

network 192.168.15.0

no auto-summary

exit-address-family

!

router bgp 65500

no synchronization

bgp log-neighbor-changes

neighbor 172.12.12.4 remote-as 65500

neighbor 172.12.12.4 update-source Loopback1

no auto-summary

!

address-family ***v4

neighbor 172.12.12.4 activate

neighbor 172.12.12.4 send-community both

neighbor 172.12.12.4 next-hop-self

exit-address-family

!

address-family ipv4 vrf ***2

redistribute eigrp 1

no synchronization

exit-address-family

!

address-family ipv4 vrf ***1

redistribute rip

no synchronization

exit-address-family

R3配置如下:------------------------------------------------------------------------------------------------------------

ip cef

!

interface Loopback1

ip address 172.12.12.1 255.255.255.255

!

interface FastEthernet0/0

ip address 10.100.1.2 255.255.255.252

no shut

mpls ip

!

interface FastEthernet0/1

ip address 10.12.1.1 255.255.255.0

no shut

mpls ip

!

router ospf 1

log-adjacency-changes

network 10.12.1.0 0.0.0.255 area 0

network 10.100.1.0 0.0.0.3 area 0

network 172.12.12.1 0.0.0.0 area 0

R4配置:--------------------------------------------------------------------------------------------------

ip cef

!

ip vrf ***1

rd 100:1

route-target export 100:1

route-target import 100:1

!

ip vrf ***2

rd 200:2

route-target export 200:2

route-target import 200:2

!

interface Loopback11

ip address 172.12.12.4 255.255.255.255

!

interface FastEthernet0/0

ip address 10.12.1.2 255.255.255.0

no shut

mpls ip

!

interface FastEthernet1/0

ip vrf forwarding ***2

ip address 192.168.17.1 255.255.255.0

no shut

!

interface FastEthernet1/1

ip vrf forwarding ***1

ip address 192.168.18.1 255.255.255.0

no shut

!

router ospf 1 vrf ***1

log-adjacency-changes

redistribute bgp 65500 subnets

network 192.168.18.0 0.0.0.255 area 0

!

router ospf 11

log-adjacency-changes

network 10.12.1.0 0.0.0.255 area 0

network 172.12.12.4 0.0.0.0 area 0

!



!

router bgp 65500

no synchronization

bgp log-neighbor-changes

neighbor 172.11.11.1 remote-as 65500

neighbor 172.11.11.1 update-source Loopback11

no auto-summary

!

address-family ***v4

neighbor 172.11.11.1 activate

neighbor 172.11.11.1 send-community both

neighbor 172.11.11.1 next-hop-self

exit-address-family

!

address-family ipv4 vrf ***2

redistribute connected

redistribute static

no synchronization

exit-address-family

!

address-family ipv4 vrf ***1

redistribute ospf 1 vrf ***1

no synchronization

exit-address-family

!

ip forward-protocol nd

ip route vrf ***2 172.16.7.7 255.255.255.255 192.168.17.10

R5配置:------------------------------------------------------------------------------------------------------------------

ip cef

!

interface Loopback1

ip address 172.30.5.5 255.255.255.255

!

interface FastEthernet0/0

ip address 192.168.18.10 255.255.255.0

no shut

!

router ospf 1

log-adjacency-changes

network 172.30.5.5 0.0.0.0 area 0

network 192.168.18.0 0.0.0.255 area 0

!


R6配置:------------------------------------------------------------------------------------------------------------------

interface Loopback1

ip address 172.16.6.6 255.255.255.255

!

interface FastEthernet0/0

ip address 192.168.16.10 255.255.255.0

no shut

!

router eigrp 1

network 172.16.6.6 0.0.0.0

network 192.168.16.0

no auto-summary

R7配置:------------------------------------------------------------------------------------------------------------------

interface Loopback1

ip address 172.16.7.7 255.255.255.255

!

interface FastEthernet0/0

ip address 192.168.17.10 255.255.255.0

no shut

!

ip route 0.0.0.0 0.0.0.0 192.168.17.1

路由表信息如下:

R1上的路由表如下:

R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


C    192.168.15.0/24 is directly connected, FastEthernet0/0

     172.30.0.0/32 is subnetted, 2 subnets

R       172.30.5.5 [120/10] via 192.168.15.1, 00:00:25, FastEthernet0/0

C       172.30.1.1 is directly connected, Loopback1

R    192.168.18.0/24 [120/10] via 192.168.15.1, 00:00:25, FastEthernet0/0


R2的路由表:----------------------------------------------------------------------------

R2#sh ip route vrf ***1


Routing Table: ***1

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


C    192.168.15.0/24 is directly connected, FastEthernet1/0

172.30.0.0/32 is subnetted, 2 subnets

B       172.30.5.5 [200/200] via 172.12.12.4, 01:55:40

R       172.30.1.1 [120/1] via 192.168.15.10, 00:00:05, FastEthernet1/0

B    192.168.18.0/24 [200/0] via 172.12.12.4, 02:09:40

R2#sh ip route vrf ***2


Routing Table: ***2

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


172.16.0.0/32 is subnetted, 2 subnets

B       172.16.7.7 [200/156160] via 172.12.12.4, 00:10:47

D       172.16.6.6 [90/156160] via 192.168.16.10, 00:41:03, FastEthernet1/1

B    192.168.17.0/24 [200/0] via 172.12.12.4, 00:10:47

C    192.168.16.0/24 is directly connected, FastEthernet1/1

R5上的路由表如下

R5#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


O E2 192.168.15.0/24 [110/1] via 192.168.18.1, 13:51:58, FastEthernet0/0

172.30.0.0/32 is subnetted, 2 subnets

C       172.30.5.5 is directly connected, Loopback1

O E2    172.30.1.1 [110/1] via 192.168.18.1, 13:51:58, FastEthernet0/0

C    192.168.18.0/24 is directly connected, FastEthernet0/0

R6的路由表如下:-------------------------------------------------------------------------------------------------

R6#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is not set


172.16.0.0/32 is subnetted, 2 subnets

D       172.16.7.7 [90/158720] via 192.168.16.1, 14:35:03, FastEthernet0/0

C       172.16.6.6 is directly connected, Loopback1

D    192.168.17.0/24 [90/30720] via 192.168.16.1, 14:35:03, FastEthernet0/0

C    192.168.16.0/24 is directly connected, FastEthernet0/0

R7的路由表如下:

R7#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route


Gateway of last resort is 192.168.17.1 to network 0.0.0.0


172.16.0.0/32 is subnetted, 1 subnets

C       172.16.7.7 is directly connected, Loopback1

C    192.168.17.0/24 is directly connected, FastEthernet0/0

S*   0.0.0.0/0 [1/0] via 192.168.17.1


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章