交換器配置基本命令
來源:互聯網
上載者:User
交換器基本狀態:hostname> ;使用者模式hostname# ;特權模式hostname(config)# ;全域配置模式hostname(config-if)# ;介面狀態交換器口令設定:switch>enable ;進入特權模式switch#config terminal ;進入全域配置模式switch(config)#hostname ;設定交換器的主機名稱switch(config)#enable secret xxx ;設定特權加密口令switch(config)#enable password xxa ;設定特權非密口令switch(config)#line console 0 ;進入控制台口switch(config-line)#line vty 0 4 ;進入虛擬終端switch(config-line)#login ;允許登入switch(config-line)#password xx ;設定登入口令xxswitch#exit ;返回命令交換器VLAN設定:switch#vlan database ;進入VLAN設定switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;刪vlan 2switch(config)#int f0/1 ;進入連接埠1switch(config-if)#switchport access vlan 2 ;當前連接埠加入vlan 2switch(config-if)#switchport mode trunk ;設定為幹線switch(config-if)#switchport trunk allowed vlan 1,2 ;設定允許的vlanswitch(config-if)#switchport trunk encap dot1q ;設定vlan 中繼switch(config)#vtp domain ;設定發vtp網域名稱switch(config)#vtp password ;設定發vtp密碼switch(config)#vtp mode server ;設定發vtp模式switch(config)#vtp mode client ;設定發vtp模式交換器設定IP地址:switch(config)#interface vlan 1 ;進入vlan 1switch(config-if)#ip address ;設定IP地址switch(config)#ip default-gateway ;設定預設閘道switch#dir Flash: ;查看快閃記憶體交換器顯示命令:switch#write ;儲存配置資訊switch#show vtp ;查看vtp配置資訊switch#show run ;查看當前配置資訊switch#show vlan ;查看vlan配置資訊switch#show interface ;查看連接埠資訊switch#show int f0/0 ;查看指定連接埠資訊儲存命令:switch(config)#copy running-config startup-config