交换机的配置命令总结
交换机配置命令大全

交换机配置命令大全交换机是网络中非常重要的设备,它可以实现局域网内计算机之间的数据传输和通信。
在进行交换机的配置时,我们需要掌握一些基本的配置命令,以确保交换机能够正常运行并满足网络的需求。
下面将介绍一些常用的交换机配置命令,希望对大家有所帮助。
1. 设置交换机的主机名。
在配置交换机之前,我们首先需要设置交换机的主机名,以便在网络中进行识别和管理。
我们可以通过以下命令来设置交换机的主机名:```。
Switch(config)#hostname S1。
```。
这条命令将交换机的主机名设置为S1,您也可以根据实际情况进行修改。
2. 配置交换机的管理IP地址。
为了实现对交换机的远程管理,我们需要为交换机配置一个IP地址。
我们可以通过以下命令来配置交换机的管理IP地址:```。
Switch(config)#interface vlan 1。
Switch(config-if)#ip address 192.168.1.1 255.255.255.0。
Switch(config-if)#no shutdown。
```。
这条命令将VLAN 1接口的IP地址设置为192.168.1.1,子网掩码为255.255.255.0,并启用该接口。
3. 配置交换机端口。
在实际网络中,我们需要对交换机的端口进行配置,以满足不同设备的连接需求。
以下是一些常用的端口配置命令:```。
Switch(config)#interface fastethernet 0/1。
Switch(config-if)#switchport mode access。
Switch(config-if)#switchport access vlan 10。
```。
这条命令将FastEthernet 0/1端口设置为接入模式,并将该端口划分到VLAN 10中。
4. 配置交换机的VLAN。
VLAN是虚拟局域网的缩写,它可以将一个物理局域网划分成多个逻辑上的局域网。
交换机的配置与管理命令

交换机的配置与管理实验目标●掌握交换机基本信息的配置管理。
实验背景●某公司新进一批交换机,在投入网络以后要进行初始配置与管理,你作为网络管理员,对交换机进行基本的配置与管理。
技术原理●交换机的管理方式基本分为两种:带内管理和带外管理。
●通过交换机的Console端口管理交换机属于带外管理;这种管理方式不占用交换机的网络端口,第一次配置交换机必须利用Console端口进行配置。
●通过Telnet、拨号等方式属于带内管理。
●交换机的命令行操作模式主要包括:●用户模式Switch>●特权模式Switch#●全局配置模式Switch(config)#●端口模式Switch(config-if)#基本配置:实验步骤:●新建Packet Tracer拓扑图●了解交换机命令行1、模式切换命令:●进入特权模式(en)●进入全局配置模式(conf t)●进入交换机端口视图模式(int f0/1)●返回到上级模式(exit)●从全局以下模式返回到特权模式(end或者快捷键ctrl+z)2、常用快捷操作命令●帮助信息(如? 、co?、copy?)●命令简写(如conf t)●命令自动补全(Tab)●快捷键(ctrl+c中断测试,ctrl+z退回到特权视图)●Reload重启。
(在特权模式下)3、基本命令●查看交换机信息(show)●设置交换机名称(hostname X)●配置交换机的端口参数(speed 、duplex、优化和启用禁用)实验设备Switch_2960 1台;PC 1台;配置线;PC console端口Switch>enableSwitch#conf tSwitch(config)#hostname XSwitch(config)#interface fa 0/1Switch(config-if)#end使用tab键,命令简写,帮助命令?高级配置:实验步骤:●新建Packet Tracer拓扑图●了解交换机端口配置命令行●修改交换机名称(hostname X)●配置交换机端口参数(speed,duplex)●查看交换机版本信息(show version)●查看当前生效的配置信息(show running-config)●查看保存在NVRAM中的启动配置信息(show startup-config)●查看端口信息Switch#show interface●查看交换机的MAC地址表Switch#show mac-address-table●选择某个端口Switch(config)# interface type mod/port (type表示端口类型,通常有ethernet、Fastethernet、Gigabitethernet)(mod表示端口所在的模块,port表示在该模块中的编号)例如interface fastethernet0/1●选择多个端口Switch(config)#interface type mod/startport-endport●设置端口通信速度Switch(config-if)#speed [10/100/auto]●设置端口单双工模式Switch(config-if)#duplex [half/full/auto]●交换机、路由器中有很多密码,设置对这些密码可以有效的提高设备的安全性。
交换机的基本配置查看命令(一)

命令行帮助机制1.“?”是配置交换机的好帮手,主要用于命令提示。
如:要显示全局模式下的所有命令以及命令注解。
switch(config)# ?如:显示命令后接参数或配置内容。
switch(config)# int ?如:忘记某个命令该如何写时,“?”可以帮助列出所有可能命令的列表以供选择。
switch>e?enable exit2.Tab键,在输入配置命令是,可以使用简写的方式,如可以输入int来代替interface,同样也可以灵活使用Tab键来补全命令,如下所示:switch(config)#int \\这里按下“Tab”键switch(config)#interface \\自动补齐命令3.常用快捷组合键<Ctrl+A> 光标移动到命令行的开始位置。
<Ctrl+E>光标移动到命令行的结束位置。
用键盘的“↑”“↓”键可以调出刚刚输入的几个命令。
常用命令介绍1.用户模式进入特权模式命令 enable (可以简写为en)switch>enableswitch>#2.特权模式进入全局配置模式命令 config terminal (可以简写为 conf t)switch#config terminalswitch(config)#3.全局配置模式进入接口模式命令 interface fastethernet 0/1(可简写为int f0/1)其中:“interface”:进入接口模式所必须的关键字。
“fastethernet”:接口类型,fastethernet表示快速以太网,即百兆位以太网。
在接口类型中常见的还有ethernet(简写e)表示十兆位以太网接口;gigabitethernet(简写gi)表示吉比特以太网接口类型,也就是千兆位以太网接口;tengigabitethernet(简写te)表示十吉比特以太网接口类型,也就是万兆位以太网接口。
switch(config)#interface fastethernet 0/1switch(config-if)#4.模式退出命令从特权模式回到用户模式命令“disable”,其他无论在哪个模式,只要输入命令“exit”就能回到前一个模式;在全局或是接口模式,只要输入命令“end”或按下“Ctrl+Z”组合键都能回到特权模式。
华为交换机配置命令大全

华为交换机配置命令大全华为交换机是一种高性能、高可靠的数据通信设备,广泛应用于各种网络环境中。
为了更好地使用华为交换机,我们需要了解一些基本的配置命令。
本文将为大家详细介绍华为交换机的配置命令大全,帮助大家更好地了解和使用华为交换机。
1. 登录华为交换机。
首先,我们需要登录华为交换机进行配置。
一般来说,我们可以通过串口、Telnet或SSH方式登录交换机。
以SSH方式登录为例,我们可以使用以下命令:```shell。
ssh -l username 192.168.1.1。
```。
其中,username为登录用户名,192.168.1.1为交换机的IP地址。
登录成功后,我们需要输入密码进行验证。
2. 查看交换机当前配置。
在登录成功后,我们可以使用以下命令查看交换机的当前配置信息:```shell。
display current-configuration。
```。
这条命令可以显示出交换机当前的全部配置信息,包括接口配置、VLAN配置、路由配置等。
3. 配置交换机接口。
接下来,我们可以对交换机的接口进行配置。
比如,我们可以通过以下命令配置一个VLAN接口:```shell。
interface Vlanif1。
ip address 192.168.1.1 255.255.255.0。
```。
这条命令将为VLAN接口Vlanif1配置IP地址为192.168.1.1,子网掩码为255.255.255.0。
4. 配置交换机VLAN。
除了配置接口,我们还可以对交换机的VLAN进行配置。
比如,我们可以使用以下命令创建一个VLAN:```shell。
vlan 10。
```。
这条命令将创建一个VLAN ID为10的VLAN。
5. 配置交换机路由。
在需要进行路由配置时,我们可以使用以下命令添加静态路由:```shell。
ip route-static 0.0.0.0 0.0.0.0 192.168.1.254。
```。
路由与交换的配置命令

1、switch>:用户模式——能查看版本信息2、在用户模式下输入enable会进特权模式——它能保存、修改、删除这一系列的配置switch>enable→switch#:特权模式,下面有一些命令就在此命令下完成:①、删除vlan的文件配置:delete flash:vlan.dat②、删除vlan中的配置文件:erase startup-config③、查看vlan配置文件是否被删除及vlan的是否创建:show vlan④、重新启动交换机:reload⑤、查看当前交换机的配置:show running-config⑥、保存对交换机所配置的内容,即是保存在Nvram:copy running-configstartup-config⑦、检查Nvram的内容:show startup-config⑧、检查虚拟接口 vlan的特征:show interface vlan 1⑨、查看接口IP的属性:show ip interface vlan 1⑩、查看cisco的信息:show version⑪、查看交换机所用快速以太网接口的默认属性:show interface fastethernet 0/18⑫、查看闪存目录中的内容:show flash 或dir flash3、在特权模式下输入configure terninal后会进入全局模式,一切的配置必须在此模式中进行配置Switch#configure terninal→switchp(config)#:全局模式①、配置路由器设备的名字:switch(config)#hostname + 交换机的名字②、配置进入特权模式的密码,即使能密码:switch(config)#enable password +密码③、配置非明文密码:switch(config)#enable secret + 密码4、为交换机配置console口①、进入现成配置模式,即进入console口:switch(config)# line console 0②、设置密码(重新启动时需要此密码):switch(config-line)#password + 密码③、允许登录:switch(config-line)#login5、配置远程登录的密码:①、首先要配置使能密码②、允许让几个人登录:switch(config)#line vty 0 4(即允许五个登录)③、设置密码:switch(config-line)#password + 密码④、允许远程登录:switchp(config-line)#login6、在全局模式下的有关命令①对所有密码进行加密:switch(config)#service password-encryption②、不解析错误的命令:switch(config)#no ip domain-lookup7、创建vlan(2—1001,注vlan 1既不可以创建,也不可以删除)①、创建vlan :vlan + 要创建vlan的值②、给vlan取名:switch(config-vlan)#name + 名字(此步可以不要)③、把PC与交换机相连的端口添加到相应的vlan中:a、Switch(config)#interface + 端口b、Switch(config-if)#switchport access vlan + 相应vlan的值④、需要传递多个vlan信息就要打中继口,即trunka、switch(config)#interface + 交换机另一端口b、switch(config-if)#switchport mode trunk8、传统vlan 的通信(1)、router的配置①、为接口配置IP地址(该IP是相应vlan的PC网关)②、激活端口:no shutdown(2)、switch的配置①、创建vlan,将PC端口划入相应vlan②、将switch与router相连的端口划入相应的vlan(3) 、PC的配置:就是给PC配置IP,注PC的默认网关与router的IP相同,网关相同9、单臂路由实现vlan的通信(1)router配置①、添加子接口:interface f0/0.1(此处有多少个vlan就添加多少个子接口)②、将子接口封装到相应的vlan:encapsulation dot + 相应vlan的值③、将子接口配置IP:ip add +ip地址 + 子网掩码④、激活物理接口:no shutdown(2)、switch的配置①、创建 vlan,交PC的端口划入到相应vlan②、与router相连的端口打trunk(3)、配置PC的IP9、三层交换(1)、配置三层交换①、启用三层交换:(config)#ip routing②、创建vlan:(config)# vlan + 要创建vlan的值③、把相应的vlan配置IPa、指定一个vlan:(config)#interface vlan + vlan相应的值c、配置IP:(config-if)#ip add + ip + 子网掩码(2)、配置switch①、每个交换机创建vlan②、把端口划分到相应的vlan中③、打中继口(trunk)Show命令1、show version 这个命令可以查看IOS版本号,已启动时间,Flash中的IOS 的文件名,router里面共有什么端口,寄存器的值等等。
交换机命令大全

交换机配置命令华为,思科,北电,迈普等配置命令各有不同,以下先以思科设备为例:switch> 用户模式1:进入特权模式 enableswitch> enableswitch#2:进入全局配置模式 configure terminalswitch> enableswitch#configure terminalswitch(conf)#3:交换机命名 hostname aptech2950 以aptech2950为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使能口令 enable password cisco 以cisco为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密码 enable secret ciscolab 以cicsolab为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscolab6:设置虚拟局域网vlan 1 interface vlan 1 和网关地址switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交换机端口ip和子网掩码aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 设置网关地址7:进入交换机某一端口 interface fastehernet 0/17 以17端口为例switch> enableswitch#configure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#8:查看命令 showswitch> enableswitch# show version 察看系统中的所有版本信息show interface vlan 1 查看交换机有关ip 协议的配置信息show running-configure 查看交换机当前起作用的配置信息show interface fastethernet 0/1 察看交换机1接口具体配置和统计信息show mac-address-table 查看mac地址表show mac-address-table aging-time 查看mac地址表自动老化时间9:交换机恢复出厂默认恢复命令switch> enableswitch# erase startup-configureswitch# reload10:双工模式设置switch> enableswitch#configure terminalswitch2950(conf)#hostname aptch-2950aptech2950(conf)# interface fastehernet 0/17 以17端口为例aptech2950(conf-if)#duplex full/half/auto 有full , half, auto 三个可选项11:cdp相关命令switch> enableswitch# show cdp 查看设备的cdp全局配置信息show cdp interface fastethernet 0/17 查看17端口的cdp配置信息show cdp traffic 查看有关cdp包的统计信息show cdp nerghbors 列出与设备相连的cisco设备12:csico2950的密码恢复拔下交换机电源线。
交换机配置命令大全

交换机配置命令大全交换机配置命令大全1.在基于IOS的交换机上设置主机名/系统名:switch(config)# hostname hostname在基于CLI的交换机上设置主机名/系统名:switch(enable) set system name name-string2.在基于IOS的交换机上设置登录口令:switch(config)# enable password level 1 password在基于CLI的交换机上设置登录口令:switch(enable) set passwordswitch(enable) set enalbepass3.在基于IOS的交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address在基于CLI的交换机上设置远程访问:switch(enable) set interface sc0 ip-address netmask broadcast-addressswitch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.在基于IOS的交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco邻接设备的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]在基于CLI的交换机上启用和浏览CDP信息:switch(enable) set cdp {enable|disable} module/port为了查看Cisco邻接设备的CDP通告信息:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]5.基于IOS的交换机的端口描述:switch(config-if)# description description-string基于CLI的交换机的端口描述:switch(enable)set port name module/number description-string6.在基于IOS的交换机上设置端口速度:switch(config-if)# speed{10|100|auto}在基于CLI的交换机上设置端口速度:switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto}7.在基于IOS的交换机上设置以太网的链路模式:switch(config-if)# duplex {auto|full|half}在基于CLI的交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half}8.在基于IOS的交换机上配置静态VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# end在基于CLI的交换机上配置静态VLAN:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list9. 在基于IOS的交换机上配置VLAN中继线:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation {isl|dotlq} switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list 在基于CLI的交换机上配置VLAN中继线:switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]Vlan-range [isl|dotlq|dotl0|lane|negotiate]10.在基于IOS的交换机上配置VTP管理域:switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交换机上配置VTP管理域:switch(enable) set vtp [domain domain-name]11.在基于IOS的交换机上配置VTP 模式:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password password在基于CLI的交换机上配置VTP 模式:switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password]12. 在基于IOS的交换机上配置VTP版本:switch# vlan databaseswitch(vlan)# vtp v2-mode在基于CLI的交换机上配置VTP版本:switch(enable) set vtp v2 enable13. 在基于IOS的交换机上启动VTP剪裁:switch# vlan databaseswitch(vlan)# vtp pruning在基于CL I 的交换机上启动VTP剪裁:switch(enable) set vtp pruning enable14.在基于IOS的交换机上配置以太信道:switch(config-if)# port group group-number [distribution {source|destination}] 在基于CLI的交换机上配置以太信道: switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto}15.在基于IOS的交换机上调整根路径成本:switch(config-if)# spanning-tree [vlan vlan-list] cost cost在基于CLI的交换机上调整根路径成本:switch(enable) set spantree portcost moudle/port costswitch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list]16.在基于IOS的交换机上调整端口ID:switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority在基于CLI的交换机上调整端口ID:switch(enable) set spantree portpri {mldule/port}priorityswitch(enable) set spantree portvlanpri {module/port}priority [vlans]17. 在基于IOS的交换机上修改STP时钟:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)# spanning-tree [vlan vlan-list] forward-time secondsswitch(config)# spanning-tree [vlan vlan-list] max-age seconds在基于CLI的交换机上修改STP时钟:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]18. 在基于IOS的交换机端口上启用或禁用Port Fast 特征:switch(config-if)#spanning-tree portfast在基于CLI的交换机端口上启用或禁用Port Fast 特征:switch(enable) set spantree portfast {module/port}{enable|disable}19. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征:switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second]在基于CLI的交换机端口上启用或禁用UplinkFast 特征:switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]20. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}]25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf{ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN 分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address ATM(lane-config-databade)# name …30. 创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-mask router(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-name router(config-if)# lane client ethernet elan-namerouter(config-if)# …40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行: router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由:switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP:router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP 域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况:router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录:switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。
交换机的基本配置命令

第二条命令:把fa0/1这个端口划分给VLAN 10 这样配置之后,接在这个端口的所有设备就属于VLAN 10 了。
查看VLAN信息
Switch#show vlan 查看所有VLAN信息
Switch(config-line)#
进入方法:从(config)#模式输入 line+终端标识进入
要记住这些交换机的配置模式,要知道如何进入和退出,也有能看懂当前处于哪个模式下,在所有模式中,输入exit返回上级,输入end或ctrl+z退出。
VLAN的常用配置命令:
交换机没有被划分VLAN的时候,交换机默认只有VLAN1,所有的端口都在VLAN1里面,所以我们是不能创建也不能删除VLAN1的。
Switch#show vlan id 10 查看vlan 10的信息
删除VLAN
switch#vlan database
Switch(vlan)#no vlan 10
删除VLAN 10后,所有分配给VLAN10的端口都变回非活动状态,直到下次再次分配给别的VALN为止。
一个VLAN可以有多个端口,如果要将某个端口从VLAN中删除
进入方法:从#模式输入 vlan database 进入
全局配置模式:
Switch(config)rminal 进入
接口配置模式:
Switch(config-if)#
进入方法:从(config)#模式输入 interface+接口号进入
终端线路配置模式:
第三条命令:创建一个名称为VLAN20的VLAN20
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
交换机的配置
1.登录交换机
Switch>enable 进入特权模式
Switch#configure terminal 进入配置模式
Switch(config)#enable password password 配置使能密码
Switch(config)#line vty 0 4 进入VTY 线路(五个用户)
Switch(conf-line)#password password 配置VTY 密码
Switch(config-line)#login
Switch(conf-line)#exit 退回全局模式
Switch(config)#line console 0 进入console 0 端口下
Switch(conf-line)password password 配置console 0 密码
2.创建VLAN
Switch#confgure terminal
Switch(config)#vlan vlan-id 进入VLAN配置模式
Switch(config-vlan)#name vlan-name 配置VLAN名称
Switch(config-vlan)#exit
Switch(config)#interface fastethernet slot/port 进入接口模式
Switch(config-if)#switchport mode access 将接口配置为第二层访问接口Switch(config-if)#switchport access vlan vlan-id 将VLAN应用于此接口下Switch(config-if)#no shutdown 开启端口
封装VLAN协议:switchport trunk encapsulation dot1q (封装IEEE 802.1Q)
switchport trunk encapsulation isl (封装ISL协议)
switchport trunk encapsulation negotiate P (自动协商)
③设置允许中继的VLAN:switchport trunk allowed vlan <VLAN ID>
Catalyst 6500:
(1)交换机VTP的配置
输入用户名:enable
输入密码:
(进入超级用户模式)
set vtp domain VLAN名
set vtp mode server
set vtp mode client
set vtp mode transparent
set vtp mode off
3.
4.。