Switch>enable Switch#disable Switch#config t Switch(config)#hostname SW1 SW1(config)#no ip domain-lookup SW1(config)#line console SW1(config-line)#logging synchronous SW1(config-line)#exec-timeout ? <0-35791> Timeout in minutes SW1(config-line)#exec-timeout 0 SW1(config-line)#exec-timeout 0 ? <0-2147483> Timeout in seconds <cr> SW1(config-line)#exec-timeout 0 用户模式配置密码 SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. SW1(config)#line console 0 SW1(config-line)#password ccna SW1(config-line)#login 特权模式配置密码 SW1>en SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. SW1(config)#enable secret ccnp telnet远程登陆密码 SW1#conf t SW1(config)#line v SW1(config)#line vty ? <0-15> First Line number SW1(config)#line vty 0 15 SW1(config-line)#password ccna SW1(config-line)#login SW1(config-line)#logging synchronous SW1(config-line)#exec-timeout 0 0 登陆界面提示信息 SW1(config)#banner motd # this is ccna test # 进入接口 SW1(config)#interface fastEthernet 0/2 保存配置 SW1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] SW1#write Building configuration... [OK] 查看配置 Switch>en witch#show running-config 还原默认 Switch#erase startup-config 交换机配置IP地址 Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. ccna(config)#interface vlan 1 ccna(config-if)#ip add 192.168.1.1 255.255.255.0 ccna(config-if)#no shutdown ccna(config-if)#exit 交换机配置默认网关 ccna(config)#ip default-gateway 192.168.1.254 路由器配置 Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 domain domain-lookup domain-name R1(config)#no ip domain-lookup R1(config)#line con 0 R1(config-line)#logging syn R1(config-line)#exec-timeout 0 0 R1(config-line)#end 配置路由ip R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface gigabitEthernet 0/0 R1(config-if)#ip add 192.168.1.254 255.255.255.0 R1(config-if)#no shut R1(config-if)# %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up