#进入试图模式
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
#进入主机R1,同时起名为R1
[Huawei]sys R1
#给0/0/0接口设置IP地址和掩码
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.26.2 24
#开启路由0/0/0的接口
[R1-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
#查看配置的路由接口是否开启
[R1-GigabitEthernet0/0/0]display interface brief
PHY: Physical
*down: administratively down
(l): loopback
(s): spoofing
(b): BFD down
^down: standby
(e): ETHOAM down
(d): Dampening Suppressed
InUti/OutUti: input utility/output utility
Interface PHY Protocol InUti OutUti inErrors outErrors
GigabitEthernet0/0/0 up up 0% 0% 0 0
GigabitEthernet0/0/1 down down 0% 0% 0 0
GigabitEthernet0/0/2 down down 0% 0% 0 0
NULL0 up up(s) 0% 0% 0 0
#查看路由表,发现路由配置没有问题
[R1-GigabitEthernet0/0/0]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.26.0/24 Direct 0 0 D 192.168.26.2 GigabitEthernet
0/0/0
192.168.26.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.26.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0