HCDA-11-配置直连路由
1、什么是路由?
路由实际上就是网络世界中的一张地图,用来指导网络设备将报文从源转发至目的地。
2、路由有几种类型?
三种:直连路由、静态路由、动态路由
3、什么是直连路由?
直连路由是路由器的直连网段生成的。当路由器的接口配置了IP 地址,并且接口处于开启状态时,路由器就会生成一条接口IP对应网段的直连路由
形象来看直连路由就是路由器家门口的路。
执行步骤:
1、配置接口IP
2、查看接口IP
3、查看路由表:display ip routing-table(可以看到接口IP对应的直连路由)
The device is running! ###### <Huawei>SYS <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]SYS [Huawei]sysname R1 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]ip add 12.1.1.1 24 Oct 25 2018 16:07:58-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R1-GigabitEthernet0/0/0]quit [R1]disp [R1]display ip int brq ^ Error: Wrong parameter found at '^' position. [R1]display ip int br [R1]display ip int brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 2 The number of interface that is DOWN in Physical is 2 The number of interface that is UP in Protocol is 2 The number of interface that is DOWN in Protocol is 2 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 12.1.1.1/24 up up GigabitEthernet0/0/1 unassigned down down GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [R1]disp [R1]display ip rou [R1]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 12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet 0/0/0 12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 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 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]shut [R1-GigabitEthernet0/0/0]shutdown Oct 25 2018 16:09:25-08:00 R1 %%01IFPDT/4/IF_STATE(l)[2]:Interface GigabitEthern et0/0/0 has turned into DOWN state. [R1-GigabitEthernet0/0/0] [R1-GigabitEthernet0/0/0] Oct 25 2018 16:09:25-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the DOWN state. [R1-GigabitEthernet0/0/0]quit [R1]disp [R1]display ip rou [R1]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 4 Routes : 4 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 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 [R1]int g0/0/0 [R1-GigabitEthernet0/0/0]undo [R1-GigabitEthernet0/0/0]undo shu [R1-GigabitEthernet0/0/0]undo shutdown [R1-GigabitEthernet0/0/0]quit Oct 25 2018 16:09:58-08:00 R1 %%01IFPDT/4/IF_STATE(l)[4]:Interface GigabitEthern et0/0/0 has turned into UP state. [R1-GigabitEthernet0/0/0]quit Oct 25 2018 16:09:58-08:00 R1 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R1-GigabitEthernet0/0/0]quit [R1]dis [R1]display ip [R1]display ip rou [R1]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 12.1.1.0/24 Direct 0 0 D 12.1.1.1 GigabitEthernet 0/0/0 12.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 12.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 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 [R1]
The device is running! ############################################################## <Huawei> Oct 25 2018 16:07:00-08:00 Huawei %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEt hernet0/0/0 has turned into UP state. <Huawei>sys <Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sy [Huawei]sysname R2 [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24 Oct 25 2018 16:08:23-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R2-GigabitEthernet0/0/0]quit [R2]disp [R2]display ip int br [R2]display ip int brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 2 The number of interface that is DOWN in Physical is 2 The number of interface that is UP in Protocol is 2 The number of interface that is DOWN in Protocol is 2 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 12.1.1.2/24 up up GigabitEthernet0/0/1 unassigned down down GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [R2] Oct 25 2018 16:09:31-08:00 R2 %%01IFPDT/4/IF_STATE(l)[2]:Interface GigabitEthern et0/0/0 has turned into DOWN state. [R2] Oct 25 2018 16:09:31-08:00 R2 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the DOWN state. [R2] Oct 25 2018 16:09:57-08:00 R2 %%01IFPDT/4/IF_STATE(l)[4]:Interface GigabitEthern et0/0/0 has turned into UP state. [R2] Oct 25 2018 16:09:57-08:00 R2 %%01IFNET/4/LINK_STATE(l)[5]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R2]