交換機基本配置

配置前的連接

交換機基本配置

交換機配置命令基礎
用戶模式hostname# ;
特權模式hostname(config)# ;
全局配置模式hostname(config-if)# ;
交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname csico ;設置交換機的主機名
switch(config)#enable secret csico1 ;設置特權加密口令
switch(config)#enable password csico8 ;設置特權非密口令
switch(config)#line console 0 ;進入控制檯口
switch(config-line)#line vty 0 4 ;進入虛擬終端
switch(config-line)#login ;虛擬終端允許登錄
switch(config-line)#password csico6 ;設置虛擬終端登錄口令csico6
switch#exit ;返回命令

包括VLAN創建,刪除,端口屬性的設置,配置trunk端口,將某端口加入vlan中,配置VTP:

switch#vlan database ;進入VLAN設置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#vlan 3 name vlan3 ;建VLAN 3並命名爲vlan3
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入端口1
switch(config)#speed ? 查看speed命令的子命令
switch(config)#speed 100 設置該端口速率爲100mb/s (10/auto)
switch(config)#duplex ? 查看duplex的子命令
switch(config)#duplex full 設置該端口爲全雙工(auto/half)
switch(config)#description TO_PC1 這是該端口描述爲TO_PC1
switch(config-if)#switchport access vlan 2 ;當前端口加入vlan 2
switch(config-if)#switchport mode trunk ;設置爲trunk模式(access模式)
switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼
switch(config)#vtp domain vtpserver ;設置vtp域名相同
switch(config)#vtp password ;設置發vtp密碼
switch(config)#vtp server ;設置vtp服務器模式
switch(config)#vtp client ;設置vtp客戶機模式

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章