HCNA-2 熟悉相关常用的IP命令
1、配置时钟 <Huawei>clocktimezone BJ add 8:00:00 //配置时区 <Huawei>clockdatetime 17:16 2020-04-13 //配置日期时间 <Huawei>displayclock //查看时钟 2020-04-1317:16:13 Monday Time Zone(BJ): UTC+08:00
2、配置路由接口IP地址 <Huawei>system-view //系统视图 [Huawei]sysnameRouter1 //配置设备名称 [Router1]interfaceGigabitEthernet 0/0/0 //GE 0/0/0 接口视图 [Router1-GigabitEthernet0/0/0]ipaddress 10.1.1.1 24 //配置GE 0/0/0接口IP 掩码 [Router1-GigabitEthernet0/0/0]quit //退出 [Router1]interfaceGigabitEthernet 0/0/1 [Router1-GigabitEthernet0/0/1]ipaddress 10.1.2.1 24 [Router1-GigabitEthernet0/0/1]quit [Router1]displayip interface brief //显示IP接口简介 *down:administratively down ^down:standby (l):loopback (s):spoofing The numberof interface that is UP in Physical is 3 The numberof interface that is DOWN in Physical is 1 The numberof interface that is UP in Protocol is 3 The numberof interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 10.1.1.1/24 up up GigabitEthernet0/0/1 10.1.2.1/24 up up GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s)
3、查看路由配置信息 [Router1]displayip routing-table //查看IP路由表 RouteFlags: R - relay, D - download to fib ------------------------------------------------------------------------------ RoutingTables: Public Destinations : 10 Routes : 10 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet 0/0/0 10.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.2.0/24 Direct 0 0 D 10.1.2.1 GigabitEthernet 0/0/1 10.1.2.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 10.1.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 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 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
注释: Route Flags:路由标记 R=迭代路由 D=该路由下发到FIB表RoutingTables: Public:表示此路由是全局路由表 Destinations:表示目的网络/主机的总数 Routes : 表示路由的总数 Destination/Mask:表示目的网络/主机的地址和掩码长度 Proto:表示接收此路由协议 Direct:表示直连路由 Pre:表示此路由优先级 Cost:表示此路由的路由开销值 NextHop:表示此路由的下一跳地址 Interface:表示此路由下一跳的出接口
4、保存配置 [Router1]return //返回用户视图 <Router1>save //保存配置 The current configuration will be written tothe device. Are you sure to continue? (y/n)[n]:y //确认继续 It will take several minutes to saveconfiguration file, please wait......... Configuration file had been savedsuccessfully Note: The configuration file will take effectafter being activated |