首页 > 其他分享 >5.31

5.31

时间:2023-06-11 09:02:18浏览次数:18  
标签:VLAN S2 Fa0 vlan 5.31 config S1

实验一vlan的创建与划分

一、实验目的: 

1.了解vlan的工作原理;

2.学习基于端口划分vlan的方法;

3.了解跨交换机的相同vlan之间的通信;

4.进一步学习交换机端口的配置命令。

二、实验原理:

VLAN(Virtual Local Area Network)即虚拟局域网,是一种通过将局域网内的设备逻辑地而不是物理地划分成一个个网段从而实现虚拟工作组的新兴技术。

VLAN技术允许网络管理者将一个物理的LAN逻辑地划分成不同的广播域(或称虚拟LAN,即VLAN),每一个VLAN都包含一组有着相同需求的计算机工作站,与物理上形成的LAN有着相同的属性。但由于它是逻辑地而不是物理地划分,所以同一个VLAN内的各个工作站无须被放置在同一个物理空间里,即这些工作站不一定属于同一个物理LAN网段。一个VLAN内部的广播和单播流量都不会转发到其他VLAN中,从而有助于控制流量、减少设备投资、简化网络管理、提高网络的安全性。

   VLAN是为解决以太网的广播问题和安全性而提出的一种协议,它在以太网帧的基础上增加了VLAN头,用VLAN ID把用户划分为更小的工作组,限制不同工作组间的用户二层互访,每个工作组就是一个虚拟局域网。虚拟局域网的好处是可以限制广播范围,并能够形成虚拟工作组,动态管理网络。

三、实验设备:

   计算机,交换机

四、实验拓扑图(拓扑图上要标明所用交换机型号、所用交换机的端口号以及各主机配置的IP地址

1.同一个交换机上的vlan划分:将四台计算机连接到一台交换机上,将其中两台计算机划分到一个vlan中,另两台计算机划分到另一个vlan中,验证同vlan中的计算机和不同vlan中的计算机之间的通信。注:vlan的名字不能用vlan1。

  1. 进行跨交换机的相同vlan之间的计算机和不同vlan之间的计算机的通信实验。

 

五、实验过程(配置过程):

 

1.同一个交换机上的vlan划分

创建虚拟局域网VLAN11和VLAN22

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S1

S1(config)#vlan 22

S1(config-vlan)#name T22

S1(config-vlan)#exit

S1(config)# vlan 11

S1(config-vlan)#name T11

S1(config-vlan)#exit

S1(config)#exit

S1#

 

验证测试:验证虚拟局域网VLAN11和VLAN22已创建成功

 S1#show vlan

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8

                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gig0/1, Gig0/2

11   T11                              active    

22   T22                              active    

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active  

 

 

为局域网VLAN11和VLAN22分配端口

S1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#interface vlan 11

S1(config-if)#

%LINK-5-CHANGED: Interface Vlan11, changed state to up

S1(config-if)#interface fastethernet 0/1

S1(config-if)#switchport access vlan 11

S1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan11, changed state to up

S1(config-if)#exit

S1(config)#interface vlan 11

S1(config-if)#interface fastethernet 0/2

S1(config-if)#switchport access vlan 11

S1(config-if)#exit

S1(config)#interface vlan 22

S1(config-if)#

%LINK-5-CHANGED: Interface Vlan22, changed state to up

S1(config-if)#interface fastethernet 0/3

S1(config-if)#switchport access vlan 22

S1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan22, changed state to up

 

 S1(config-if)#exit

S1(config)#interface vlan 22

S1(config-if)#interface fastethernet 0/4

S1(config-if)#switchport access vlan 22

S1(config-if)#exit

 

 

验证测试:验证为VLAN11和VLAN22分配端口成功

S1#show vlan

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8

                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gig0/1, Gig0/2

11   T11                              active    Fa0/1, Fa0/2

22   T22                              active    Fa0/3, Fa0/4

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active   

划分虚拟局域网之前网络情况:

 

划分虚拟局域网之后网络情况:

 

 

 

2、进行跨交换机的相同vlan之间的计算机的通信实验。

 

在S1上创建虚拟局域网VLAN11和VLAN22并为之分配端口

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname S1

S1(config)#vlan 11

S1(config-vlan)#name T11

S1(config-vlan)#exit

S1(config)#interface fastethernet 0/2

S1(config-if)#switchport access vlan 11

S1(config-if)#exit

S1#show vlan id 11

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

11   T11                              active    Fa0/2

 

S1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#vlan 22

S1(config-vlan)#name T22

S1(config-vlan)#exit

S1(config)#interface fastethernet0/3

S1(config-if)#switchport access vlan 22

S1(config-if)#exit

S1(config)#exit

S1#

%SYS-5-CONFIG_I: Configured from console by console

S1#show vlan id 22

 

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

22   T22                              active    Fa0/3

 

将S1的F0/1端口设置为trunk模式

S1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

S1(config)#interface fastethernet0/1

S1(config-if)#switchport mode trunk

S1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

S1(config-if)#exit

S1(config)#exit

S1#

%SYS-5-CONFIG_I: Configured from console by console

S1#show interface fastethernet0/1 switchport

Name: Fa0/1

Switchport: Enabled

Administrative Mode: trunk

Operational Mode: trunk

Administrative Trunking Encapsulation: dot1q

Operational Trunking Encapsulation: dot1q

Negotiation of Trunking: On

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default)

Voice VLAN: none

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none

Administrative private-vlan trunk encapsulation: dot1q

Administrative private-vlan trunk normal VLANs: none

Administrative private-vlan trunk private VLANs: none

Operational private-vlan: none

Trunking VLANs Enabled: All

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

Capture VLANs Allowed: ALL

Protected: false

--More--

 

在S2上创建虚拟局域网VLAN11和VLAN22并为之分配端口

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#host S2

S2(config)#vlan 11

S2(config-vlan)#name T11

S2(config-vlan)#exit

S2(config)#exit

S2#

%SYS-5-CONFIG_I: Configured from console by console

S2#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

S2(config)#interface fastethernet0/4

S2(config-if)#switchport access vlan 11

S2(config-if)#exit

S2(config)#exit

S2#

%SYS-5-CONFIG_I: Configured from console by console

S2#show vlan id 11

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

11   T11                              active    Fa0/4

 

S2#config

Configuring from terminal, memory, or network [terminal]?

 

 

 

Enter configuration commands, one per line. End with CNTL/Z.

S2(config)#vlan 22

S2(config-vlan)#name T22

S2(config-vlan)#exit

S2(config)#interface fastethernet0/5

S2(config-if)#switchport access vlan 22

S2(config-if)#exit

S2(config)#exit

S2#

%SYS-5-CONFIG_I: Configured from console by console

S2#show vlan id 22

VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

22   T22                              active    Fa0/5

 

将S2的F0/1端口设置为trunk模式

S2#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line. End with CNTL/Z.

S2(config)#interface fastethernet0/1

S2(config-if)#switchport mode trunk

S2(config-if)#exit

S2(config)#exit

S2#show interfaces fastethernet 0/1 switchport

Name: Fa0/1

Switchport: Enabled

Administrative Mode: trunk

Operational Mode: trunk

Administrative Trunking Encapsulation: dot1q

Operational Trunking Encapsulation: dot1q

Negotiation of Trunking: On

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default)

Voice VLAN: none

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Administrative private-vlan trunk native VLAN: none

Administrative private-vlan trunk encapsulation: dot1q

Administrative private-vlan trunk normal VLANs: none

Administrative private-vlan trunk private VLANs: none

Operational private-vlan: none

Trunking VLANs Enabled: All

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

Capture VLANs Allowed: ALL

Protected: false

 --More--

 

划分虚拟局域网之前网络情况:

 

划分虚拟局域网之后网络情况:

标签:VLAN,S2,Fa0,vlan,5.31,config,S1
From: https://www.cnblogs.com/ruipengli/p/17472474.html

相关文章

  • 5.31学习总结
    flex-directionflex-direction 属性指定了弹性子元素在父容器中的位置。语法flex-direction:row|row-reverse|column|column-reverseflex-direction的值有:row:横向从左到右排列(左对齐),默认的排列方式。row-reverse:反转横向排列(右对齐,从后往前排,最后一项排在最前面。......
  • 5.31
    代码行数:200H学习内容:完成python提交大作业。学习计划:期末完成及格fromtkinterimportTk,Label,Button,Entryimportxlwtasxlwtfromlxmlimportetreeimportrequestsimportpandasaspdimportmatplotlib.pyplotaspltdeftwo_color_ball():url=entry.get()......
  • 2023.5.31——软件工程站立会议(阶段二)
    站立会议内容:1.整个项目预期的任务量:目前已经花的时间:剩余的时间:2.任务看板照片: 3.团队照片: 4.产品状态:最新做好的功能:正在完成中5.燃尽图:......
  • 2023.5.31——软件工程日报
    所花时间(包括上课):6h代码量(行):0行博客量(篇):1篇今天,上午学习,下午考数据库。我了解到的知识点:1.了解了一些数据库的知识;2.了解了一些python的知识;3.了解了一些英语知识;5.了解了一些Javaweb的知识;4.了解了一些数学建模的知识;6.了解了一些计算机网络的知识;......
  • 2023.5.31 Linux系统⽤户管理
    1.⽤户基本概述1.1⽤户相关的命令1.2⽤户创建的原理2.⽤户密码管理3.组的基本管理4.⽤户身份切换5.⽤户身份提权6.⽇志相关审计1.⽤户基本概述Linu属于多⽤户操作系统,在windows中,可以创建多个⽤户,但不允许同⼀时间多个⽤户进⾏系统登陆,但是Linux可以同时⽀持多个⽤户同时登陆......
  • 2023.5.31-Linux系统基本权限
    02.Linux系统基本权限1.权限修改命令chmod2.属主属组修改命令chown3.基础权限设置案例Linux中的⽂件或⽬录的权限和⽤户及⽤户组关联很⼤,Linux中每个⽂件或⽬录都有⼀组共9个基础权限位,每三个字符被分为⼀组,他们分别是属主权限位(占三个字符)、属组权限位(占三个字符)、其他⽤户权......
  • 5.31每日总结
    今天又重新弄了弄周一考试的题,然后找了几个认识的朋友下载了以下简单测试。<%@pageimport="wangzhan.Thesql"%><%@pageimport="wangzhan.Pd_P_assignment"%><%@pageimport="wangzhan.Pd_S_assignment"%><%@pagelanguage="java"cont......
  • 2023.5.31每日总结
    <%--CreatedbyIntelliJIDEA.User:王磊Date:2023/5/29Time:15:52TochangethistemplateuseFile|Settings|FileTemplates.--%><%@pageimport="softwareengin.teacher"%><%@pageimport="softwareengin.AllMet......
  • 每日总结-23.5.31
    <%@pageimport="java.util.Calendar"%><%@pagelanguage="java"contentType="text/html;charset=UTF-8"pageEncoding="UTF-8"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDHTML4.01Transitional......
  • 5.31 保研夏令营第一拒
    保研术语说明:rk:排位,即绩点排名oq:overqualified比如清北大佬投西电寄了,吉大SE没入营,呜呜呜,听说卡rk1,不知道是不是oq了,但是还是很难受,不过幸亏吉大老师安慰我,等9.28之后掉甲给大家推荐一下这位老师!......