Three switches and three-tier exchange experiments

table of Contents

More than one VLAN port router interconnection experiment

1.1 experimental content

1.2 Principle

Layer Layer 2 switch interface experiment

2.1 experimental content

2.2 Principle

2.3 key command

2.4 configuration process

Layer 3 Switch IP interface experiment

3.1 experimental content

3.2 Principle

3.3 key command

 3.4 configuration process

A plurality of interconnected three switches 4 Experiment

4.1 experimental content

4.2 Principle


More than one VLAN port router interconnection experiment

1.1 experimental content

Construction topology shown below, to create three VLAN in the switch, respectively, VLAN2 VLAN 3 VLAN 4, 123 respectively assigned to the switch port to VLAN 2 

456 switch ports assigned to VLAN 3, the switch port 789 is assigned to VLAN4, router interfaces are connected to three ports 36 connect the switch 9. realize the communication process between the terminal connections of different VLAN switch ports.

1.2 Principle

Created in the switch three VLAN, namely, VLAN 2, VLAN 3, VLAN 4, and each port is assigned to each VLAN.

Router switch ports are connected to three interfaces belong to three different VLAN. The router assigned to the interface IP address and subnet, subnet mask, and IP addresses assigned to the interface of each router decides the VLAN interface to the network address of connection, connected to the terminal to a VLAN interface as the IP address of the default gateway address .

0 exists towards all network routers routing table, each host when sending packets to the router, the routing table, corresponding to the destination host

Layer Layer 2 switch interface experiment

2.1 experimental content

Construction of the network topology as shown below, to create three VLAN on the switch, the switch port 123 is assigned to VLAN 2 switch port 456 is assigned to VLAN 3

The switch port 789 assigned to the VLAN 4, to achieve exchange between terminals connected to different VLAN

By default, three port switch port is switched, i.e. until the corresponding IP interface defined VLAN, the default is equivalent to three switches switcher. But you can switch to Layer 3 interface to a Layer 3 interface to a switch port, once converted into a three-layer-three interface, three-layer switch port exactly the same router Ethernet interface

The switch is no longer there switcher function, it becomes 24 Ethernet interface router

2.2 Principle

将三层交换机连接二层交换机端口 3 6 9三个端口转换成三层接口,三层交换机这三个三层接口完全等同于路由器以太网接口。

可以为这三个三层接口分配IP地址和子网掩码,每一个三层接口分配的IP地址和子网掩码决定了该三层接口连接的VLAN的网络地址,完成这三个三层接口的IP地址和子网掩码配置过程后,三层交换机自动生成包含三项直连路由项的路由表。

2.3 关键命令

1 定义三层接口

全局模式

interface FastEthernet 0/1   //进入接口0/1的配置模式

接口配置模式

no switchport    //取消交换机0/1口的交换功能,该端口完全等同于路由器物理接口

ip address 192.1.1.254 255.255.255.0  //为该端口分配IP地址和子网掩码,只有取消交换功能之后才能分配

exit

2 启动三层交换机的路由功能 

全局模式

ip routing //启动三层交换机的IP分组路由功能,默认状态下,三层交换机只有MAC帧转发功能,如果需要三层交换机具有IP分组转发功能,用该命令启动三层交换机的IP分组路由功能

       为三层交换机配置路由协议前,必须事先通过该命令启动三层交换机的路由功能。

2.4 配置过程

三层交换机

3 三层交换机IP接口实验

3.1 实验内容

构建如下图所示的网络结构,在三层交换机上创建两个VLAN,分别是VLAN 2和VLAN 3,终端A和终端B属于VLAN 2

终端C 和终端D属于VLAN 3,由三层交换机实现属于同一VLAN的终端之间的通信过程和属于不同VLAN的终端之间的通信过程

3.2 实验原理

三层交换机具有二层交换功能和三层路由功能。二层交换功能用于实现同一VLAN终端之间的通信过程。三层路由功能用于实现属于不同VLAN终端之间的通信过程。           

由于三层交换机可以定义大量VLAN,因此,三层交换机的路由模块可以看做是存在大量逻辑接口的路由器,且接口数量可以随着需要定义IP接口的VLAN数量变化而变化                                                                                                                                                                           

3.3 关键命令

以下命令可以用于定义VLAN 2关联的IP接口,并为该IP接口分配IP地址和子网掩码

全局模式

interface vlan 2   //定义VLAN 2对应的IP接口,并进入IP接口配置模式。如果将三层交换机的路由模块看做是路由器,则IP接口等同于路由器的逻辑接口

ip address 192.168.1.254 255.255.255.0  //三层交换机中定义某个VLAN对应的IP接口的前提是,已经在三层交换机中创建VLAN,并已经有端口分配给VLAN。分配给VLAN的端口可以是接入端口,也可以是共享端口

exit

 3.4 配置过程

4 多个三层交换机互连实验

4.1 实验内容

构建如下图所示的网络拓扑。在三层交换机1上创建两个VLAN,分别是VLAN 2和VLAN 3,在三层交换机2上创建两个VLAN 分别是VLAN 4和VLAN 5。

实现属于同一VLAN的两个终端之间的通信过程和属于不同VLAN的两个终端之间的通信过程。

4.2 实验原理

为了实现VLAN 2和VLAN 3 VLAN 4 VLAN 5之间的通信过程,需要创建 一个实现三层交换机1和2互连的VLAN 6

三层交换机1中需要定义VLAN 6对应的IP接口,并为IP接口分配IP地址192.168.6.1和子网掩码255.255.255.0 

对于三层交换机1 通往VLAN 4和VLAN 5传输路径上的下一跳是三层交换机2中VLAN 6对应的IP接口

对于三层交换机2 通过VLAN 2 和VLAN 3传输路径上的下一条是三层交换机1中VLAN 6对应的IP接口

三层交换机1 和 2路由表中指明通往没有直连的网络的传输路径的路由项可以通过路由协议RIP完成

 

 

 

 

 

发布了122 篇原创文章 · 获赞 58 · 访问量 4万+

Guess you like

Origin blog.csdn.net/qq_39112646/article/details/104069295