1、理解三层交换
1.1 概念
三层交换代表使用三层交换技术实现VLAN间的通信,三层交换=二层交换+三层转发

实验需求
- 按照图示为 PC2 和 PC3 配置 IP 地址和网关
- PC2 属于 Vlan10,PC3 属于 Vlan20,在三层交换机上配置 Vlanif 三层接口实现 Vlan10 和 Vlan20 三层互通
- PC2 和 PC3 可以互通
实验步骤
1.PC配置IP和网关
2.交换机配置vlan绑定接口
[SW1]vlan 10
[SW1-vlan10]port g1/0/1
[SW1-vlan10]vlan 20
[SW1-vlan20]port g1/0/2
3.在 SW1 上对 Vlan10 和 Vlan20 开启 Vlanif 接口,并配置 Vlanif10 接口 IP 地址为 Vlan10 的网关地址 192.168.1.254/24,配置 Vlanif20 接口 IP 地址为 Vlan20 的网关地址 192.168.2.254/24
[SW1]interface Vlan-interface 10
[SW1-Vlan-interface10]ip address 192.168.1.254 24
[SW1]interface Vlan-interface 20
[SW1-Vlan-interface20]ip address 192.168.2.254 24
4.分析:配置结束后,在 SW1 上查看路由表,会发现已经产生了到达192.168.1.0/24网段和192.168.2.0/24网段的直连路由,出接口分别指向各自 Vlanif 接口,证明 SW1 已经可以对 Vlan10 和 Vlan20 间的数据进行三层转发了
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
5.测试在 PC3 上 Ping PC4 ,可以 Ping 通 PC4
<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=2.333 ms
56 bytes from 192.168.2.1: icmp_seq=1 ttl=254 time=0.961 ms
56 bytes from 192.168.2.1: icmp_seq=2 ttl=254 time=0.793 ms
56 bytes from 192.168.2.1: icmp_seq=3 ttl=254 time=0.683 ms
56 bytes from 192.168.2.1: icmp_seq=4 ttl=254 time=1.096 ms



阿凡28 天前
发表在:OneNav:一款超好用的开源导航站,搭建属于你的专属起始页0士大夫
阿凡28 天前
发表在:Win10 ensp中的路由报错40代码11
iVOaSF6d1 年前
发表在:中兴B862AV3.1M2_晨星MSO9385_2+8_安卓9_免拆机卡刷教程网盘文件在哪
pxP2NoZP1 年前
发表在:E900V20D机顶盒果壳6323使用U盘刷入安卓9MyInput
pxP2NoZP1 年前
发表在:宝塔安装V2rayNMyInput
pxP2NoZP1 年前
发表在:三层交换实验MyInput
pxP2NoZP1 年前
发表在:宝塔安装V2rayNMyInput
千火1 年前
发表在:宝塔安装V2rayN22
千火1 年前
发表在:J4125工控机安装Debian12教程001
T8RKoJZZ1 年前
发表在:E900V20D机顶盒果壳6323使用U盘刷入安卓9dfdfsafdsfdsdf