【网络工程师】交换机的配置

一、交换机5大基本工作模式

配置网络设备,需要使用console线,在PC上需要使用软件 “超级终端”

1、用户模式:switch>

可以查看交换机的额基本简单信息,且不能做任何修改配置!

2、特权模式:switch##

进入方法在switch>下敲enable(缩写en)进入特权模式

switch##

可以查看所有配置,且不能修改配置,但可以做测试,保存初始化等操作

3、全局配置模式

switch#中敲 configure terminal(缩写conf t)

switch(config)##

默认不能查看配置! 可以修改配置,且全局生效!

4、接口配置模式

switch(config)## 中敲 interface f0/1 (缩写int f0/1)

switch(config-if)##

默认不能查看配置! 可以修改配置,且对该端口生效!

5、console口/线控制台模式

switch(config)## 中敲line console 0 (缩写 line co 0)

默认不能查看配置! 可以修改配置,且对console口生效!

二、交换机命令

1、exit 退出一级

2、end 直接退到特权模式

3、支持命令缩写

4、? 查询命令

相当于 -help

5、历史命令:上键

6、tab全局补全键

可以补全命令

7、配置主机名

conf t
hostname 更改计算机名

8、设置用户密码

line co 0
password 密码
login
exit

9、光标定位快捷键

  1. ctrl+u:删除光标前所有
  2. ctrl+a:到行首
  3. ctrl+e:到行尾

10、配置文件

在内存中,存在一个配置文件文件: running-config
第一次开机系统会在内存中自动创建一个空的running-config配置文件

交换机开机动作:先去硬盘中找startup-config是否存在,如果不存在,在内存中创建新的runing-config,若存在,则复制到内存中并改名为running-config

11、保存配置

en
copy running-config startup-config

write

12、查看running-config配置

en
show running-config(思科)/display (华为)
sh ru

13、查看startup-config配置

en
show starup-config(思科)/display (华为)

14、重启设备

en
reload

15、配置特权密码

conf t
enable password 密码(明文)
endble secret 密码(密文)(密文会覆盖明文)

16、查看MAC地址表

show mac-address-table

17、查看接口状态列表

show ip int beief
sh ip int b

18、手工关闭开启接口

int f0/(端口)
shutdown
exit

int f0/(端口)
no shutdown
exit

19、do

用途:其他模式加do空格也可以强制使用特权模式的命令

do sh run
do sh ip int b
do wr

20、删除配置

  1. 在哪配置的,就在哪删除
  2. 命令前加no空格
  3. 原命令中有参数,并且参数具有唯一性,则删除时不需要加参数

21、清空/擦除/初始化配置

en
eraser startup-config

22、为三层端口配置IP

int f/0
ip add 10.1.1.254 255.255.255.0
no shut
exit

23、开启远程控制

1)不用身份验证

conf t
line vty 0 4
transport intput telnet/ssh/none/all
password 密码
login //启用验证 同理 no login 关闭验证
exit

2)用身份验证

conf t
line vty 0 4
transport intput telnet/ssh/none/all
login local
exit
username xx password 123.com //建立一个数据库账号为xx 密码123.com

24、ssh配置

conf t
hostname r1
ip domain-name r1.qf.com //进入子名明域名为r1.qf.com
crypto key generate rsa //生成密钥对!
line vty 0 4
transport intput ssh
password 密码
login //启用验证 同理 no login 关闭验证
exit
username xx password 123.com

你可能感兴趣的:(网络,服务器,tcp/ip)