在ensp中实现文档要求,其中X为25,详细代码
时间: 2024-12-10 22:37:30 浏览: 10
要在eNSP(Enterprise Network Simulation Platform)中实现文档《16链路聚合.docx》的要求,并将其中的X设为25,以下是详细的配置步骤和命令:
### 实验拓扑
假设你已经搭建了如下的网络拓扑:
- 两台交换机:SW1 和 SW2
- 四台PC:PC1, PC2, PC3, PC4
- 连接如下:
- SW1 (G0/0/22) -- SW2 (G0/0/22)
- SW1 (G0/0/23) -- SW2 (G0/0/23)
- SW1 (G0/0/24) -- SW2 (G0/0/24)
### 配置步骤
#### 1. 配置LACP模式链路聚合
##### SW1
```plaintext
[SW1] interface Eth-Trunk 1
[SW1-Eth-Trunk1] mode lacp
[SW1-Eth-Trunk1] trunkport GigabitEthernet 0/0/22
[SW1-Eth-Trunk1] trunkport GigabitEthernet 0/0/23
[SW1-Eth-Trunk1] trunkport GigabitEthernet 0/0/24
[SW1-Eth-Trunk1] max active-linknumber 2
[SW1-Eth-Trunk1] port-isolate enable group 1
[SW1-Eth-Trunk1] quit
```
##### SW2
```plaintext
[SW2] interface Eth-Trunk 1
[SW2-Eth-Trunk1] mode lacp
[SW2-Eth-Trunk1] trunkport GigabitEthernet 0/0/22
[SW2-Eth-Trunk1] trunkport GigabitEthernet 0/0/23
[SW2-Eth-Trunk1] trunkport GigabitEthernet 0/0/24
[SW2-Eth-Trunk1] port-isolate enable group 1
[SW2-Eth-Trunk1] quit
```
#### 2. 配置VLAN
##### SW1
```plaintext
[SW1] vlan batch 10 100
[SW1] interface GigabitEthernet 0/0/25
[SW1-GigabitEthernet0/0/25] port link-type access
[SW1-GigabitEthernet0/0/25] port default vlan 10
[SW1-GigabitEthernet0/0/25] quit
[SW1] interface GigabitEthernet 0/0/26
[SW1-GigabitEthernet0/0/26] port link-type access
[SW1-GigabitEthernet0/0/26] port default vlan 100
[SW1-GigabitEthernet0/0/26] quit
```
##### SW2
```plaintext
[SW2] vlan batch 10 100
[SW2] interface GigabitEthernet 0/0/25
[SW2-GigabitEthernet0/0/25] port link-type access
[SW2-GigabitEthernet0/0/25] port default vlan 10
[SW2-GigabitEthernet0/0/25] quit
[SW2] interface GigabitEthernet 0/0/26
[SW2-GigabitEthernet0/0/26] port link-type access
[SW2-GigabitEthernet0/0/26] port default vlan 100
[SW2-GigabitEthernet0/0/26] quit
```
#### 3. 设置SW1为主动端
##### SW1
```plaintext
[SW1] lacp priority 100
```
##### SW2
```plaintext
[SW2] lacp priority 200
```
#### 4. 查看聚合状态
##### SW1
```plaintext
[SW1] display eth-trunk 1
```
##### SW2
```plaintext
[SW2] display eth-trunk 1
```
#### 5. 关闭G0/0/23端口并查看聚合状态
##### SW1
```plaintext
[SW1] interface GigabitEthernet 0/0/23
[SW1-GigabitEthernet0/0/23] shutdown
[SW1-GigabitEthernet0/0/23] quit
[SW1] display eth-trunk 1
```
##### SW2
```plaintext
[SW2] display eth-trunk 1
```
#### 6. 开启G0/0/23端口并再次查看聚合状态
##### SW1
```plaintext
[SW1] interface GigabitEthernet 0/0/23
[SW1-GigabitEthernet0/0/23] undo shutdown
[SW1-GigabitEthernet0/0/23] quit
[SW1] display eth-trunk 1
```
##### SW2
```plaintext
[SW2] display eth-trunk 1
```
#### 7. 测试连通性
使用PC1和PC2分别ping其他PC,确保VLAN 10内的PC能相互通信,VLAN 100内的PC也能相互通信。
### 总结
以上配置实现了LACP模式的链路聚合,并配置了相应的VLAN,确保了不同VLAN内的PC能够相互通信。同时,通过关闭和开启特定端口,验证了链路聚合的动态调整能力。
阅读全文