当前位置: 首页 > news >正文

Cisco Packer Tracer 组建虚拟局域网(VLAN)

 实验目的:

1、安装Cisco Packer Tracer

2、了解Cisco Packet Tracer软件界面功能

3、利用Cisco Packet Tracer 组建虚拟局域网(VLAN)

实验设备:

Switch_2960   2台;PC 4台;直连线

实验步骤:

1.选择网络设备

2.选择交换机

3.将其拖入到面板中

4.选择端设备

5.在端设备选项中选择PC并拖入到面板中

6.选择连接选项

7.可以选择直通线,将两台PC的FastEthernet口连接到交换机,选择交叉线连接两台交换机。也可以让系统自动选择连接的线类型

8.连接好后设备连线出将会变为绿色

9.选择窗体右边菜单place Note ,在窗体内单击,可以输入文字备注

10.配置相关参数

Switch0:

Switch>enableSwitch#configure terminalSwitch(config)#vlan 10   Switch(config-vlan)#exitSwitch(config)#vlan 20Switch(config-vlan)#exitSwitch(config)#interface fastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#exitSwitch(config)#interface fastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 20Switch(config-if)#exitSwitch(config)#interface fastEthernet 0/3Switch(config-if)#switchport mode trunkSwitch(config-if)#switchport trunk allowed vlan allSwitch(config-if)#exitSwitch(config)#exitSwitch#write

Switch1:

Switch>enableSwitch#configure terminalSwitch(config)#hostname Sw2Sw2(config)#vlan 10   Sw2(config-vlan)#exitSw2(config)#vlan 20Sw2(config-vlan)#exitSw2(config)#interface fastEthernet 0/1Sw2(config-if)#switchport mode accessSw2(config-if)#switchport access vlan 10Sw2(config-if)#exitSw2(config)#interface fastEthernet 0/2Sw2(config-if)#switchport mode accessSw2(config-if)#switchport access vlan 20Sw2(config-if)#exitSw2(config)#interface fastEthernet 0/3Sw2(config-if)#switchport mode trunkSw2(config-if)#switchport trunk allowed vlan allSw2(config-if)#exitSwitch(config)#exitSw2#write

11.配置pc机地址

PC0

       IP:       192.168.1.10

       Submask:    255.255.255.0

       Gateway:     192.168.1.1

PC1

       IP:       192.168.1.11

       Submask:    255.255.255.0

       Gateway:     192.168.1.1

PC2

       IP:       192.168.1.12

       Submask:    255.255.255.0

       Gateway:     192.168.1.1

PC3

       IP:       192.168.1.13

       Submask:    255.255.255.0

       Gateway:     192.168.1.1

11、测试电脑连通性

结论:

相同vlan之间可以通信,不同vlan之间不可以通信

思科交换机路由器通过命令行接口(Command Line Interface, CLI) 进行配置操作的基本方法如下:

1. 查看用户配置模式下的基本命令。

    当进入交换机的“命令行”界面时,按一下键盘上的“Enter”键就进入了交换机的用户配置模式。在该模式下可以查看交换机的软、硬件版本信息,并进行简单的测试。它的提示符为“>”,在该模式下可用的命令比较少,使用“?”命令可显示该模式下的所有命令。

Switch> ?

 Exec commands:

<1-99> Session number to resume

connect Open a terminal connection

disconnect Disconnect an existing network connection

enable Turn on privileged commands

exit Exit from the EXEC

logout Exit from the EXEC

ping Send echo messages

resume Resume an active network connection

show Show running system information

telnet Open a telnet connection

terminal Set terminal line parameters

traceroute Trace route to destination

2. 查看特权模式下的基本命令。

    特权模式下可对交换机的配置文件进行管理,查看交换机的配置信息,进行网络的测试和调试等。在用户配置模式下键入“enable”命令进入特权模式。特权模式的提示符为“#”。使用“?”命令可查看该模式下的所有命令。

Switch>

Switch>enable

Switch#?

Exec commands:

<1-99> Session number to resume

clear Reset functions

clock Manage the system clock

configure Enter configuration mode

connect Open a terminal connection

copy Copy from one file to another

debug Debugging functions (see also 'undebug')

delete Delete a file

dir List files on a filesystem

disable Turn off privileged commands

disconnect Disconnect an existing network connection

enable Turn on privileged commands

erase Erase a filesystem

exit Exit from the EXEC

logout Exit from the EXEC

more Display the contents of a file

no Disable debugging informations

ping Send echo messages

reload Halt and perform a cold restart

resume Resume an active network connection

setup Run the SETUP command facility

show Show running system information

telnet Open a telnet connection

terminal Set terminal line parameters

traceroute Trace route to destination

undebug Disable debugging functions (see also 'debug')

vlan Configure VLAN parameters

write Write running configuration to memory, network, or terminal

3. 查看全局配置模式下基本命令。

全局配置模式下可以配置交换机的全局性参数。在特权模式下输“configure terminal”或者“conf t”就可以进入全局配置模式。全局配置模式也称为“config”模式,使用“?”命令可查看改模式下的所有命令。

Switch# conf t

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

Switch(config)#?

Configure commands:

banner Define a login banner

boot Boot Commands

cdp Global CDP configuration subcommands

clock Configure time-of-day clock

do To run exec commands in config mode

enable Modify enable password parameters

end Exit from configure mode

exit Exit from configure mode

hostname Set system's network name

interface Select an interface to configure

ip Global IP configuration subcommands

line Configure a terminal line

mac-address-table Configure the MAC address table

no Negate a command or set its defaults

port-channel EtherChannel configuration

service Modify use of network based services

spanning-tree Spanning Tree Subsystem

username Establish User Name Authentication

vlan Vlan commands

vtp Configure global VTP state

4. 查看端口配置模式下的命令。

端口配置模式下可以对交换机的端口进行参数配置。一般交换机都拥有很多窗口,还可以添加不同的模块。默认情况下,交换机的所有端口都为以太网接口类型。进入端口配置模式,可以使用“interface Ethernet 0/1”命令。其中, interface 为进入端口命令; ethernet 表示以太网; 0/1 表示端口编号。使用“?”可查看该模式下的所有命令。

Switch(config)#interface fastEthernet 0/1

Switch(config-if)#?

cdp Global CDP configuration subcommands

channel-group Etherchannel/port bundling configuration

channel-protocol Select the channel protocol (LACP, PAgP)

description Interface specific description

duplex Configure duplex operation.

exit Exit from interface configuration mode

mac-address Manually set interface MAC address

no Negate a command or set its defaults

shutdown Shutdown the selected interface

spanning-tree Spanning Tree Subsystem

speed Configure speed operation.

switchport Set switching mode characteristics

Switch(config-if)#

5. 模式之间的切换。

交换机各模式之间的切换可通过“exit”和“end”命令完成。

Switch>enable

Switch#configure terminal

Switch(config)#interface fastEthernet 0/5

Switch(config-if)#exit

Switch(config)#end

Switch#

!进入特权模式

!进入全局配置模式

!进入交换机 F 0/5 的接口配置模式

!退回到上一级操作模式

!直接退回到特权模式

6. 撤销某个命令。

no

http://www.xdnf.cn/news/699535.html

相关文章:

  • 【前端】【Jquery】一篇文章学习Jquery所有知识点
  • keepalived两台设备同时出现VIP问题
  • MySql--explain的用法
  • 【Linux网络篇】:简单的TCP网络程序编写以及相关内容的扩展
  • css样式块重复调用
  • 楼宇自控系统重塑建筑设备管理:告别低效,迈向智能管理时代
  • 华为OD机试真题——书籍叠放(2025A卷:200分)Java/python/JavaScript/C/C++/GO最佳实现
  • Linux系统之cal命令的基本使用
  • 国有企业采购方式及适用情形
  • Java集合进阶
  • C++补充基础小知识:什么是接口类 和 抽象类?为什么要继承?
  • 线程的生命周期?怎么终止线程?线程和线程池有什么区别?如何创建线程池?说一下 ThreadPoolExecutor 的参数含义?
  • yolov12毕设前置知识准备 1
  • Linux基本指令/上
  • Python常用模块实用指南
  • Python人工智能算法学习 禁忌搜索算法求解旅行商问题(TSP)的研究与实现
  • .net Winfrom 如何将窗口设置为MDI容器
  • QGIS新手教程2:线图层与多边形图层基础操作指南(点线互转、中心点提取与WKT导出)
  • Git:现代软件开发的基石——原理、实践与行业智慧·优雅草卓伊凡
  • go实例化结构体的方式
  • 【C/C++】设计模式之工厂模式:从简单到抽象的演进
  • 《接口和抽象类到底怎么选?设计原则与经典误区解析》
  • com.alibaba.fastjson.JSONException: default constructor not found.
  • 【25-cv-05887、25-cv-05893、25-cv-05897】一张图片连发3案!
  • 【Python实例】读取/处理 Landsat LST数据
  • Three.js引擎基础
  • HIS系统——药库管理模块功能解析
  • 【操作系统】内存管理知识点深度解析
  • 直播框架:基础知识点
  • 【基础题库回复四则】2022-1-26