使用eNSP搭建环境,如图
一、配置路由器接口IP:
1.R1路由IP配置:
<Huawei>sys(进入系统视图)
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1(将名字更改为R1,方便记录)
[R1]interface GigabitEthernet 0/0/0(进入GigabitEthernet 0/0/0接口)
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24(配置IP地址)
[R1-GigabitEthernet0/0/0]interface GigabitEthernet 0/0/1(进入GigabitEthernet 0/0/1接口)
[R1-GigabitEthernet0/0/1]ip address 192.168.2.1 24(配置IP地址)
2.R2路由IP配置:
<Huawei>sys(进入系统视图)
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2(将名字更改为R2,方便记录)
[R2] interface GigabitEthernet 0/0/0(进入GigabitEthernet 0/0/0接口)
[R2-GigabitEthernet0/0/0]ip address 192.168.2.2 24(配置IP地址)
[R2-GigabitEthernet0/0/0] interface GigabitEthernet 0/0/1(进入GigabitEthernet 0/0/1接口)
[R2-GigabitEthernet0/0/1]ip address 192.168.3.1 24(配置IP地址)
- R3路由IP配置:
<Huawei>sys(进入系统视图)
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3(将名字更改为R3,方便记录)
[R3] interface GigabitEthernet 0/0/1(进入GigabitEthernet 0/0/1接口)
[R3-GigabitEthernet0/0/1]ip address 192.168.3.2 24(配置IP地址)
[R3-GigabitEthernet0/0/1] interface GigabitEthernet 0/0/0(进入GigabitEthernet 0/0/0接口)
[R3-GigabitEthernet0/0/0]ip address 192.168.4.1 24(配置IP地址)
二、配置默认与静态路由:
- R1默认路由配置:
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.2.2(配置默认路由) - R2静态路由配置:
[R2]ip route-static 192.168.1.0 24 192.168.2.1(配置静态路由)
[R2]ip route-static 192.168.4.0 24 192.168.3.2(配置静态路由) - R3默认路由配置:
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.3.1(配置默认路由)
三、配置PC机IP与网关
PC1如图:(不要忘记应用)
PC2如图:(不要忘记应用)
四、测试互通
PC1与PC2正常互通
原文地址:https://blog.51cto.com/14313079/2388896