Small experimental compositions (VLAN + Trunk Link Layer + exchange)

In this experiment a total of three experimental groups consisting of small, respectively, from simple to difficult VLAN setting, a Trunk relay link and the final three switches disposed.

A, VLAN settings (need all the pc in the same network segment)

VLAN (Virtual Local Area Network) in Chinese named "virtual LAN." Virtual LAN (VLAN) is a set of logical devices and users, and users of these devices is not limited to physical location, the function may be based on factors, sectors and applications organize them together, communication between each other if they are the same segment as the eponymous virtual local area network.
In a computer network, a Layer 2 network may be divided into a plurality of different broadcast domains, a broadcast domain corresponding to a specific user group, these different default broadcast domains are isolated. You want to communicate, via one or more routers require different broadcast domains. This is called a broadcast domain VLAN.

1, the arrangement vlan experimental environment

Drag the icon bar on the left by a router and three pc machine and connected through a network cable
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
, right-click on the route, select "configure" modify settings, "change hostname" to modify the host name, "change sympol" Modify Symbol
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-1 Select "configure" modify settings, turn into the second, third tab, the specific modification method shown below

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Note: If you must have never been started in the second add capacity option card, a nice start in case if you need to enter "erase flash" initialize the disk in the default privileged mode can be read properly, otherwise it is impossible to read of
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-2 Select "change hostname" modify the host name,

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-3 "change sympol" edit symbol to edit the switch router

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2, the parameter setting switch

Remarks 2-1 keys, add notes for the device, to facilitate post when the memory modify the parameters, as shown in detail Remarks

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-2 双击sw交换机,输入“configure termimal”进入全局模式,接着输入“vlan 10,20”创建vlan10、20两个广播域,最后输入“no ip routing”关闭路由功能(因为本镜像原本是路由镜像,现在改为交换机,所以仍然具有路由功能需要关闭)

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-3 创建完vlan10、20后通过输入“do show vlan-switch brief”查看已有vlan,此时vlan10、20并不包含任何接口需要我们手动进行添加

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-4 输入“interface fastEthernet 1/0”进入f1/0接口,接着输入“switchport mode access”将接口设置为接入链路,最后根据之前的备注输入“switchport access vlan 10”将f1/0划入vlan10中

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-5 输入“interface range fastEthernet 1/1 -2”同时进入f1/1、f1/2接口,并根据备注将这两个接口一同划入vlan20中

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-6 输入end返回特权模式,接着输入“show vlan-switch brief”查看vlan表,检查是否已经将三个端口分别添加完毕。

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

3、PC机ip地址设置及互通

3-1 入三台pc机,根据备注进行ip地址的添加

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

3-2进行互通实验,结果如图

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

二、Trunk链路的设置与实际使用(需所有pc机在同一网段下)

在路由/交换领域,VLAN的中继端口叫做Trunk。Trunk技术用在交换机之间互连,使不同VLAN通过共享链路与其它交换机中的相同VLAN通信。Trunk不能实现不同VLAN间通信,需要通过三层设备(路由/三层交换机)来实现。

1、第二台路由和pc机的设置

1-1保证第一次实验完成后的拓扑结构不变,新增加一台路由以及两台新的pc机,如图

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-2为第二台路由更改符号、名称以及添加磁盘空间(具体操作同第一个路由,不再过多赘述)接着双击sw2,在全局模式中创建vlan10、20

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-3根据备注将接口划分进相应的vlan广播域中

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-4最后就是Trunk链路的设置,进入f1/3的接口,先输入“switchport trunk encapsulation dot1q”将封装模式设置为dot1q,接着输入“switchport mode trunk”将该接口设置为Trunk链路,并输入“do show interface fastEthernet 1/3”查看接口详情是否设置正确,最后返回sw1,将同一接口进行Trunk链路的设置(设置方法同理)

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-5进入新增的两台pc机分别进行ip的设置

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-6根据之前备注可知pc1、pc4分属同一网段同一广播域的不同交换机下,pc2、3和pc5分属同一网段同一广播域的不同交换机下,依次进行互通实验

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

三、三层交换机下进行数据互通实验(不同ip网段,不同vlan之间)

三层交换机就是具有部分路由器功能的交换机,工作在OSI网络标准模型的第三层:网络层。三层交换机的最重要目的是加快大型局域网内部的数据交换,所具有的路由功能也是为这目的服务的,能够做到一次路由,多次转发。

1、三层路由等设备的设置

1-1删除之前的拓扑结构,重新拖入两台路由和两台pc机,将两台按照之前设置,将其中一台的符号改为三层交换机(其余跟之前一样)

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-2对中间sw1依次进行设置,首次关闭路由功能(这里需要关闭),然后进行vlan域的划分,最后进行Trunk链路的设置。具体设置方法同前一个实验,设置结果如图

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-3进入sw2,这里的路由功能千万不能关闭(原本就是路由镜像改过来的,本身就是三层路由),进入全局模式后依次进行vlan的创建以及f1/0接口Trunk的设置

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-4和之前二层路由不同的是,这里不是将接口划入vlan中,而是将vlan看做一个虚拟接口为其设置ip,作为pc机的网关使用。在全局模式下,输入“interface vlan 10”进入vlan10虚口,接着输入“ip address”为该虚口指定ip,vlan20同理

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

1-5 final in global mode, enter "do show ip interface brief" to see ip interface to the table, check for correct entry

Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2, set the pc as well as cross-segment, cross-domain interoperability test broadcast

2-1 ip designated as two clients

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)

2-2 interoperability experiments

Small experimental compositions (VLAN + Trunk Link Layer + exchange)
Small experimental compositions (VLAN + Trunk Link Layer + exchange)
So far, three experiments are perfect ending.

Guess you like

Origin blog.51cto.com/14484404/2427844