ljhk 发表于 2015-9-17 09:12:25

MPLS---OSPF试验

Ip 地址如上图,Loopback 0 分别为 x.x.x.x/32R1/R5是CE。R2/R3/R4是ISP:R2/R4是PE,R3是P。步骤一、ISP内部 运行IGP(ISIS)协议
R2:router isis net 24.0234.0000.0000.0002.00interface Serial1/1ip router isisinterface Loopback0ip router isisR3:router isis net 24.0234.0000.0000.0003.00 interface Serial1/1ip router isisnterface Serial1/0ip router isisinterface Loopback0ip router isis R4:router isis net 24.0234.0000.0000.0004.00interface Serial1/0ip router isisinterface Loopback0ip router isis 配置完检查邻居关系的建立:R3# sh clns neighbors System Id      Interface   SNPA                StateHoldtimeType ProtocolR4             Se1/1       *HDLC*            Up   29      L1L2 IS-ISR2             Se1/0       *HDLC*            Up   27      L1L2 IS-ISR2/R4上show ip route 查看路由是否学到R2#sh ip route    34.0.0.0/24 is subnetted, 1 subnetsi L1    34.0.0.0 via 23.0.0.3, Serial1/1   2.0.0.0/32 is subnetted, 1 subnetsC       2.2.2.2 is directly connected, Loopback0   3.0.0.0/32 is subnetted, 1 subnetsi L1    3.3.3.3 via 23.0.0.3, Serial1/1   4.0.0.0/32 is subnetted, 1 subnetsi L1    4.4.4.4 via 23.0.0.3, Serial1/1   23.0.0.0/24 is subnetted, 1 subnetsC       23.0.0.0 is directly connected, Serial1/1步骤二、ISP内部实现MPLSR2:mpls label range 200 300mpls ldp route-id    lo 0int s 1/1mpls ipR3:mpls label range 300 400mpls ldp route-id    lo 0int s 1/1mpls ipint s 1/0mpls ipR4:mpls label range 400 500mpls ldp route-id    lo 0int s 1/0mpls ip 然后在R3上查看LDP 邻居的建立: R3#sh mpls ldp neighbor     Peer LDP Ident: 2.2.2.2:0; Local LDP Ident 3.3.3.3:0      TCP connection: 2.2.2.2.646 - 3.3.3.3.33300      State: Oper; Msgs sent/rcvd: 34/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.3:0      TCP connection: 4.4.4.4.32962 - 3.3.3.3.646      State: Oper; Msgs sent/rcvd: 25/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          LDP邻居建立完成即可。 步骤三、ISP 中R2与R4(PE之间)建立MBPG-VPN关系R2:router bgp 1no au                                                          默认关闭的no syn                                                         默认关闭的 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 vpnv4neighbor 4.4.4.4 activateneighbor 4.4.4.4 send-community extended exit-address-familyR4: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 vpnv4neighbor 2.2.2.2 activateneighbor 2.2.2.2 send-community extended exit-address-family 检查邻居是否建立成功: R4#   sh ip bg vpn all summary Neighbor      V    AS MsgRcvd MsgSent   TblVerInQ OutQ Up/DownState/PfxRcd2.2.2.2         4   1      35      33      9    0    0 00:25:47      2 R2# sh ip bg vpn all suNeighbor      V    AS MsgRcvd MsgSent   TblVerInQ OutQ Up/DownState/PfxRcd4.4.4.4         4   1      34      36      9    0    0 00:26:14      2 步骤四、VRF的导入导出R2/R4创建VRFip vrf OSPF rd 1:100    route-target export 1:100 route-target import 1:100接口下启用VRFR2interface Serial1/0 I    p vrf forwarding OSPFR4interface Serial1/1 ip vrf forwarding OSPF PE-CE间使用ospf路由协议R1:router ospf 1 router-id 1.1.1.1 log-adjacency-changes network 1.1.1.1 0.0.0.0 area 0 network 12.0.0.1 0.0.0.0 area 0R2:router ospf 1 vrf OSPF log-adjacency-changesnetwork 12.0.0.2 0.0.0.0 area 0R5:router ospf 1 router-id 5.5.5.5 log-adjacency-changes network 5.5.5.5 0.0.0.0 area 0 network 45.0.0.5 0.0.0.0 area 0R4router ospf 1 vrf OSPF log-adjacency-changesnetwork 45.0.0.4 0.0.0.0 area 0 R2/R4 VRF 和BGP路由相互重分布R2/R4router ospf 1 vrf OSPF redistribute bgp 1 subnets router bgp 1address-family ipv4 vrf OSPFredistribute ospf 1 vrf OSPF match internal external 1 external 2no synchronization exit-address-family R2/R4 上检查VRF路由是否学到R2#sh ip bg vpn all   Network          Next Hop            Metric LocPrf Weight PathRoute Distinguisher: 1:1 (default for vrf RIP)*> 1.1.1.1/32       12.0.0.1               1         32768 ?*>i5.5.5.5/32       4.4.4.4                  1    100      0 ?*> 12.0.0.0/24      0.0.0.0                  0         32768 ?*>i45.0.0.0/24      4.4.4.4                  0    100      0 ? 查看R1/R5路由是否学到:R1#      sh ip route    1.0.0.0/32 is subnetted, 1 subnetsC       1.1.1.1 is directly connected, Loopback0   5.0.0.0/32 is subnetted, 1 subnetsO IA    5.5.5.5 via 12.0.0.2, 00:11:14, Serial1/1   12.0.0.0/24 is subnetted, 1 subnetsC       12.0.0.0 is directly connected, Serial1/1   45.0.0.0/24 is subnetted, 1 subnetsO IA    45.0.0.0 via 12.0.0.2, 00:11:14, Serial1/1 步骤五、测试MPLS ,查看转发过程标签转换情况 单方向从R1-R5观察: 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 msec2 23.0.0.3 112 msec 120 msec 160 msec3 45.0.0.4 108 msec 120 msec 108 msec4 45.0.0.5 128 msec *104 msec R2#sh ip cef vrf OSPF detail 5.5.5.5/32, version 9, epoch 0, cached adjacency to Serial1/10 packets, 0 bytestag information set    local tag: VPN-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 adjacencytag rewrite with Se1/1, point2point, tags imposed: {301 403} R3#sh mpls forwarding-table LocalOutgoing    Prefix            Bytes tagOutgoing   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 OSPF detail5.5.5.5/32, version 10, epoch 0, cached adjacency to Serial1/10 packets, 0 bytestag information set    local tag: 403via 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: {}
页: [1]
查看完整版本: MPLS---OSPF试验