问题的所有命令 ensp
时间: 2025-06-21 15:27:58 浏览: 8
为了完成《综合练习1》中的任务,以下是在ENSP(Enterprise Network Simulation Platform)中所需的命令汇总:
### 1. 搭建网络拓扑图
- **修改设备名称**:
```shell
Router(config)# hostname Router1
Switch(config)# hostname Switch1
```
- **配置接口IP地址**:
```shell
Router1(config)# interface GigabitEthernet0/0
Router1(config-if)# ip address 192.168.1.1 255.255.255.0
Router1(config-if)# no shutdown
```
- **配置路由信息**:
- **静态路由**:
```shell
Router1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.2
```
- **动态路由(例如OSPF)**:
```shell
Router1(config)# router ospf 1
Router1(config-router)# network 192.168.1.0 0.0.0.255 area 0
```
### 2. 配置FTP服务器
- **创建目录**:
```shell
Router1(config)# ip ftp source-interface GigabitEthernet0/0
Router1(config)# ip ftp server enable
Router1(config)# file prompt quiet
Router1(config)# mkdir /flash/doc_AAA
```
- **创建文件**:
```shell
Router1(config)# copy flash:/startup-config flash:/doc_AAA/file_server_AAA.txt
```
### 3. 配置LACP链路聚合
- **在路由器1上**:
```shell
Router1(config)# interface port-channel 1
Router1(config-if)# no shutdown
Router1(config-if)# interface range GigabitEthernet0/1 - 2
Router1(config-if-range)# channel-group 1 mode active
```
- **在路由器2上**:
```shell
Router2(config)# interface port-channel 1
Router2(config-if)# no shutdown
Router2(config-if)# interface range GigabitEthernet0/1 - 2
Router2(config-if-range)# channel-group 1 mode active
```
### 4. 配置VLAN
- **在交换机1上**:
```shell
Switch1(config)# vlan 10
Switch1(config-vlan)# name VLAN10
Switch1(config-vlan)# exit
Switch1(config)# interface range GigabitEthernet0/1 - 2
Switch1(config-if-range)# switchport mode access
Switch1(config-if-range)# switchport access vlan 10
```
- **在交换机2上**:
```shell
Switch2(config)# vlan 20
Switch2(config-vlan)# name VLAN20
Switch2(config-vlan)# exit
Switch2(config)# interface range GigabitEthernet0/1 - 2
Switch2(config-if-range)# switchport mode access
Switch2(config-if-range)# switchport access vlan 20
```
- **配置VLAN间路由**:
```shell
Router2(config)# interface GigabitEthernet0/0.10
Router2(config-subif)# encapsulation dot1Q 10
Router2(config-subif)# ip address 192.168.10.1 255.255.255.0
Router2(config-subif)# exit
Router2(config)# interface GigabitEthernet0/0.20
Router2(config-subif)# encapsulation dot1Q 20
Router2(config-subif)# ip address 192.168.20.1 255.255.255.0
```
### 5. 使用FTP客户端
- **从FTP服务器下载文件**:
```shell
FTP Client> open 192.168.1.1
FTP Client> user username
FTP Client> password
FTP Client> cd /doc_AAA
FTP Client> get file_server_AAA.txt file_client_AAA.txt
```
### 实训提交
- **现场检查**:
- 确保所有配置正确无误,网络拓扑图搭建完整,各设备功能正常。
以上命令汇总涵盖了《综合练习1》中的所有主要步骤和配置。
阅读全文
相关推荐
















