计算机网络原理实验三──三层交换机基本配置
2020-4-24
| 2023-3-27
0  |  Read Time 0 min
type
status
date
slug
summary
tags
category
icon
password

准备

在 CPT 中拖入 3560-24PS ,放入两个PC机,并在Connections中选择Copper Straight-Through连接Switch的GigabitEthernet 0/1、0/2和两台PC机的FastEthernet 0。

开始

划分vlan

给vlan配置地址
双击进入其中一台 Switch 中,为vlan10添加192.168.20.254地址
添加出错后,可为vlan10删除该地址
或者直接添加新的覆盖
用同样的方法,给vlan20添加192.168.20.254 的ip

给接口配置vlan

进入gb0/1与gb0/2,分别给两个接口分配vlan10与vlan20

给PC配置IP

给划分在vlan10上的PC机进行IP配置,IP地址设为192.168.10.1,Gateway设为192.168.10.254,另一台同理。
此时使用一台PC机ping另一台PC机,发现不通,但是ping 192.168.20.254是通的,这是因为交换机目前还没有路由功能。在交换机上输入
这时候就有三层交换机的路由功能了。
这时候就可以ping通了

不划分vlan的交换机配置

给接口配置地址
不划分vlan的时候
并给两台主机分别配置 192.168.10.1 和 192.168.20.1的ip,在 Switch 中输入
在第一台PC机中输入 ping 192.168.20.1 即可ping通

问题探究

其他

默认模式下,交换机工作在二层模式下,需要运行 no switchport 将其修改为三层模式。
交换机需要手动配置网络而路由器不用
 
 

Preparation

Put the router model 3560-24PS and 2 PCs into Cisco Packet Tracer. Connect the FastEthernet 0 of two PCs with the GigabitEthernet 0/1 and GigabitEthernet 0/2 of the switch by Copper Straight-Through Line.

Start

Divide VLAN

Configure IP Address for VLAN
To enter one of the switches, you should double click it. Then add an IP address 192.168.20.254 for VLAN 10.
 
If you add a wrong IP, you can delete the IP of VLAN 10, or you can simply add a new IP to overwrite the old IP.
Then use the same way to add the IP 192.168.20.254 for VLAN 20.

VLAN configuration of interface

 

IP configuration of PC

Configurate IP for the PC which is divided on VLAN 10. Set IP to 192.168.10.1, and set the gateway to 192.168.10.254. Do the same thing on another PC.
Try to use one PC to ping another PC, then you will find that the ICMP packet can't reach. But it is reachable to ping 192.168.20.254. It's because the switch hasn't routing feature yet. Type "ip routing" to enable it.
Then the layer 3 switch feature will be enabled, and the ICMP packet will be reachable.

Switch configuration without VLAN division

IP configuration for the Interface
Without VLAN division
Configurate IP 192.168.10.1 and 192.168.20.1 for two PCs. Type the command.
Type command "ping 192.168.20.1" on PC1. PC1 and PC2 are able to communicate.

Questions to explore

Why Command Prompt report timeout when I tried to ping for the first time?

Others

By the default, the switch works at Layer 2 mode. You should type "no switchport" to turn it to Layer 3 mode.
Also, Switch needs to configurate the network manually but Router doesn't.
学习思考
  • 学习
  • C# 异步编程初体验(Async/Await)Docker Swarm 集群探索笔记
    • GitTalk
    Catalog