帧头:6+6+2=14字节 MTU值:1500字节 帧尾:4字节
帧头内容:目标MAC、源MAC、类型 类型的作用:识别上层协议 0x0800:上层为IP协议 0x0806:上层为ARP协议 0x代表16进制
收到一个数据帧后:
1.首先学习帧中的源MAC地址来形成MAC地址表 2.然后检查帧中的目标MAC地址,并匹配MAC地址表: 如表中有匹配项,则单播转发 如表中无匹配项,则除接受端口外广播转发 3.MAC地址表的老化时间默认是300秒(可修改)
6.交换机的端口:
E 10Mb F 100Mb G 1000Mb Te 10000Mb
F0/1 0模块号 1接口号
接口速率自适应:1000/100/10M自适应 速率工作模式可以为10,100,1000任何一种状态
端口状态:up/down down的3中可能: 1)人工down掉 2)速率不匹配 3)双工模式不匹配(双工duplex) 双工模式:单工、半双工、全双工
7.交换机5大基本工作模式及命令 第一次配置网络设备,需要使用console线 在PC需要使用“超级终端”或其他软件。
1)用户模式: switch> 可以查看交换机的基本简单信息,且不能做任何修改配置! 2)特权模式: switch> enable switch# 可以查看所有配置,且不能修改配置 但可以做测试、保存、初始化等操作 3)全局配置模式: switch# configure terminal switch(config)# 默认不能查看配置! 可以修改配置,且全局生效! 4)接口配置模式: switch(config)# interface f0/1 switch(config-if)# 默认不能查看配置! 可以修改配置,且对该端口生效! 5)console口/线/控制台模式: 默认不能查看配置! 可以修改配置,且对console口生效!
命令:
end直接退到特权模式
conf t hostname 设备名
line co 0 password 密码 login exit
ctrl+u :快速删除光标全所有字符 ctrl+a :快速定位光标到行首 ctrl+e :快速定位光标到行尾
在内存中存在一个文件: running-config 第一次开机,系统会在内存中自动 创建一个新的干净的running-config
en copy running-config startup-config 或 write
先去硬盘中查找startup-config是否存在, 如果不存在,在内存中创建新的run 若果存在,则复制到内存中并改名为running-config
en show running-config sh run
show startup-config
en reload
conf t enable password 密码 (明文) enable secret 密码 (密文)
show mac-address-table
show ip int brief sh ip int b
int f0/x shutdown exit
int f0/x no shutdown exit
其他模式加do空格可以强制使用特权模式的命令 如: do sh run do sh ip int b do wr 等
1)在哪配置的,就在哪删! 2)命令前加no空格 3)原命令中有参数,并且参数具有唯一性,则 删除时不需要加参数 如: conf t hostname sw1
conf t no hostname
en erase startup-config
int f0/0 ip add 10.1.1.254 255.255.255.0 no shut exit
conf t line vty 0 4 transport input telnet/ssh/none/all password 密码 login exit
conf t hostname r1 ip domain-name r1.qf.com crypto key generate rsa 生成密钥对! line vty 0 4 transport input telnet/ssh/none/all login local exit username xx password 123.com
conf t int vlan 1 ip add 10.1.1.253 255.255.255.0 no shut
目的:可被跨网段管理! conf t ip default-gateway 10.1.1.254
conf t no ip domain-lookup