H3C 三层交换实验

H3C 三层交换实验

实验拓扑

image

实验需求

  1. 按照图示为 PC1 和 PC2 配置 IP 地址和网关
  2. PC1 属于 Vlan10,PC2 属于 Vlan20,在三层交换机上配置 Vlanif 三层接口实现 Vlan10 和 Vlan20 三层互通
  3. PC1 和 PC2 可以互通

实验步骤

PC配置IP地址(略)

SW1配置

创建VLAN10和VLAN20
#
vlan 10
#
vlan 20
将VLAN加入到对应接口
#
interface GigabitEthernet1/0/1
 port link-mode bridge
 port access vlan 10
#
interface GigabitEthernet1/0/2
 port link-mode bridge
 port access vlan 20
配置Vlanif接口
#
interface Vlan-interface10
 ip address 192.168.1.254 255.255.255.0
#
interface Vlan-interface20
 ip address 192.168.2.254 255.255.255.0

实验验证

在 SW1 上查看路由表,会发现已经产生了到达192.168.1.0/24网段和192.168.2.0/24网段的直连路由,出接口分别指向各自 Vlanif 接口,证明 SW1 已经可以对 Vlan10 和 Vlan20 间的数据进行三层转发

[SW1]display ip routing-table 

Destinations : 16	Routes : 16

Destination/Mask   Proto   Pre Cost        NextHop         Interface
0.0.0.0/32         Direct  0   0           127.0.0.1       InLoop0
127.0.0.0/8        Direct  0   0           127.0.0.1       InLoop0
127.0.0.0/32       Direct  0   0           127.0.0.1       InLoop0
127.0.0.1/32       Direct  0   0           127.0.0.1       InLoop0
127.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0
192.168.1.0/24     Direct  0   0           192.168.1.254   Vlan10
192.168.1.0/32     Direct  0   0           192.168.1.254   Vlan10
192.168.1.254/32   Direct  0   0           127.0.0.1       InLoop0
192.168.1.255/32   Direct  0   0           192.168.1.254   Vlan10
192.168.2.0/24     Direct  0   0           192.168.2.254   Vlan20
192.168.2.0/32     Direct  0   0           192.168.2.254   Vlan20
192.168.2.254/32   Direct  0   0           127.0.0.1       InLoop0
192.168.2.255/32   Direct  0   0           192.168.2.254   Vlan20
224.0.0.0/4        Direct  0   0           0.0.0.0         NULL0
224.0.0.0/24       Direct  0   0           0.0.0.0         NULL0
255.255.255.255/32 Direct  0   0           127.0.0.1       InLoop0

PC1 和 PC2 可以互通

PC1 Ping PC2

<H3C>ping 192.168.2.1
Ping 192.168.2.1 (192.168.2.1): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.2.1: icmp_seq=0 ttl=254 time=1.000 ms
56 bytes from 192.168.2.1: icmp_seq=1 ttl=254 time=0.000 ms
56 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=1.000 ms
56 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=1.000 ms
56 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=1.000 ms

--- Ping statistics for 192.168.2.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.000/0.800/1.000/0.400 ms
<H3C>%Jan 31 17:29:42:616 2024 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.2.1: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.000/0.800/1.000/0.400 ms.

PC2 Ping PC1

<H3C>ping 192.168.1.1
Ping 192.168.1.1 (192.168.1.1): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.1.1: icmp_seq=0 ttl=254 time=0.648 ms
56 bytes from 192.168.1.1: icmp_seq=1 ttl=254 time=0.728 ms
56 bytes from 192.168.1.1: icmp_seq=2 ttl=254 time=0.964 ms
56 bytes from 192.168.1.1: icmp_seq=3 ttl=254 time=1.350 ms
56 bytes from 192.168.1.1: icmp_seq=4 ttl=254 time=0.620 ms

--- Ping statistics for 192.168.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.620/0.862/1.350/0.272 ms
<H3C>%Jan 31 17:27:57:878 2024 H3C PING/6/PING_STATISTICS: Ping statistics for 192.168.1.1: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 0.620/0.862/1.350/0.272 ms.

实验附件

三层交换实验.zip

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值