В сети настроены MPLS и OSPF. MPLS настроен во всей сети, кроме соединения между R7 и R1.
Между маршрутизаторами R1-R2-R3-R4-R5-R6 трафик должен передаваться силами MPLS.
В сети также настроен BGP, который работает между R1 и R6.
Для маршрутов BGP не генерируются метки.
Для того чтобы R1 мог добраться до маршрутов, которые получены по BGP от R6, пакеты передаются средствами MPLS до IP-адреса, который указан как next-hop в маршрутах BGP.
Сейчас с R7 недоступен маршрут, который анонсируется по BGP маршрутизатором R6.
Задание: Восстановить работу сети, чтобы с R7 пинговался адрес 100.0.0.1.
Ограничения: Нельзя менять настройки BGP.
Схема: К схеме статьи добавлен маршрутизатор R7, который используется в качестве клиента. Соответственно MPLS между R7 и R1 не включен.
Конфигурация маршрутизаторов: Маршрутизатор R1:
hostname R1
!
ip cef
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
description to R2
ip address 10.0.12.1 255.255.255.0
mpls ip
!
interface FastEthernet0/1
description to R3
ip address 10.0.13.1 255.255.255.0
mpls ip
!
interface FastEthernet1/0
ip address 10.0.17.1 255.255.255.0
!
router ospf 1
network 1.1.1.1 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
!
router bgp 100
bgp log-neighbor-changes
neighbor 172.16.6.1 remote-as 100
neighbor 172.16.6.1 update-source Loopback0
!
mpls ldp router-id Loopback0 force
Маршрутизатор R2:
hostname R2
!
ip cef
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
description to R5
ip address 10.0.25.2 255.255.255.0
mpls ip
!
interface FastEthernet0/1
description to R1
ip address 10.0.12.2 255.255.255.0
mpls ip
!
router ospf 1
network 2.2.2.2 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
!
mpls ldp router-id Loopback0 force
Маршрутизатор R3:
hostname R3
!
ip cef
!
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
description to R1
ip address 10.0.13.3 255.255.255.0
mpls ip
!
interface FastEthernet0/1
description to R4
ip address 10.0.34.3 255.255.255.0
mpls ip
!
router ospf 1
network 3.3.3.3 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
!
mpls ldp router-id Loopback0 force
Маршрутизатор R4:
hostname R4
!
ip cef
!
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface FastEthernet0/0
description to R3
ip address 10.0.34.4 255.255.255.0
mpls ip
!
interface FastEthernet0/1
description to R5
ip address 10.0.45.4 255.255.255.0
mpls ip
!
router ospf 1
network 4.4.4.4 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
!
mpls ldp router-id Loopback0 force
Маршрутизатор R5:
hostname R5
!
ip cef
!
!
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface Loopback100
no ip address
!
interface FastEthernet0/0
description to R4
ip address 10.0.45.5 255.255.255.0
mpls ip
!
interface FastEthernet0/1
description to R2
ip address 10.0.25.5 255.255.255.0
mpls ip
!
interface FastEthernet1/0
description to R6
ip address 172.16.56.5 255.255.255.0
mpls ip
!
!
router ospf 1
area 172 range 172.16.0.0 255.255.0.0
network 5.5.5.5 0.0.0.0 area 0
network 10.0.0.0 0.0.255.255 area 0
network 172.16.0.0 0.0.255.255 area 172
!
mpls ldp router-id Loopback0 force
Маршрутизатор R6:
hostname R6
!
ip cef
!
interface Loopback1
ip address 100.0.0.1 255.255.255.255
!
interface Loopback172
ip address 172.16.6.1 255.255.255.255
!
interface FastEthernet0/0
description to R5
ip address 172.16.56.6 255.255.255.0
mpls ip
!
router ospf 1
network 172.16.0.0 0.0.255.255 area 172
!
router bgp 100
bgp log-neighbor-changes
network 100.0.0.0 mask 255.255.0.0
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback172
!
ip route 100.0.0.0 255.255.0.0 Null0
!
mpls ldp router-id Loopback0 force
Маршрутизатор R7:
hostname R7
!
interface FastEthernet0/0
ip address 10.0.17.7 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.17.1
Дополнительная информация:
R7#traceroute 172.16.6.1
Type escape sequence to abort.
Tracing the route to 172.16.6.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.0.17.1 5 msec 4 msec 4 msec
2 10.0.12.2 [MPLS: Label 29 Exp 0] 4 msec 5 msec 5 msec
3 10.0.25.5 4 msec 4 msec 5 msec
4 172.16.56.6 4 msec * 1 msec
R1#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 3.3.3.3/32 0 Fa0/1 10.0.13.3
17 Pop Label 10.0.34.0/24 0 Fa0/1 10.0.13.3
18 16 5.5.5.5/32 0 Fa0/0 10.0.12.2
19 Pop Label 2.2.2.2/32 0 Fa0/0 10.0.12.2
20 17 10.0.45.0/24 0 Fa0/0 10.0.12.2
23 10.0.45.0/24 0 Fa0/1 10.0.13.3
21 Pop Label 10.0.25.0/24 0 Fa0/0 10.0.12.2
22 18 172.16.0.0/16 0 Fa0/0 10.0.12.2
23 20 4.4.4.4/32 0 Fa0/1 10.0.13.3
R1#sh ip bgp
BGP table version is 8, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*>i 100.0.0.0/16 172.16.6.1 0 100 0 i
R1#sh ip bgp summary
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.16.6.1 4 100 20 18 8 0 0 00:13:15 1
R1#sh ip route
Codes: L - local, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/11] via 10.0.12.2, 00:47:14, FastEthernFa0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 10.0.13.3, 00:47:45, FastEthernFa0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/21] via 10.0.13.3, 00:46:59, FastEthernFa0/1
5.0.0.0/32 is subnetted, 1 subnets
O 5.5.5.5 [110/21] via 10.0.12.2, 00:18:05, FastEthernFa0/0
10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C 10.0.12.0/24 is directly connected, FastEthernFa0/0
L 10.0.12.1/32 is directly connected, FastEthernFa0/0
C 10.0.13.0/24 is directly connected, FastEthernFa0/1
L 10.0.13.1/32 is directly connected, FastEthernFa0/1
C 10.0.17.0/24 is directly connected, FastEthernFa0/2
L 10.0.17.1/32 is directly connected, FastEthernFa0/2
O 10.0.25.0/24 [110/20] via 10.0.12.2, 00:47:14, FastEthernFa0/0
O 10.0.34.0/24 [110/20] via 10.0.13.3, 00:47:09, FastEthernFa0/1
O 10.0.45.0/24 [110/30] via 10.0.13.3, 00:18:15, FastEthernFa0/1
[110/30] via 10.0.12.2, 00:18:05, FastEthernFa0/0
100.0.0.0/16 is subnetted, 1 subnets
B 100.0.0.0 [200/0] via 172.16.6.1, 00:17:15
O IA 172.16.0.0/16 [110/30] via 10.0.12.2, 00:18:05, FastEthernFa0/0
R1#
R1#sh ip cef 100.0.0.0 internal
100.0.0.0/16, epoch 0, flags rib only nolabel, rib defined all labels, RIB[B], refcount 5, per-destination sharing
sources: RIB
feature space:
IPRM: 0x00018000
ifnums:
FastEthernet0/0(3): 10.0.12.2
path F2785D28, path list F28FB924, share 1/1, type recursive, for IPv4
recursive via 172.16.6.1[IPv4:Default], fib F282A7E4, 1 terminal fib, v4:Default:172.16.0.0/16
path F2785E78, path list F28FB974, share 1/1, type recursive, for IPv4, flags doesnt-source-via, cef-internal
recursive via 172.16.0.0/16<nh:172.16.6.1>[IPv4:Default], fib F282A550, 1 terminal fib, v4:Default:172.16.0.0/16
path F2785F58, path list F24EBC6C, share 1/1, type attached nexthop, for IPv4
MPLS short path extensions: MOI flags = 0x0 label 18
nexthop 10.0.12.2 FastEthernet0/0 label 18, adjacency IP adj out of FastEthernet0/0, addr 10.0.12.2 F09D8640
output chain: label 18 TAG adj out of FastEthernet0/0, addr 10.0.12.2 F09D8510
R2#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 5.5.5.5/32 0 Fa0/0 10.0.25.5
17 Pop Label 10.0.45.0/24 0 Fa0/0 10.0.25.5
18 Pop Label 172.16.0.0/16 3354 Fa0/0 10.0.25.5
19 16 3.3.3.3/32 0 Fa0/1 10.0.12.1
20 Pop Label 1.1.1.1/32 6964 Fa0/1 10.0.12.1
21 17 10.0.34.0/24 0 Fa0/1 10.0.12.1
23 10.0.34.0/24 0 Fa0/0 10.0.25.5
22 Pop Label 10.0.17.0/24 4794 Fa0/1 10.0.12.1
23 Pop Label 10.0.13.0/24 0 Fa0/1 10.0.12.1
24 16 4.4.4.4/32 0 Fa0/0 10.0.25.5
R5#sh mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
16 Pop Label 4.4.4.4/32 0 Fa0/0 10.0.45.4
17 17 3.3.3.3/32 0 Fa0/0 10.0.45.4
18 Pop Label 2.2.2.2/32 0 Fa0/1 10.0.25.2
19 20 1.1.1.1/32 1663 Fa0/1 10.0.25.2
20 22 10.0.17.0/24 0 Fa0/1 10.0.25.2
21 23 10.0.13.0/24 0 Fa0/1 10.0.25.2
23 10.0.13.0/24 0 Fa0/0 10.0.45.4
22 Pop Label 10.0.12.0/24 0 Fa0/1 10.0.25.2
23 Pop Label 10.0.34.0/24 0 Fa0/0 10.0.45.4
24 No Label 172.16.6.1/32 0 Fa0/2 172.16.56.6
R6#sh ip bgp
BGP table version is 3, local router ID is 172.16.6.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 100.0.0.0/16 0.0.0.0 0 32768 i
Комментарии к задачам закрыты. Если у вас есть ответ или вопросы или вам просто не с кем поговорить на технические темы, пишите на адрес: natasha@linkmeup.ru
2 коментария
R6(config-router)
router ospf 1
network 100.0.0.1 0.0.255.255 area 172
…
R7(config)#do ping 100.0.0.1
Sending 5, 100-byte ICMP Echos to 100.0.0.1, timeout is 2 seconds:
!!!
Такое решение?
Я создал на R6 loo1 с ip-адресом 6.6.6.10/32, занулльрутил и добавил сетку в BGP.
Естественно с R3 он не пингуется, т.к. он про BGP вообще не знает и меток к 6.6.6.10/32 у него нет.
На R6 пишу следующее:
ip prefix-list BGPtoOSPF permit 6.6.6.10/32
route-map RED permit 10
match ip address prefix-list BGPtoOSPF
exit
router ospf 1
redistribute bgp 64500 subnets route-map RED
exit
На R3 метка появляется:
sh mpls for
27 27 6.6.6.10/32 0 Fa1/0 10.10.34.2
И пинги туда тоже ходят.