基于华为ensp详细命令
时间: 2024-10-17 10:10:53 浏览: 132
实验01:基于ensp实操设备直连通信
为了实现A公司和B公司的网络通信改进项目,以下是基于华为ENSP的详细配置命令:
### 1. 网络拓扑搭建
- 使用合适的线缆连接各个设备,参照网络拓扑图。
- R1为A公司的网关,R3为B公司的网关。
### 2. 设备地址配置
#### A公司
- **R1**
```shell
sysname R1
interface GigabitEthernet0/0/1
ip address 192.168.10.1 255.255.255.0
interface GigabitEthernet0/0/2
ip address 192.168.20.1 255.255.255.0
interface GigabitEthernet0/0/3
ip address 192.168.30.1 255.255.255.0
interface GigabitEthernet0/0/4
ip address 192.168.40.1 255.255.255.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
```
- **R4**
```shell
sysname R4
interface GigabitEthernet0/0/1
ip address 192.168.30.2 255.255.255.0
interface GigabitEthernet0/0/2
ip address 192.168.40.2 255.255.255.0
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
```
- **Ser**
```shell
sysname Ser
interface GigabitEthernet0/0/1
ip address 192.168.30.3 255.255.255.0
```
- **PC1, PC2, PC4**
```shell
# PC1
ip address 192.168.10.2 255.255.255.0
gateway 192.168.10.1
# PC2
ip address 192.168.20.2 255.255.255.0
gateway 192.168.20.1
# PC4
ip address 192.168.40.2 255.255.255.0
gateway 192.168.40.1
```
#### B公司
- **R3**
```shell
sysname R3
interface GigabitEthernet0/0/1
ip address 192.168.50.1 255.255.255.0
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
```
- **R5**
```shell
sysname R5
interface GigabitEthernet0/0/1
ip address 192.168.50.2 255.255.255.0
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
```
- **PC5**
```shell
ip address 192.168.50.2 255.255.255.0
gateway 192.168.50.1
```
### 3. 启用OSPF协议
#### A公司
- **R1**
```shell
ospf 1
area 0
network 192.168.10.0 0.0.0.255
network 192.168.20.0 0.0.0.255
network 192.168.30.0 0.0.0.255
network 192.168.40.0 0.0.0.255
network 1.1.1.1 0.0.0.0
```
- **R4**
```shell
ospf 1
area 0
network 192.168.30.0 0.0.0.255
network 192.168.40.0 0.0.0.255
network 4.4.4.4 0.0.0.0
```
#### B公司
- **R3**
```shell
ospf 120
area 0
network 192.168.50.0 0.0.0.255
network 3.3.3.3 0.0.0.0
```
- **R5**
```shell
ospf 120
area 0
network 192.168.50.0 0.0.0.255
network 5.5.5.5 0.0.0.0
```
### 4. 远程登录配置
- **R1 和 R4**
```shell
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh
aaa
local-user admin password cipher Admin@123
local-user admin service-type telnet terminal ssh
ip ssh server enable
ip ssh client first-time enable
```
- **Ser**
```shell
ip ssh server enable
ip ssh client first-time enable
```
### 5. 新增部门网络
- **R4**
```shell
interface GigabitEthernet0/0/3
ip address 192.168.60.1 255.255.255.0
```
- **新PC**
```shell
ip address 192.168.60.2 255.255.255.0
gateway 192.168.60.1
```
- **R4 OSPF配置**
```shell
ospf 1
area 0
network 192.168.60.0 0.0.0.255
```
### 6. NAT配置
- **R1**
```shell
nat outbound 2000
acl number 2000
rule 5 permit ip source 192.168.10.0 0.0.0.255
rule 10 permit ip source 192.168.20.0 0.0.0.255
rule 15 permit ip source 192.168.30.0 0.0.0.255
rule 20 permit ip source 192.168.40.0 0.0.0.255
interface GigabitEthernet0/0/5
ip address 202.100.1.1 255.255.255.0
nat outbound 2000
```
### 7. VRRP配置
- **R3 和 R5**
```shell
# R3
interface GigabitEthernet0/0/1
vrrp vrid 1 virtual-ip 192.168.50.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 20
# R5
interface GigabitEthernet0/0/1
vrrp vrid 1 virtual-ip 192.168.50.254
vrrp vrid 1 priority 100
vrrp vrid 1 preempt-mode timer delay 20
```
### 8. 结果验证
- **A公司**
- 检查OSPF邻居关系
```shell
display ospf peer brief
```
- 检查NAT转换
```shell
display nat session
```
- **B公司**
- 检查VRRP状态
```shell
display vrrp
```
- 检查PC5上网
```shell
ping www.example.com
```
以上是基于华为ENSP的详细配置命令,确保所有设备按照上述步骤进行配置,以实现项目的各项需求。
阅读全文