CCNA 课程 三

交换机的MAC地址学习情况:

1.从一个接口收到数据帧,根据数据帧的原mac地址查找交换机的mac地址表,如果没有找到,将会添加数据帧的原mac地址和收到数据帧接口的对应条目,放进交换机的mac地址表里(在MAC有空间的情况下,如果没有空间将不放入,也不替换原有条目)。

2.从一个接口收到数据帧,根据数据帧的原mac地址查找交换机的mac地址表,如果有,检查原有条目中的接口是否和当前收到数据帧的接口一致,如果不一致,将替换原有接口,如果一致,将不做修改。

交换机转发情况:

1.从一个接口收到数据帧,根据数据帧的目的mac地址查找交换机的mac地址表,如果没有找到,将此数据帧复制多份向除了进来的接口以外的所有接口泛洪。

2. 从一个接口收到数据帧,根据数据帧的目的mac地址查找交换机的mac地址表,如果找到,将此数据帧只从mac地址表对应的接口转发出去。

路由器的密码破解:

提前:原有路由器需要保持配置

在设备重启过程中按 CTRL+C

进入rom系统:

rommon 2 > confreg 0x2142  //修改register编码为0x2142,目的跳过把nvram中的startup-config 加载到 rom中变为runing-config

rommon 3 > reset    //重启

路由器进入空配置:

Router#

Router#copy startup-config running-config   //手动的把原来保持的配置,加载成当前配置,原有配置将恢复

Destination filename [running-config]?

%SYS-5-CONFIG_I: Configured from console by console

495 bytes copied in 0.416 secs (1189 bytes/sec)

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#enable password 123  //修改为新密码

Router(config)#config-register 0x2102  //把register编码改回0x2102,实现再次重启加载nvram中的startup-config

Router(config)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#wr   //  保持修改过后的配置

Building configuration...

[OK]

交换机的密码恢复:

  1. 断电 再 加点
  2. 启动15s内 按 mode ,保持15s system指示灯由绿色变成橙色 ,松开mode
  3. 进入rom 系统提示:   flash_init

load_helper

boot

  1. switch: flash_init
  2. switch: load_helper
  3. switch: rename flash:config.text flash:config.text.old
  4. switch: boot              //重启
  5. Switch> enable
  6. Switch# rename flash:config.text.old flash:config.text
  7. Switch# copy flash:config.text system:running-config
  8. Switch# configure terminal
  9. Switch (config)# enable secret xxxx
  10. Switch (config)# exit
  11. Switch#write

开启交换机VTY远程管理线路:

Switch>en

Switch#conf t

Switch(config)#

Switch(config)#int vlan 1   // 进入二层交换机用来管理设备的接口

Switch(config-if)#ip add 1.1.1.1 255.255.255.0

Switch(config-if)#no sh

Switch(config-if)#exit

Switch(config)#line vty 0 4

Switch(config-line)#password 111

Switch(config-line)#login

Switch(config-line)#end

Vty远程管理线路采用本地用户名、密码的方式登录:

Router>en

Router#conf t

Router(config)#username aa password aa  //定义本地用户数据库

Router(config)#line vty 0 4

Router(config-line)#login local   //设置vty登录模式为本地用户、密码模式登录

Router(config-line)#end

交换机端口安全

Switch>en

Switch#conf t

Switch(config)#int f0/1

Switch(config-if)#switchport mode access  //接口设置为access 模式

Switch(config-if)#switchport port-security     //开启端口安全功能

Switch(config-if)#switchport port-security mac-address 00E0.A394.C22E //绑定一个固定的mac地址

Switch(config-if)#switchport port-security maximum 3  //最大允许访问的mac数量,默认1

Switch(config-if)#switchport port-security violation ?  //如果非法的数据帧到达将采取的行为,默认行为shutdown

  protect   Security violation protect mode       默默丢弃该数据帧

  restrict  Security violation restrict mode                     丢弃该数据帧,并记录

  shutdown  Security violation shutdown mode           关闭接口  

 

DHCP服务的配置

Router>en

Router#conf t

Router(config)#service dhcp  //开启DHCP服务

Router(config)#ip dhcp excluded-address 1.1.1.1 1.1.1.10  //排除某些地址

Router(config)#ip dhcp pool A  //定义分配给客户端的地址池

Router(dhcp-config)#network 1.1.1.0 255.255.255.0   //地址池的IP地址范围,及掩码

Router(dhcp-config)#default-router 1.1.1.10                    //客户端收到的默认网关

Router(dhcp-config)#dns-server 12.23.34.45             //客户端收到的dns服务器地址

Router(dhcp-config)#end

原文地址:https://www.cnblogs.com/jjp816/p/4446814.html