华为ensp实验拓扑一熟悉常用的IP相关命令拓扑

华为ensp实验拓扑一熟悉常用的IP相关命令拓扑
文章图片

实验编址



打开R1的命令行界面,默认是用户视图,在用户视图下,用户可以完成查看运行状态和统计信息等功能。

路由器主机名默认是Huawei
更改主机名要先进入系统视图
system-view
[Huawei]
[Huawei]sysname R1
输完以后退出当前模式
[R1]quit
保存配置用sav
save


save
The current configuration will be written to the device.
Are you sure to continue? (y/n)[n]:y
输入y,就可以保存了
配置路由器接口IP地址
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.0.1.254 255.255.255.0
华为设备上的物理接口默认都是开启状态。
配置完成以后,使用display ip interface brief


*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1


InterfaceIP Address/MaskPhysicalProtocol
GigabitEthernet0/0/010.0.1.254/24upup
GigabitEthernet0/0/110.0.2.254/24upup
GigabitEthernet0/0/2unassigneddowndown
NULL0unassignedupup(s)

同样的方法设置GE 0/0/1的IP地址
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.2.254 255.255.255.0
如果忘记命令可以输入inter?再按tab键补齐
配置完成后,再次确认接口与IP相关摘要信息
display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
【华为ensp实验拓扑一熟悉常用的IP相关命令拓扑】

InterfaceIP Address/MaskPhysicalProtocol
GigabitEthernet0/0/010.0.1.254/24upup
GigabitEthernet0/0/110.0.2.254/24upup
GigabitEthernet0/0/2unassigneddowndown
NULL0unassignedupup(s)
路由器接口的IP地址已经配置完成,可以使用display ip routing-table
display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10Routes : 10


Destination/MaskProtoPreCostFlags NextHopInterface


10.0.1.0/24Direct00D10.0.1.254GigabitEthernet
0/0/0
10.0.1.254/32Direct00D127.0.0.1GigabitEthernet
0/0/0
10.0.1.255/32Direct00D127.0.0.1GigabitEthernet
0/0/0
10.0.2.0/24Direct00D10.0.2.254GigabitEthernet
0/0/1
10.0.2.254/32Direct00D127.0.0.1GigabitEthernet
0/0/1
10.0.2.255/32Direct00D127.0.0.1GigabitEthernet
0/0/1
127.0.0.0/8Direct00D127.0.0.1InLoopBack0
127.0.0.1/32Direct00D127.0.0.1InLoopBack0
127.255.255.255/32Direct00D127.0.0.1InLoopBack0
255.255.255.255/32Direct00D127.0.0.1InLoopBack0
可以看到路由器R1在GE0/0/0接口上直连了一个10.0.1.0/24的网段,在GE0/0/1接口上直连了一个10.0.2.0/24的网段
"Route Flags"为路由标记。“R”表示该路由是迭代路由,"D"表示该路由下发到FIB表。
“Route Tables:Public”表示此路由表是公网路由表,如果是私网路由表,则显示私网的名称
如“Route Tables:ABC”
Destinations 目标网络主机的总数
“Routes“表示路由总数
”Proto“表示接受此路由的路由协议,”Direct"表示直连路由
“NextHop”表示此路由的下一跳地址
“Interface”路由的下一跳的出接口

思考题:
简化display ip interface brief
答:可以直接输 dis ip in br
转载于:https://blog.51cto.com/bukuxiaoheshang/1911303

    推荐阅读