Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MPLS-RIP lab documentation

2025-03-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

The Ip address is shown in the figure above, and Loopback 0 is x.x.x.x/32 R1/R5 and CE respectively. R2/R3/R4 is ISP:R2/R4, PE,R3 is P.

Step 1. ISP runs the IGP (OSPF) protocol internally

R2:

Router ospf 1

Router-id 2.2.2.2

Log-adjacency-changes

Network 2.2.2.2 0.0.0.0 area 0

Network 23.0.0.2 0.0.0.0 area 0

R3:

Router ospf 1

Router-id 3.3.3.3

Log-adjacency-changes

Network 3.3.3.3 0.0.0.0 area 0

Network 23.0.0.3 0.0.0.0 area 0

Network 34.0.0.3 0.0.0.0 area 0

R4:

Router ospf 1

Router-id 4.4.4.4

Log-adjacency-changes

Network 4.4.4.4 0.0.0.0 area 0

Network 34.0.0.4 0.0.0.0 area 0

After configuration, check the establishment of neighbor relationship:

R3:

R3#sh ip os nei

Neighbor ID Pri State Dead Time Address Interface

4.4.4.4 0 FULL/-00:00:38 34.0.0.4 Serial1/1

2.2.2.2 0 FULL/-00:00:32 23.0.0.2 Serial1/0

Show ip route on R2/R4 to see if routing has been learned

R2# sh ip route

34.0.0.0/24 is subnetted, 1 subnets

O 34.0.0.0 [110/128] via 23.0.0.3, 00:16:25, Serial1/1

2.0.0.0/32 is subnetted, 1 subnets

C 2.2.2.2 is directly connected, Loopback0

3.0.0.0/32 is subnetted, 1 subnets

O 3.3.3.3 [110/65] via 23.0.0.3, 00:16:25, Serial1/1

4.0.0.0/32 is subnetted, 1 subnets

O 4.4.4.4 [110/129] via 23.0.0.3, 00:16:25, Serial1/1

23.0.0.0/24 is subnetted, 1 subnets

C 23.0.0.0 is directly connected, Serial1/1

Step 2. Implement MPLS internally in ISP

R2:

Mpls label range 200 300

Mpls ldp route-id lo 0

Int s 1/1

Mpls ip

R3:

Mpls label range 300 400

Mpls ldp route-id lo 0

Int s 1/1

Mpls ip

Int s 1/0

Mpls ip

R4:

Mpls label range 400 500

Mpls ldp route-id lo 0

Int s 1/0

Mpls ip

Then view the establishment of LDP neighbors on R3:

R3#sh mpls ldp neighbor

Peer LDP Ident: 2.2.2.2 0; Local LDP Ident 3.3.3.3 VR 0

TCP connection: 2.2.2.2.646-3.3.3.3.33300

State: Oper; Msgs sent/rcvd: 34max 37; Downstream

Up time: 00:23:03

LDP discovery sources:

Serial1/0, Src IP addr: 23.0.0.2

Addresses bound to peer LDP Ident:

23.0.0.2 2.2.2.2

Peer LDP Ident: 4.4.4.4 0; Local LDP Ident 3.3.3.3VR 0

TCP connection: 4.4.4.32962-3.3.3.3.646

State: Oper; Msgs sent/rcvd: 25Universe 28; Downstream

Up time: 00:14:27

LDP discovery sources:

Serial1/1, Src IP addr: 34.0.0.4

Addresses bound to peer LDP Ident:

34.0.0.4 4.4.4.4

The LDP neighbor establishment is complete.

Step 3. Establish a MBPG- × × relationship between R2 and R4 (between PE) in ISP

R2:

Router bgp 1

No au is turned off by default

No syn is turned off by default

No bgp default ipv4-unicast

Bgp log-neighbor-changes

Neighbor 4.4.4.4 remote-as 1

Neighbor 4.4.4.4 update-source Loopback0

!

Address-family * * v4

Neighbor 4.4.4.4 activate

Neighbor 4.4.4.4 send-community extended

Exit-address-family

R4:

Router bgp 1

No au

No syn

No bgp default ipv4-unicast

Bgp log-neighbor-changes

Neighbor 2.2.2.2 remote-as 1

Neighbor 2.2.2.2 update-source Loopback0

!

Address-family * * v4

Neighbor 2.2.2.2 activate

Neighbor 2.2.2.2 send-community extended

Exit-address-family

Check that the neighbor is established successfully:

Ringing sh ip bg * all summary

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

2.2.2.2 4 1 35 33 9 00 00:25:47 2

Ringing sh ip bg * all su

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd

4.4.4.4 4 1 34 36 9 00 00:26:14 2

Step 4. Import and export of VRF

R2/R4

Create VRF

Ip vrf RIP

Rd 1:1

Route-target export 1:1

Route-target import 1:1

Enable VRF under the API

R2 interface Serial1/0

I p vrf forwarding RIP

R4 interface Serial1/1

Ip vrf forwarding RIP

RIP routing protocol is used between PE-CE

R1:

Router rip

Version 2

Network 1.0.0.0

Network 12.0.0.0

No auto-summary

R2:

Router rip

Version 2

No auto-summary

!

Address-family ipv4 vrf RIP

Network 12.0.0.0

No auto-summary

Exit-address-family

R5:

Router rip

Version 2

Network 5.0.0.0

Network 45.0.0.0

No auto-summary

R4

Router rip

Version 2

No auto-summary

!

Address-family ipv4 vrf RIP

Network 45.0.0.0

No auto-summary

Exit-address-family

R2/R4 VRF and BGP routes are redistributed to each other

R2/R4

Router rip

Version 2

No auto-summary

Router bg 1

Address-family ipv4 vrf RIP

Redistribute bgp 1 metric transparent metric transparent transmission, that is, METRIC does not change

No auto-summary

Exit-address-family

Check on R2/R4 to see if VRF routing is learned

R2#sh ip bg * all

Network Next Hop Metric LocPrf Weight Path

Route Distinguisher: 1:1 (default for vrf RIP)

* > 1.1.1.1 Compact 32 12.0.0.1 1 32768?

* > i5.5.5.5Compact 32 4.4.4.4 1 100 0?

* > 12.0.0.0Compact 24 0.0.0.0 32768?

* > i45.0.0.0Compact 24 4.4.4.4 0 100 0?

Check to see if R1/R5 routing has learned:

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

1.0.0.0/32 is subnetted, 1 subnets

C 1.1.1.1 is directly connected, Loopback0

5.0.0.0/32 is subnetted, 1 subnets

R 5.5.5.5 [120/2] via 12.0.0.2, 00:00:05, Serial1/1

12.0.0.0/24 is subnetted, 1 subnets

C 12.0.0.0 is directly connected, Serial1/1

45.0.0.0/24 is subnetted, 1 subnets

R 45.0.0.0 [120/1] via 12.0.0.2, 00:00:05, Serial1/1

Step 5. Test MPLS to check the tag conversion in the forwarding process.

View from R1-R5 in one direction:

R1#traceroute 5.5.5.5

Type escape sequence to abort.

Tracing the route to 5.5.5.5

1 12.0.0.2 48 msec 48 msec 32 msec

2 23.0.0.3 [MPLS: Labels 301/403 Exp 0] 112 msec 120 msec 160 msec

3 45.0.0.4 [MPLS: Label 403 Exp 0] 108 msec 120 msec 108 msec

4 45.0.0.5 128 msec * 104 msec

R2#sh ip cef vrf RIP detail

5.5.5.5/32, version 9, epoch 0, cached adjacency to Serial1/1

0 packets, 0 bytes

Tag information set

Local tag: × × ×-route-head

Fast tag rewrite with Se1/1, point2point, tags imposed: {301 403}

Via 4.4.4.4, 0 dependencies, recursive

Next hop 23.0.0.3, Serial1/1 via 4.4.4.4/32

Valid cached adjacency

Tag rewrite with Se1/1, point2point, tags imposed: {301 403}

R3#sh mpls forwarding-table

Local Outgoing Prefix Bytes tag Outgoing Next Hop

Tag tag or VC or Tunnel Id switched interface

301 Pop tag 4.4.4.4/32 4760 Se1/1 point2point

R4#sh ip cef vrf RIP detail

5.5.5.5/32, version 10, epoch 0, cached adjacency to Serial1/1

0 packets, 0 bytes

Tag information set

Local tag: 403

Via 45.0.0.5, Serial1/1, 0 dependencies

Next hop 45.0.0.5, Serial1/1

Valid cached adjacency

Tag rewrite with Se1/1, point2point, tags imposed: {}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report