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] vi a 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] vi a 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] vi a 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月前
|
网络架构
静态路由 网络实验
本文介绍了如何通过配置静态路由实现不同网络设备间的通信,包括网络拓扑图、设备IP配置、查看路由表信息、配置静态路由和测试步骤。通过在路由器上设置静态路由,使得不同子网内的设备能够互相通信。
静态路由 网络实验
|
6月前
|
网络虚拟化
三层交换实验
三层交换实验
|
6月前
|
网络架构
静态路由实验
静态路由实验
|
网络协议 Shell 网络虚拟化
网络三层交换机部署实验
网络三层交换机部署实验
150 0
网络三层交换机部署实验
|
网络架构
静态路由|说明&实验
静态路由|说明&实验
静态路由|说明&实验