交换机基础配置
概念:
交换机之间通过以太网电接口对接时需要协商一些接口参数,如速率、双工模式等
全双工模式:是指交换机发送数据的同时也能接收数据,两者同时进行
半双工模式:是指在同一时刻只能发送或接受数据
如果交换机两端接口协商模式不一致,会导致报文交互异常
接口速率:指交换机接口每秒传输数据的多少,在交换机上可能要调整以太网接口速率
默认情况下,以太网接口工作在非自协商模式时,它的速率为接口支持的最大速率
测试连通性
PC>ping 10.1.1.2
Ping 10.1.1.2: 32 data bytes, Press Ctrl_C to break
From 10.1.1.2: bytes=32 seq=1 ttl=128 time=94 ms
From 10.1.1.2: bytes=32 seq=2 ttl=128 time=62 ms
— 10.1.1.2 ping statistics — 2 packet(s) transmitted 2 packet(s) received 0.00% packet loss round-trip min/avg/max = 62/78/94 ms
现在PC1和PC2能够正常通信
配置交换机双工模式
配置接口的双工模式可以在自协商或者非协商模式下进行
在自协商模式下:接口的双工模式是和对端接口协商得到的,但协商得到的双工模式可能和实际要求不符合,阔以通过配置双工模式的取值范围来控制协商结果,
例如:互连得两个设备对应接口支持双工和半双工,与实际要求的全双工不符,这时可以用auto duplex full 命令使接口的可协商双工模式变为全双工模式
默认情况下,以太网接口自协商双工模式范围为接口所支持的双工模式
非自协商模式下
可以根据实际需求手动配置接口的双工模式
[S1]int g0/0/1
[S1-GigabitEthernet0/0/1]undo negotiation auto
[S1-GigabitEthernet0/0/1]duplex full
[S1-GigabitEthernet0/0/1]
Jul 23 2020 18:07:04-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 2, the ch
ange loop count is 0, and the maximum number of records is 4095.
意思是:2020年7月23日18:07:04-08:00 S1 DS/4/数据同步_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25。
191.3.1配置已更改。当前更改编号为2,ch
ange循环计数为0,最大记录数为4095。
[S2]int g0/0/2
[S2-GigabitEthernet0/0/2]undo negotiation auto
[S2-GigabitEthernet0/0/2]duplex full
[S2-GigabitEthernet0/0/2]
Jul 23 2020 18:07:41-08:00 S2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 6, the ch
ange loop count is 0, and the maximum number of records is 4095.
[S3]int g0/0/1
[S3-GigabitEthernet0/0/1]undo negotiation auto
[S3-GigabitEthernet0/0/1]duplex full
[S3-GigabitEthernet0/0/1]
Jul 23 2020 18:08:32-08:00 S3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 6, the ch
ange loop count is 0, and the maximum number of records is 4095.
[S3]int g0/0/2
[S3-GigabitEthernet0/0/2]undo negotiation auto
[S3-GigabitEthernet0/0/2]duplex full
[S3-GigabitEthernet0/0/2]
Jul 23 2020 18:09:22-08:00 S3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 8, the ch
ange loop count is 0, and the maximum number of records is 4095.
配置接口速率
自协商模式下,以太网的速率是和对接口协商得到的,如果与实际要求不符,可以配置速率的取值范围来控制协商结果,
例如:;两个互连的设备对应的接口速率与实际要求不符,可以同过auto speed 100命令配置接口速率为100Mbit/s 。
自协商模式下,需手动配置接口速率,避免发生无法通信的情况
默认情况下,以太网接口速率为接口支持最大速率
配置接口速率
由于网络用户少,配置CE接口速率为100Mbit/s,Ethernet接口速率为10Mbit/s
首先关闭自协商模式,并配置以太网接口速率
[S1]int e0/0/1
[S1-Ethernet0/0/1]undo negotiation auto
[S1-Ethernet0/0/1]speed 10
[S1-Ethernet0/0/1]
Jul 23 2020 18:26:54-08:00 S1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 4, the ch
ange loop count is 0, and the maximum number of records is 4095. User interface con0 is available
[S2]int e0/0/1
[S2-Ethernet0/0/1]undo negotiation auto
[S2-Ethernet0/0/1]speed 10
[S2-Ethernet0/0/1]
Jul 23 2020 18:28:51-08:00 S2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 10, the c
hange loop count is 0, and the maximum number of records is 4095.
[S2-Ethernet0/0/1]int g0/0/2
[S2-GigabitEthernet0/0/2]undo negotiation auto
[S2-GigabitEthernet0/0/2]speed 100
[S2-GigabitEthernet0/0/2]
Jul 23 2020 18:29:21-08:00 S2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 12, the c
hange loop count is 0, and the maximum number of records is 4095.
[S2-GigabitEthernet0/0/2]int g0/0/1
[S2-GigabitEthernet0/0/1]undo negotiation auto
[S2-GigabitEthernet0/0/1]speed 10
[S2-GigabitEthernet0/0/1]
Jul 23 2020 18:30:11-08:00 S2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 15, the c
hange loop count is 0, and the maximum number of records is 4095. User interface con0 is available
实际操作中,通常使用自协商模式还是手动配置模式
通常使用手动模式,因为自协商的结果可能和实际的要求不符