交换机的基本原理配置(二)

1、设置进入特权模式的密码(加密形式)
在全局模式下输入命令 enable secret 密码 即设置完成。
jingshihai-01#
jingshihai-01#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
jingshihai-01(config)#enable secret 111111
jingshihai-01(config)#end
jingshihai-01#
%SYS-5-CONFIG_I: Configured from console by console
jingshihai-01#show running-config 
Building configuration...

Current configuration : 1204 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
enable secret 5 $1$mERr$gsT/Ol5GvccluWxu2cQ1I. (加密密码)
!
!
2、如果同时设置了明文密码和加密密码,那么加密密码起作用

(即:加密密码的优先级大于明文密码)

3、配置console密码
在全局模式下输入命令 line console 0 回车,在输入 password 123456 回车,在输入 login 即可
jingshihai-01#config termin
jingshihai-01#config terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
jingshihai-01(config)#line console 0
jingshihai-01(config-line)#password 123456
jingshihai-01(config-line)#login
jingshihai-01(config-line)#end
jingshihai-01#show running-config 
Building configuration...

Current configuration : 1228 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
line con 0
password 999999
logging synchronous
login
jingshihai-01#
jingshihai-01#exit
jingshihai-01 con0 is now available
Press RETURN to get started.

User Access Verification

Password: (输入console密码)

jingshihai-01>enable
Password:  (输入特权模式密码)
jingshihai-01#
4、配置管理用IP地址与网关
console不是唯一的管理手段,有时还需要通过网络对设备进行远程操作。
每台交换机只能配置一个管理IP地址和网关,且只能在VLAN 1中配置。
在全局模式下,输入命令 interface vlan 1 进入vlan1中;然后输入管理IP地址和网关,命令为 ip address 192.168.1.1 255.255.255.0 回车后输入 no shutdown (激活) 配置完成。
jingshihai-01#
jingshihai-01#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
jingshihai-01(config)#interface vlan 1
jingshihai-01(config-if)#ip address 192.168.1.1 255.255.255.0
jingshihai-01(config-if)#no shutdown

jingshihai-01(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
jingshihai-01(config-if)#end
jingshihai-01#
%SYS-5-CONFIG_I: Configured from console by console

jingshihai-01#show running-
jingshihai-01#show running-config 
Building configuration...

Current configuration : 1241 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
interface Vlan1
  ip address 192.168.1.1 255.255.255.0
!
通过如上可以查看输入的命令是否有问题,也可以通过如下命令查看状态:
jingshihai-01# show interface vlan 1
Vlan1 is up, line protocol is down
  Hardware is CPU Interface, address is 00d0.ff07.0d95 (bia 00d0.ff07.0d95)
  Internet address is 192.168.1.1/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 1000000 usec
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值