路由器1

路由器

路由器的工作原理

路由表

路由器中维护的路由条目的集合
路由器根据路由表选择路径
在这里插入图片描述

路由表的形成

直连网段:配置IP地址,端口up状态,形成直连路由
非直连网段:需要静态路由或者动态路由将网段添加到路由表中

静态路由

手工配置,单向的,缺乏灵活性
可精准管理

默认路由

默认路由属于静态路由,
网段是0.0.0.0 0
当找不到对应的网段时,找默认路由转发数据

路由器的转发数据包封装过程

如图所示,通过路由器事项两个网段的PC4与PC5通信
第一步:PC4 ARP广播 发送IP号为192.168.2.1/24,MAK 地址为ff-ff-ff-ff-ff-ff,
第二部:AR4的E1端口接受到信号,在路由表中找到192.168.2.0/24网段对应的接口为E2,发送单播给PC4,IP地址192.168.1.1/24,MAK地址为00-00-00-00-11-11,告诉PC4我的MAC 地址为00-00-00-00-22-22,
第三步:PC4单播发送MAC地址是00-00-00-00-22-22,IP地址是192.168.21.1/24
第四步:AR4接受到信息,将信息传给E2接口,E2接口对应的MAK地址是00-00-00-00-33-33
第五步:AR4接口广播,发送IP地址是192.168.2.1/24,MAK地址是ff-ff-ff-ff-ff-ff,
第六步:AP5的E1接口和AR4的E2接口在同一网段,并且要寻找的192.168.2.0/24网段在自己的路由表中,单播发送MAK地址00-00-00-00-33-33,告诉他我的E1接口的MAK地址是00-00-00-00-44-44
第七部:AR4的E2接口接受到信号,并记录AR5的E2接口的端口号,并单播发送MAK地址是00-00-00-00-44-44
第八步:AP5将信息传给E2接口,E2接口的MAK地址是00-00-00-00-55-55
第九步:AR5的E2接口广播寻找192.168.2.1/24,MAK地址是ff-ff-ff-ff-ff-ff
第十步:PC5发现寻找的IP地址是自己,单播发送信息给AR5的E2接口,告诉他自己的MAK地址是00-00-00-00-66-66
第十一步:AR5记录到PC5的MAK地址,单播发送信号给PC5目的IP是192.168.2.1/24,MAC地址是00-00-00-00-66-66
从而实现PC4与PC5之间的通讯。

在这里插入图片描述

静态路由配置

display ip routing-table 查看路由表
ip route-static 最终目的地址的网段号 下一跳地址
ip route-static 192.168.1.0 24 10.0.0.2
ip route-static 0.0.0.0 0 10.0.0.0.2 设置默认路由

浮动路由设置

ip route-static 最终目的地址的网段号 下一跳地址 preference 70
设置优先级为70
shutdpwn e0/0/0 关闭e0/0/0接口

作业

在这里插入图片描述

1,设置每台设备和端口的IP
PC1与PC2连通
在这里插入图片描述
查看路由表
在这里插入图片描述
配置浮动路由,关闭R1和r2的链路
PC1与PC2连通
在这里插入图片描述
再次查看路由表

在这里插入图片描述
192.168.20.0/24 优先级有60改为70

在这里插入图片描述
1,配置每个设备和端口IP
在这里插入图片描述
r1命令配置
Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
Apr 2 2021 16:02:26-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.2.1 24
Apr 2 2021 16:02:57-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 192.168.10.1 24
[r1-GigabitEthernet0/0/2]
Apr 2 2021 16:03:35-08:00 r1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[r1-GigabitEthernet0/0/2]q
[r1]ip ro
[r1]ip route-s
[r1]ip route-static 0.0.0.0 0 192.168.10.2

r2命令配置
[Huawei]sysn r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.10.2 24
Apr 2 2021 16:04:30-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.20.1 24
Apr 2 2021 16:05:07-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r2-GigabitEthernet0/0/1]q
[r2]ip ro
[r2]ip route-s
[r2]ip route-static 10.0.0.1 8 192.168.20.2
Info: The destination address and mask of the configured static route mismatched
, and the static route 10.0.0.0/8 was generated.
[r2]ip rout
[r2]ip route-s
[r2]ip route-static 10.0.0.0 8 192.168.20.2
Error: The route already exists.
[r2]ip ro
[r2]ip route-s
[r2]ip route-static 192.168.1.0 24 192.168.20.1
Error: The next-hop address is invalid.
[r2]ip ro
[r2]ip route-s
[r2]ip route-static 192.168.1.0 24 192.168.10.1
[r2]ip ro
[r2]ip route-st
[r2]ip route-static 192.168.2.0 24 192.168.10.1

r3命令配置
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.20.2 24
Apr 2 2021 16:06:00-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 10.0.0.1 8
Apr 2 2021 16:06:50-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

sys
Enter system view, return user view with Ctrl+Z.
[r3]ip ro
[r3]ip route-s
[r3]ip route-static 192.168.1.0 24 192.168.20.1
[r3]ip ro
[r3]ip route-s
[r3]ip route-static 192.168.2.0 24 192.168.20.1
[r3]

PC1连通服务器
在这里插入图片描述
PC2连通服务器
在这里插入图片描述

在这里插入图片描述
1,配置每台设备和端口IP
在这里插入图片描述
r1配置命令sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 10.0.2.2
^
Error:Incomplete command found at ‘^’ position.
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 10.0.1.1 8
Apr 2 2021 16:35:29-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 192.168.10.2
^
Error:Incomplete command found at ‘^’ position.
[r1-GigabitEthernet0/0/2]ip add 192.168.10.2 24
Apr 2 2021 16:37:01-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[r1-GigabitEthernet0/0/2]
[r1-GigabitEthernet0/0/2]q
[r1]ip ro
[r1]ip route-st
[r1]ip route-static 192.168.20.0 24 10.0.2.1
[r1]ip ro
[r1]ip routes
[r1]ip route-s
[r1]ip route-static 192.168.30.0 24 10.0.1.2

R2配置命令
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.20.2 24
Apr 2 2021 16:32:55-08:00 r2 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int
^
Error: Unrecognized command found at ‘^’ position.
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 10.0.2.1 8
Apr 2 2021 16:33:32-08:00 r2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r2-GigabitEthernet0/0/1]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

sys Enter system view, return user view with Ctrl+Z. [r2]ip ro [r2]ip route-s [r2]ip route-static 192.168.10.0 24 10.0.2.2 [r2]ip ro [r2]ip route-s [r2]ip route-static 192.168.30.0 24 10.0.2.2

r3配置命令
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 10.0.1.2 8
Apr 2 2021 16:37:55-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.30.2 24
Apr 2 2021 16:38:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]q
[r3]ip ro
[r3]ip route -s
[r3]ip route-s
[r3]ip route-static 192.168.10.0 24 10.0.1.1
[r3]ip ro
[r3]ip route-
[r3]ip route-static 192.168.20.0 24 10.0.1.1

PC1连通PC2与PC3
在这里插入图片描述
PC2连通PC1与PC3
在这里插入图片描述
PC3连通PC2与PC1
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
小米路由器R1D刷三方固件是指使用非官方的固件来替换原厂固件以获得更多功能和定制化的路由器体验。 刷三方固件的过程需要一定的技术知识和风险,因此在进行之前,请先确保你已经了解相关知识,并且做好备份工作,以防止无法修复的问题发生。 刷三方固件有以下几个步骤: 1. 准备工作:首先,确保你有一个可用的小米路由器R1D,并且它已经连接到电源和网络。同时,你需要下载和准备好要刷入的三方固件。建议在官方论坛或相关技术社区寻找可靠的固件。 2. 刷入固件:将准备好的固件文件上传到小米路由器R1D,可以通过路由器的Web界面进行操作。具体的操作步骤和界面可能因固件的不同而有所差别,请严格按照固件提供的说明进行操作。 3. 等待刷写完成:刷写固件的过程需要一段时间,这取决于固件的大小和网络传输速度。在刷写过程中,请务必勿断电或干扰,以免造成不可预料的损坏。 4. 配置和测试:刷入固件后,你需要重新配置你的路由器,包括网络设置、WiFi密码等。随后,测试一下路由器的功能是否正常,例如访问互联网、局域网内部的设备之间通信等。 需要注意的是,刷三方固件存在风险,例如可能导致硬件损坏、无法启动或正常使用等问题。因此,在刷写之前,请确保你已经充分了解这些风险,并承担相应的责任。最好在专业人士的指导下进行操作,以减少不必要的损失。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值