路由器与VLAN 技术

本文介绍了路由器与VLAN技术的基础知识,包括路由器的配置如Loopback接口和静态路由,以及交换机上的VLAN配置,如创建VLAN、设置接口模式。通过实例展示了如何配置VLAN以实现不同设备间的通信,以及故障排查的基本方法。同时,详细展示了交换机sw1和路由器r1、r2的配置步骤,以确保各设备间能正常通信。
摘要由CSDN通过智能技术生成

路由器

1,loopback 路由器的逻辑接口
int loopback 0 配置Loopback接口

作业

所有ping通在这里插入图片描述
在这里插入图片描述

R1路由器配置与结果

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r1
[r1]int loo
[r1]int LoopBack 0
[r1-LoopBack0]ip add 1.1.1.1 32
[r1-LoopBack0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.10.1 24
Apr 6 2021 13:52:56-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.20.1 24
Apr 6 2021 13:53:32-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]q
[r1]ip ro
[r1]ip route-st
[r1]ip route-static 2.2.2.2 32 192.168.20.2
[r1]ip ro
[r1]ip route-s
[r1]ip route-static 3.3.3.3 24 192.168.10.2
Info: The destination address and mask of the configured static route mismatched
, and the static route 3.3.3.0/24 was generated.

[r1]ip route-static 3.3.3.3 32 192.168.10.2
[r1]ping 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=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=20 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=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=20 ms

— 2.2.2.2 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/20/20 ms

[r1]ping 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=20 ms

— 3.3.3.3 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/18/30 ms

r2路由器配置与结果

The device is running!

sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn r2
[r2]int l
[r2]int LoopBack 0
[r2-LoopBack0]ip add 2.2.2.2 32
[r2-LoopBack0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip ad 192.168.20.2 24
Apr 6 2021 13:54:53-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r2-GigabitEthernet0/0/1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip ad 192.168.30.1 24
Apr 6 2021 13:55:18-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]

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 1.1.1.1 32 192.168.20.1 [r2]ip ro [r2]ip route-s [r2]ip route-static 3.3.3.3 32 192.168.30.2 [r2] [r2] [r2]ping 1.1.1.1 PING 1.1.1.1: 56 data bytes, press CTRL_C to break Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=60 ms Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=1 ms Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=20 ms

— 1.1.1.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/26/60 ms

[r2]ping 3.3.3.3
PING 3.3.3.3: 56

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值