华为ENSP静态路由的配置

实验目的:

•理解路由器的工作原理;

•掌握路由器的基本操作。

网络拓展图:

 第一台主机:

关于网关的配置,网关需要设置成路由器左端端口的ip,这个ip为192.168.1.254,会在接下来的路由器接口ip配置中去设置。

第二台PC:

  为了突出随意性,我把第一台主机设置成局域网192.168.1.1.然后子网掩码设置成255.255.255.0.网关设置为192.168.1.254。同理第二台我们设置为110.120.119.1.然后子网掩码设置成255.255.255.0.网关设置为110.120.119.254。

路由器的设置:

第一个路由器的所有命令如下:

sys

int g0/0/0

ip address 192.168.1.254 24

int g0/0/1

ip add 100.100.100.1 24
ip route-static 110.120.119.0 24 100.100.100.254

进入PC和一个路由器相连的接口(命令为int g0/0/0),IP地址设置为192.168.1.254  244。也就是PC的网关地址。如下所示:

        我们进行静态路由的设置。一条静态路由条目一般由3部分组成:目的IP地址或者叫信宿网络、子网;子网掩码;网关或叫下一跳的地址。我们这一台的PC的目的地址是另外一台ip的子网。子网掩码是24位,下一条的地址就是另一个路由器的地址。我们这里设置为100.100.100.254.所以我们的命令是ip route-static 110.120.119.0 24 100.100.100.254.

查看路由表(不是必须要做的工作):

  如果想查看是不是静态路由设置完成,可以使用查看路由表的命令display ip routing-table

没设置之前如下:

After setting up the route:

 

 The above shows the success of the static route setting, record the address of the next hop

second router

All commands are as follows:

sys

int g0/0/0

ip add 100.100.100.254 24
int g0/0/1
ip add 110.120.119.254 24
ip route-static 192.168.1.0 24 100.100.100.1

     We set the ip of another router as 100.100100.254. The other interface is set as the gateway of PC to 110.119.120.254. The specific page settings are as follows:

Here we set the static route, the destination address is changed to the ip of the first one, and the subnet mask is the same. The next router is changed to AR1.

The result display:

Next, we will show the results. We use the first PC to ping the second PC. The result obtained is as follows:

It can be seen that the experiment was a complete success.

It is relatively simple to set up static routing, the main thing is to understand the format of the settings. Destination address, subnet mask, next hop address.

Guess you like

Origin blog.csdn.net/weixin_53665577/article/details/128889039