ISCW系列实验一:MPLS配置


实验一:MPLS配置

实验环境:三台路由器Ethernet接口相连,接口配置如图
要求:在三台路由器相连的接口分别启用MPLS,查看相应的结果,在启用前使其在OSPF下互通。
 
 
步骤一:接口配置连通性,启用OSPF路由协议
R1(config-if)#int e0/1
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#int e0/0
R1(config-if)#ip add 20.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config)#router ospf 100  à启用路由协议,发布接口
R1(config-router)#net 10.1.1.0 0.0.0.255 area 0
R1(config-router)#net 20.1.1.0 0.0.0.255 area 0
 
R2(config)#int e0/1
R2(config-if)#ip add 20.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int e0/0
R2(config-if)#ip add 30.1.1.1 255.255.255.0
R2(config-if)#no sh
R2(config)#router ospf 100
R2(config-router)#net 20.1.1.0 0.0.0.255 area 0
R2(config-router)#net 30.1.1.0 0.0.0.255 area 0
 
R3(config)#int e0/1
R3(config-if)#ip add 30.1.1.2 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int e0/0
R3(config-if)#ip add 40.1.1.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router ospf 100
R3(config-router)#net 30.1.1.0 0.0.0.255 area 0
R3(config-router)#net 30.1.1.0 0.0.0.255 area 0
 
步骤二:查看路由,并测试连通性
 
R1#show ip route   à查看路由表
 
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, Ethernet0/0
     40.0.0.0/24 is subnetted, 1 subnets
O       40.1.1.0 [110/30] via 20.1.1.2, 00:00:15, Ethernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Ethernet0/1
     30.0.0.0/24 is subnetted, 1 subnets
O       30.1.1.0 [110/20] via 20.1.1.2, 00:00:15, Ethernet0/0
 
R2#show ip route
 
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, Ethernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
O       40.1.1.0 [110/20] via 30.1.1.2, 00:00:23, Ethernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O       10.1.1.0 [110/20] via 20.1.1.1, 00:00:23, Ethernet0/1
     30.0.0.0/24 is subnetted, 1 subnets
C       30.1.1.0 is directly connected, Ethernet0/0
 
R3#show ip route  à查看路由表,都也学到相关路由
 
     20.0.0.0/24 is subnetted, 1 subnets
O       20.1.1.0 [110/20] via 30.1.1.1, 00:00:06, Ethernet0/1
     40.0.0.0/24 is subnetted, 1 subnets
C       40.1.1.0 is directly connected, Ethernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
O       10.1.1.0 [110/30] via 30.1.1.1, 00:00:06, Ethernet0/1
     30.0.0.0/24 is subnetted, 1 subnets
C       30.1.1.0 is directly connected, Ethernet0/1
 
R1#ping 40.1.1.1  à测试连通性
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 40.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
 
R3#ping 10.1.1.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/4 ms
 
步骤三:启用相关接口的MPLS,及快速转发功能
 
R1(config)#ip cef  à启用快速转发功能
R1(config)#int e0/0
R1(config-if)#mpls ip  à接口启用MPLS
 
R2(config)#ip cef
R2(config)#int e0/1
R2(config-if)#mpls ip
R2(config-if)#int e0/0
R2(config-if)#mpls ip
 
R3(config)#ip cef
R3(config)#int e0/1
R3(config-if)#mpls ip
 
步骤四:查看MPLS状态
 
R1#show mpls forwarding-table  à查看MPLS转发表
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     16          40.1.1.0/24       0          Et0/0      20.1.1.2
17     Pop tag     30.1.1.0/24       0          Et0/0      20.1.1.2
 
R2#show mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     40.1.1.0/24       0          Et0/0      30.1.1.2
17     Pop tag     10.1.1.0/24       0          Et0/1      20.1.1.1
 
R3#show mpls forwarding-table
Local  Outgoing    Prefix            Bytes tag  Outgoing   Next Hop
tag    tag or VC   or Tunnel Id      switched   interface
16     Pop tag     20.1.1.0/24       0          Et0/1      30.1.1.1
17     17          10.1.1.0/24       0          Et0/1      30.1.1.1
 
R1#show ip cef summary  à查看CEF转发汇总信息及标记信息
IP CEF with switching (Table Version 16), flags=0x0
  16 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0
  16 leaves, 18 nodes, 20896 bytes, 21 inserts, 5 invalidations
  0 load sharing elements, 0 bytes, 0 references
  universal per-destination load sharing algorithm, id 86C8F0BF
  3(0) CEF resets, 0 revisions of existing leaves
  Resolution Timer: Exponential (currently 1s, peak 1s)
  0 in-place/0 aborted modifications
  refcounts:  4877 leaf, 4864 node
 
  Table epoch: 0 (16 entries at this epoch)
 
Adjacency Table has 2 adjacencies
 
R2#show ip cef summary
IP CEF with switching (Table Version 17), flags=0x0
  17 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0
  17 leaves, 18 nodes, 21032 bytes, 22 inserts, 5 invalidations
  0 load sharing elements, 0 bytes, 0 references
  universal per-destination load sharing algorithm, id FCD3DE86
  3(0) CEF resets, 0 revisions of existing leaves
  Resolution Timer: Exponential (currently 1s, peak 1s)
  0 in-place/0 aborted modifications
  refcounts:  4879 leaf, 4864 node
 
  Table epoch: 0 (17 entries at this epoch)
 
Adjacency Table has 4 adjacencies
 
R3#show ip cef summary
IP CEF with switching (Table Version 16), flags=0x0
  16 routes, 0 reresolve, 0 unresolved (0 old, 0 new), peak 0
  16 leaves, 18 nodes, 20896 bytes, 21 inserts, 5 invalidations
  0 load sharing elements, 0 bytes, 0 references
  universal per-destination load sharing algorithm, id 86B9347C
  3(0) CEF resets, 0 revisions of existing leaves
  Resolution Timer: Exponential (currently 1s, peak 1s)
  0 in-place/0 aborted modifications
  refcounts:  4877 leaf, 4864 node
 
  Table epoch: 0 (16 entries at this epoch)
 
Adjacency Table has 2 adjacencies
 
注:也可用show ip cef detail这条命令来查看详细信息
 
R1#ping 40.1.1.1  à测试连通性
!!!!!
 
R3#ping 10.1.1.1
!!!!!
 
步骤五:显示当前配置信息
 
R1#show run
hostname R1
ip cef
!
interface Ethernet0/0
 ip address 20.1.1.1 255.255.255.0
 half-duplex
 tag-switching ip
!
interface Ethernet0/1
 ip address 10.1.1.1 255.255.255.0
 half-duplex
!
router ospf 100
 network 10.1.1.0 0.0.0.255 area 0
 network 20.1.1.0 0.0.0.255 area 0
!
end
 
R2#show run
hostname R2
!
ip cef
!
interface Ethernet0/0
 ip address 30.1.1.1 255.255.255.0
 half-duplex
 tag-switching ip
!
interface Ethernet0/1
 ip address 20.1.1.2 255.255.255.0
 half-duplex
 tag-switching ip
!
router ospf 100
 network 20.1.1.0 0.0.0.255 area 0
 network 30.1.1.0 0.0.0.255 area 0
!
end
 
R3#show run
hostname R3
!
ip cef
!
interface Ethernet0/0
 ip address 40.1.1.1 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 30.1.1.2 255.255.255.0
 half-duplex
 tag-switching ip
!
router ospf 100
 network 30.1.1.0 0.0.0.255 area 0
 network 40.1.1.0 0.0.0.255 area 0
!
end



    本文转自hexianguo 51CTO博客,原文链接: http://blog.51cto.com/xghe110/98411 ,如需转载请自行联系原作者

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值