码迷,mamicode.com
首页 > 其他好文 > 详细

路由转发工作实例

时间:2020-05-21 10:28:31      阅读:46      评论:0      收藏:0      [点我收藏+]

标签:ace   break   rom   http   tin   实例   png   各路   interface   

一. 路由器工作原理-指定转发方向实验
1.在华为模拟器ensp上设置三个普通路由器先打开ensp,分别用网线连接,如下图
技术图片
技术图片
2.配各路由接口地址
配置R1

[Huawei]sysname R1
[R1]int GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip add 13.0.0.1 24
[R1-GigabitEthernet0/0/1]un sh
[R1-GigabitEthernet0/0/1]int GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip add 12.0.0.1 24
[R1-GigabitEthernet0/0/0]un sh
[R1-GigabitEthernet0/0/1]dis ip int brief
GigabitEthernet0/0/0              12.0.0.1/24          up         up        
GigabitEthernet0/0/1              13.0.0.1/24          up         up

配置R2接口

[R2]interface g0/0/3
[R2-GigabitEthernet0/0/3]ip add 23.0.0.2 24
[R2-GigabitEthernet0/0/3]un sh
[R2-GigabitEthernet0/0/3]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R2-GigabitEthernet0/0/0]un sh
[R2-GigabitEthernet0/0/0]q
[R2]int loo 0
[R2-LoopBack0]ip address 2.2.2.2 24
[R2-LoopBack0]q
[R2]dis ip int brief
GigabitEthernet0/0/0              12.0.0.2/24          up         up
GigabitEthernet0/0/3              23.0.0.2/24          up         up        
LoopBack0                         2.2.2.2/24           up           up

配置R3接口

[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip add 13.0.0.3 24
[R3-GigabitEthernet0/0/1]un sh 
[R3-GigabitEthernet0/0/1]int g0/0/3
[R3-GigabitEthernet0/0/3]ip add 23.0.0.3 24
[R3-GigabitEthernet0/0/3]un sh
[R3-GigabitEthernet0/0/3]int loo 0
[R3-LoopBack0]ip add 3.3.3.3 24
[R3-LoopBack0]int loo 1
[R3-LoopBack1]ip add 4.4.4.4 24
[R3-LoopBack1]q
[R3]dis ip int brief
GigabitEthernet0/0/1              13.0.0.3/24          up         up        
GigabitEthernet0/0/3              23.0.0.3/24          up         up        
LoopBack0                         3.3.3.3/24           up         up(s)     
LoopBack1                         4.4.4.4/24           up         up(s)  

3.按照需求配置路由
需求一 :去的路R2-R1-R3 回的路 R3-R2
技术图片
技术图片
技术图片
命令

[R2]ip route-static 3.3.3.0 24 12.0.0.1
[R1]ip route-static 3.3.3.0 24 13.0.0.3
[R3]ip route-static 2.2.2.0 24 23.0.0.2

测试

[R2]ping -a 2.2.2.2 3.3.3.3
 [R3]ping -a 3.3.3.3 2.2.2.2

需求二 :去的路R2-R3 回的路 R3-R2

[R2]ip route-static 4.4.4.0 24 23.0.0.3
[R3]dis ip routing-table  路由表中有回去的路,不用再配置

技术图片
测试:

[R2]ping -a 2.2.2.2 4.4.4.4
  PING 4.4.4.4: 56  data bytes, press CTRL_C to break
    Reply from 4.4.4.4: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 4.4.4.4: bytes=56 Sequence=3 ttl=255 time=50 ms
    Reply from 4.4.4.4: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 4.4.4.4: bytes=56 Sequence=5 ttl=255 time=40 ms
[R3]ping -a 4.4.4.4 2.2.2.2
  PING 2.2.2.2: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=50 ms
    Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=30 ms

路由转发工作实例

标签:ace   break   rom   http   tin   实例   png   各路   interface   

原文地址:https://blog.51cto.com/14625831/2496801

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!