Myluzh Blog

Strive to become a dream architect.

cisco思科交换机常用命令

发布时间: 2022-8-8 文章作者: myluzh 分类名称: Cisco


思科交换机常用命令

进入特权模式
Switch>enable

设置特权模式密码
Switch#enable password 1234.com

进入配置模式
Switch#configure terminal

开启配置转发
Switch(config)# ip routing

查看所有端口情况
show ip int brief

通过IP地址查端口,网口插满的情况下,没做标签就靠这了
show arp | include 192.168.0.54
show mac address-table | include 9a9e.21d7

查看vlan
show vlan brief

划分vlan
inter Gi1/0/X
switchport access vlan XX

批量划分vlan
interface range gigabitEthernet 1/0/1-24
switchport access vlan XX

配置vlan接口地址
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

聚合链路
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
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远程登录认证支持三种方式:无认证、密码认证、用户名+密码组合认证
第一种:本地用户名+密码组合认证方式
Switch(config)#line vty 0 4
Switch(config-line)#login local
Switch(config-line)#transport input telnet
配置明文密码
Switch(config)#user <user-name> [privilege <0-15>] password <password>
配置加密密码
Switch(config)#user <user-name> [privilege <0-15>] secret <password>

标签: cisco 交换机

发表评论