Switch>(用户模式)
Switch#(特权模式)
Switch(config)#(全局配置模式)
-
hostname(更改名字)
-
no ip domain-lookup(禁用DNS查找)
-
#terminal history size 25(命令缓冲区大小设置为25)
-
Switch(config)# no logging console
-
Switch(config)#line console 0(进入线路配置模式)
Switch(config-line)#password cisco(配置用户EXEC密码)
Switch(config-line)#exec-timeout 0 0(关闭控制台会话的空闲超时)
Switch(config-line)#login
Switch(config-line)#exit
Switch(config)# -
Switch(config)#enable secret class(配置密文(MD5)特权EXEC密码)
-
Switch(config)#enable password class(配置明文特权EXEC密码)
-
Switch(config)#service password-encryption(对所有明文密码应用Type-7加密)
-
Switch(config)#banner motd “Warning! Unauthorized entry!”(配置标语)
-
Switch#write(保存配置)
-
Switch(config)#interface vlan 1(配置交换机虚拟接口)
-
Switch(config-if)#ip address 192.168.122.222 255.255.255.0
-
Switch(config-if)#no shutdown
-
Switch(config)#ip default-gateway 192.168.10.1(配置交换机默认网关)
-
Router(config)#interface gigabitEthernet 0/0(配置路由器接口)
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown
-
Router(config)#ipv6 unicast-routing(启用ipv6路由)
-
R1(config)#interface g0/0/1(GUA 和 LLA 静态配置)
R1(config-if)#ipv6 address fe80::2:1 link-local
R1(config-if)#ipv6 address 2001:db8:acad:2::1/64
R1(config-if)#no shutdown
%LINK-3-UPDOWN: Interface GigabitEthernet0/0/1, changed state to up
R1(config-if)#exit -
配置并验证通过SSH安全远程访问路由器
SW1(config)#ip domain-name http://cisco.com(设置域名)
SW1(config)#crypto key generate rsa
How many bits in the modulus [512]: 768(使用768的键模量)
SW1(config)#ip ssh version 2(使用SSH版本2)
SW1(config)#username admin secret ccna(设置用于远程访问的用户名admin密码ccna)
SW1(config)#line vty 0(只允许远程访问VTY Line 0)
SW1(config-line)#transport input ssh(远程访问只允许SSH协议)
SW1(config-line)#transport input all/none/telnet
SW1(config-line)#login local
SW1#show ip ssh //检查SSH状态 -
Switch(config)#line vty 0 15
Switch(config-line)#password cisco(配置VTY线路密码)
Switch(config-line)#exec-timeout 2 30(设置超时时间时间(2分30秒))
Switch(config-line)#login
Switch(config-line)#exit -
Switch(config)#login block-for 300 attempts 2 within 20(在20秒内,如果有2次错误登陆,就让设备禁止所有人登陆300秒)
-
配置EtherChannel·LACP
SW1(config)#interface range fastEthernet 0/1-2
SW1(config-if-range)#channel-group 1 mode active
SW1(config)#interface port-channel 1
SW1(config-if)#switchport mode trunk
SW1(config-if)#switchport trunk allowed vlan 1,2,20 -
远程登录路由器接口修改配置
- R0(config-line)#logging synchronous ----设置日志的同步
- 将路由器和交换机的配置备份到 TFTP 服务器
- transport input all 允许所有协议进入线路
- Switch# show flash
- Switch(config)#boot system flash:/c2960-lanbase-mz.122-25.FX.bin
- S1#(config)# vlan 10(创建vlan10)
- S1#(config-vlan)# name Faculty/Staff(为vlan命名)
- 如果没有执行no ip domain-lookup(禁用DNS查找)然后又打错命令,此时思科模拟器就会花时间解析这条错误命令,可这时以用shift,Ctrl加6的命令取消掉这个解析的过程。
- Router(config-if)#description Link to LAN-10(description命令为接口配置最多240个字符的简短描述)这里说明该路由器接口划分到VLAN10