2020-11-09

交换机的基本配置命令
1:创建VlAN2 及 VLAN3
2:设置s1和s2之间的中继连接
s#copy r s保存命令
创建VlAN
s(config)#VLAN 2
s(Config-vlan)#name 名字(VLAN)
将access 改成trunk去
s(config)#int f0/1
s(config-if)# switchport mode trunk
将f0/1配置给VLAN2
s(config)#int (f0/1)端口
s(config-if)# switchport mode access
s(config-if)#switchport access (VLAN2)
命令
s>(用户模式)enable(en) 命令进入特权模式
s#(特权模式)configuer terminal(config t)命令进入全局模式
s(config)#[全局模式]exit 退到上一步
修改主机名
hostname 【名字】修改名字

设置密码
password 【密码 】
login 对用户
enable password 【密码 】对特权用户

配置加密口令保护特权模式的访问
s(config)#enable secret 【密码】itsasecret
使能加密口令将覆盖使能口令。如果俩者均在交换机上配置需输入使能加密口令

s(config)# service password - encryption
将明文密码加密

show running - configuration 查找

配置当日消息(motd)
s(config)#banner motd “当日消息”
1:查询交换机的mac地址
S#show Mac addresse-table
2:修改主机名
hostname 【名字】修改名字
3:配置控制台口令
S(config) line console 0
S(config-line) password [密码]
S(config-line) login
4:VTY线路口令
switch(config)#line vty 0 15
5:使能口令
switch(config)#enable password 【密码】
6:使能加密口令
switch(config)#enable secret 【密码】
7:加密所有明文口令
switch(config)#service password-encryption
8:消息标语
switch(config)#banner motd【当日消息】
9:保存文件
s#copy r s
10:配置交换机的ip地址-管理VLAN
int VLAN 1
ip address 192.168.10.1 255.255.255.0
no shutdown
11:配置交换机的默认网关
switch(config)# ip default-gateway 【网关】
switch(config)#exit
远程管理
telnet [ip地址]
SSH(加密)
设置域名:Router (config)# ip domain-name cisco. cn[域名]
ip ssh version 2
Crypto key generate rsa enter rsa 【enter】
(1024)【密钥】
Username admin 【用户名】 password( cisco)【密码】
line vty 0 15
login local (本地登录)
transport input ssh
shh 的登录
ssh -l 【用户】 【IP地址】

         交换机端口安全

int f0/1[端口]
switchport port-securit/switch port-se #开启交换机的端口安全功能
switchport port-se max 数量#允许连接的最大数量
switchport port-se mac-address sticky #自己学习mac 地址
三级保护模式
1:保护(protect)
2:限制(restrict)
3:关闭(shutdown)
配置命令:
switchport port-security violation (protect/restrict/shutdown)#配置安全违例的处理方式为(protect/restrict/shutdown)
配置多个端口
int range f0/1-2,f0/10,f0/20-30【端口】
查看所有端口(show run)
查看某个端口(show port-se int f0/2【端口】)
1:VLAN
1:创建vlan
switch(config)#vlan
2:删除VLAN
switch(config)#no vlan
3:配置vlan名字
switch(config)#name【名字】
4:查看VLAN信息
switch#show vlan
TRUNK命令
1:配置trunk链路
switch(config-if)#switchport trunk encanpsulation dot1l
2:把接口模式配置为trunk
switch(config-if)#switch mode trunk
3:switch(config-if)#switchport trunk native 【vlan号】
4:查看VLAN
switch(config)#show int VLAN
2:VLAN
1:每一个VLAN都需要一个子网
2:给端口配置VLAN
switch(config)#int f0/1【端口】
switch(config)#switchport access vlan 2【VLAN号】
3:把端口从VLAN中删除
switch(config)#int range f0/1 - 5【端口】
switch(config-if)#no switchport access vlan 2【VLAN号】
switch(config-if)#exit
switch no negotiate #禁用DTP不要自动协商
switch mode trunk #将端口设置为trunk
switchport trunk native VLAN 99#将VLAN 99设置为本征VLAN
查询VLAN简洁方式
s#show VALN b
查询trunk
s#show int trunk

          VTP (Vlan Trunk Protocol)配置 

思科私有传递VLAN数据库中的VLAN信息
Server(默认)服务器模式
创建VLAN 删除VLAN 修改VLAN 始发VTP 转发VTP 学习VTP
Client 客户端模式
不能创建 不能删除 不能修改 不始发 转发 学习
Transparent 透明模式
创建VLAN 删除VLAN 修改VLAN 不始发 转发 不学习
SW1(config)#vtp mode server/client //启动vtp server/client模式
SW1(config)#vtp domain VtpTest //设置vtp域名
SW1(config)#vtp password aaa //设置vtp密码 #https://blog.csdn.net/tyrantu1989/article/details/73435633?utm_source=app
SW1(config)#vlan 10 //创建VLAN
SW1#show vtp status 查看vtp配置
SW1#show vtp password 查看vtp密码

1:配置vtp的模式(服务器,客户机,透明)
vtp mode 【模式】
2:配置vtp域名
vtp domain 【域名】
3:配置vtp域名密码
vtp password【密码】
s(conf)#VLAN database #进入VLAN数据库
S(vlan) VLAN 10 name 【名字】 #给vlan配置名字
vtp只能在trunk口通告

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值