1、各种模式:
1)特权模式:en
2)全局配置模式:conf t
3)接口模式:int f0/0
4)int vlan 10
2、设置密码
1)特权密码:enable password 123456
2)console密码:line console 0
password 123456
login
3)远程密码:line vty 0 4
password 123456
login
3、如何给交换机设置网关
ip default-gateway 192.168.1.254
4、给交换机配置管理地址
int vlan1
ip add 192.168.1.100
5、为什么使用vtp?
快速传递vlan,不用手工建立vlan
服务器模式:server
vtp mode server
vtp domain t123
vtp password 123456
客户端模式:client
vtp mode client
vtp domain t123
vtp password 123456
然后在服务器模式的交换机上建立vlan,客户端模式的交换机上自动建立
6、为什么使用dhcp?
计算机能够自动获得ip地址,不用手工配置
减轻管理员的工作量
ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 8.8.8.8
其它的目前不用
7、为什么使用单臂路由?
为了不用的网段(不同的vlan)可以通信
首先激活物理接口:
int f/0
no sh
配置子接口:
int f0/0.1
en dot1q 1
ip add 192.168.1.1 255.255.255.0
8、为什么使用静态路由?
多台路由器之间实现通信
R1:
ip route 10.0.0.0 255.0.0.0 192.168.1.2
R2:
ip route 172.16.1.0 255.255.0.0 192.168.1.1
或者配置默认路由
ip route 0.0.0.0 0.0.0.0 192.168.1.1
9、为什么使用中继链路(trunk)
为了交换机之间能够传递vlan
int f/1
sw mo tr
10、为什么配置以太网通道
提高带宽、备份(安全),最多绑定8根
int range f0/22 -24
sw mo tr
channel-group 1 mode on
11、如何修改路由器忘记的密码
(1) 重启路由器,并按Ctrl+Break组合键中断OS的加载,路由器将进入ROM Monitor模式。
(如果是笔记本电脑: ctrl+shift(pause)+fn , 惠普ctrl+c 戴尔)
(2) 将配置寄存器的值更改为0x2142,表示在启动时忽略startup-config的配置。
rommom>confreg 0x2142
rommom>reset
(3) 路由器将再次重启,由于更改了配置寄存器的值,路由器将无法加载配置文件,因此也就 不会再有登录密码。
(4) 进入配置模式后,将配置文件手动加载进来。
Router#copy startup-config running-config
(5) 通过show run命令查看路由器配置了哪些密码,逐一更改密码。
(6) 修改配置寄存器的值,并保存配置。
Router(config)#config-register 0x2102
Router (config)#exit
Router#copy running-config startup-config
12、如何修改交换机忘记的密码
(1) 拔掉交换机的插头。因为Cisco 2960交换机没有电源开关,所以只能切断电源来重启交换机。
(2) 重新插好电源后,立刻按住交换机上的"mode"键。当看到配置界面显示"switch:"命令 提示,便可松开"mode"键。这表示已经进入一个专门用来做故障恢复的简单I0S,由于没有密码, 正常的I0S无法进入,因此只能先在这里做一些参数设定。
The password-recovery mechanism is enabled.
The system has been interrupted prior to initializing the flash filesystem.
The following commands will initialize
the flash filesystem, and finish loading the operating system software:
flash_init
boot
Switch:
⑶ 使用上面提示的命令flash_init初始化Flasho
Switch: flash init
Initializing Flash flashfs[0]
flashfs[0]
done Initializing Flash.
Boot Sector Filesystem (bs:) installed, fsid: 3 Switch:
(4) 将config.text 文件名改成config.old
Switch: rename flash:config.text flash:config.old
这样,系统在重启时就不会再加载配置文件,当然也就没有密码。
(5) 重启交换机。
Switch:boot
现在可以进入IOS,但是做到这步,密码恢复并没有完成,因为在配置文件里不只存有密码,还 有很多其他的参数设定,必须恢复这些参数。
(6) 把配置文件的名称改回来。
Switch# rename flash:config.old flash:config.text
(7) 手工加载配置文件。
Switch# copy flash:config.text system:running-config
(8) 配置文件加载完成后,需要进入配置模式修改密码,最后保存配置,完成密码的恢复。
13、如何排错
1)查看所有配置命令
show run
2)精确查看所有接口的ip地址
show ip int br
3)查看f0/0接口详细信息(带宽、trunk模式等)
show ip int f0/0
4)查看vlan信息
show vlan br
5)查看路由表(静态路由)
show ip route
6)查看mac地址表(交换机上)
show mac-address-table
7)在交换机上绑定电脑的mac地址
8)在路由器上绑定电脑的mac地址
9)在电脑上绑定路由器的mac地址