cisco思科交换机常用命令
作者:myluzh 分类: Cisco 长度:1924 阅读:581
思科交换机常用命令
进入特权模式
Shell
Switch>enable
设置特权模式密码
Shell
Switch#enable password 1234.com
进入配置模式
Shell
Switch#configure terminal
开启配置转发
Shell
Switch(config)# ip routing
查看所有端口情况
Shell
show ip int brief
通过IP地址查端口,网口插满的情况下,没做标签就靠这了
Shell
show arp | include 192.168.0.54
show mac address-table | include 9a9e.21d7
查看vlan
Shell
show vlan brief
划分vlan
Shell
inter Gi1/0/X
switchport access vlan XX
批量划分vlan
Shell
interface range gigabitEthernet 1/0/1-24
switchport access vlan XX
配置vlan接口地址
Shell
Switch(config)#vlan 200
Switch(config-vlan)#exit
Switch(config)#interface vlan 200
Switch(config-if)#ip address 192.168.200.1 255.255.255.0
Switch(config-if)#no shutdown
聚合链路
Shell
int Port-channel 1
Switch(config)#int ran g1/1/1-2
Switch(config-if-range)#switchport mode trunk
Switch(config-if-range)#channel-group 1
DHCP基础配置
先配置一个vlan10接口地址为192.168.10.1/24
Shell
Router(config)#server dhcp
Router(config)#ip dhcp pool 10
Router(dhcp-config)#network 192.168.10.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.10.1
telnet登录
思科交换机Telnet远程登录认证支持三种方式:无认证、密码认证、用户名+密码组合认证
第一种:本地用户名+密码组合认证方式
Shell
Switch(config)#line vty 0 4
Switch(config-line)#login local
Switch(config-line)#transport input telnet
配置明文密码
Shell
Switch(config)#user <user-name> [privilege <0-15>] password <password>
配置加密密码
Shell
Switch(config)#user <user-name> [privilege <0-15>] secret <password>