专业认证

关注公众号 jb51net

关闭
IT专业知识 > 专业认证 >

HCIA认证学习笔记6:VRP文件管理,静态路由操作示例

Tachyon.xue

本文讲述了HCIA认证学习笔记6:VRP文件管理,静态路由操作。分享给大家供大家参考,具体如下:

1、VRP文件管理

FTP基于TCP(TCP对网络开销打,但是他是可靠传输);TFTP基于UDP(UDP对网络开销不大,但是他是不可靠传输)

2、静态路由

2.1、IP路由的基础

路由器的基本功能一个是决策(RIB)一个是转发(FIB)

看下如何转发的

<tachyonAR01>display fib  //查看转发表
Route Flags: G - Gateway Route, H - Host Route,    U - Up Route
             S - Static Route,  D - Dynamic Route, B - Black Hole Route
             L - Vlink Route
--------------------------------------------------------------------------------
 FIB Table:
 Total number of Routes : 7 
 
Destination/Mask   Nexthop         Flag  TimeStamp     Interface      TunnelID
10.1.1.255/32      127.0.0.1       HU    t[2006]       InLoop0        0x0
10.1.1.1/32        127.0.0.1       HU    t[2006]       InLoop0        0x0
255.255.255.255/32 127.0.0.1       HU    t[3]          InLoop0        0x0
127.255.255.255/32 127.0.0.1       HU    t[3]          InLoop0        0x0
127.0.0.1/32       127.0.0.1       HU    t[3]          InLoop0        0x0
127.0.0.0/8        127.0.0.1       U     t[3]          InLoop0        0x0
10.1.1.0/24        10.1.1.1        U     t[2006]       GE0/0/0        0x0

2.2、LAN和广播域

广播域就是一个是网络(子网)

路由器隔离广播域(一个接口就是一个网络)

2.3、路由选路

路由表(控制层面)不一定和报文转发在同一个路径上

R - relay,代表下一跳设备不是本设备的直连,需要做路由更迭才可以到达
D - download to fib,装载到路由表

2.4、路由的原理

静态路由配置

在这里插入图片描述

它有3个可以选择的方案1是下一跳的方案;2是出接口的方案;3是出接口+下一跳的方案

IP转发,称之为逐跳转发“跳”指的就是设备

ensp实验(演示静态路由)

在这里插入图片描述

AR1

<Huawei>system-view
[Huawei]sysname tachyonAR01
[tachyonAR01]interface GigabitEthernet 0/0/0
[tachyonAR01-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[tachyonAR01-GigabitEthernet0/0/0]q
[tachyonAR01]interface GigabitEthernet 0/0/1
[tachyonAR01-GigabitEthernet0/0/1]ip address 13.1.1.1 24
[tachyonAR01]ip route-static 44.1.1.1 32 12.1.1.2   //配置去往44.1.1.1/32的主机,下一跳是12.1.1.2(第一条路)
[tachyonAR01]ip route-static 44.1.1.1 32 13.1.1.3   //配置去往44.1.1.1/32的主机,下一跳是13.1.1.3(第二条路)
[tachyonAR01]display ip routing-table  protocol static //查看静态路由协议
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
//可以看出去往同一个目的地44.1.1.1/32,我们有两个下一跳,这就称之为负载均衡的方式
       44.1.1.1/32  Static  60   0          RD   12.1.1.2        GigabitEthernet0/0/0
                    Static  60   0          RD   13.1.1.3        GigabitEthernet0/0/1

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

AR2

<Huawei>system-view
[Huawei]sysname tachyonAR02
[tachyonAR02]interface GigabitEthernet 0/0/0
[tachyonAR02-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[tachyonAR02-GigabitEthernet0/0/0]q
[tachyonAR02]interface GigabitEthernet 0/0/1
[tachyonAR02-GigabitEthernet0/0/1]ip address 24.1.1.2 24
[tachyonAR02]ip route-static 44.1.1.1 32 24.1.1.4   //配置去往44.1.1.1/32的主机,下一跳是24.1.1.4
[tachyonAR02]display ip routing-table protocol static //查看静态路由协议
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 1        Configured Routes : 1

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       44.1.1.1/32  Static  60   0          RD   24.1.1.4        GigabitEthernet0/0/1

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

AR3

<Huawei>system-view 
[Huawei]sysname tachyonAR03
[tachyonAR03]interface GigabitEthernet 0/0/0
[tachyonAR03-GigabitEthernet0/0/0]ip address 34.1.1.3 24
[tachyonAR03-GigabitEthernet0/0/0]q
[tachyonAR03]interface GigabitEthernet 0/0/1 
[tachyonAR03-GigabitEthernet0/0/1]ip address 13.1.1.3 24
[tachyonAR03]ip route-static 44.1.1.1 32 34.1.1.4  //配置去往44.1.1.1/32的主机,下一跳是34.1.1.4
[tachyonAR03]display ip routing-table protocol static  //查看静态路由协议
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 1        Configured Routes : 1

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

       44.1.1.1/32  Static  60   0          RD   34.1.1.4        GigabitEthernet0/0/0

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0

AR4

<Huawei>system-view 
[Huawei]sysname tachyonAR04
[tachyonAR04]interface GigabitEthernet 0/0/0
[tachyonAR04-GigabitEthernet0/0/0]ip address 34.1.1.4 24
[tachyonAR04-GigabitEthernet0/0/0]q
[tachyonAR04]interface GigabitEthernet 0/0/1
[tachyonAR04-GigabitEthernet0/0/1]ip address 24.1.1.4 24
[tachyonAR04-GigabitEthernet0/0/1]q
[tachyonAR04]interface LoopBack 0                //进入设备环回口
[tachyonAR04-LoopBack0]ip address 44.1.1.1 32    //为环回口配置1个主机地址
[tachyonAR04]ip route-static 12.1.1.0 24 24.1.1.2  //去往12.1.10/24的网络,下一跳24.1.1.2(这也是本实验的返回路由)(第一条路)
[tachyonAR04]ip route-static 12.1.1.0 24 34.1.1.3  //去往12.1.10/24的网络,下一跳34.1.1.3(这也是本实验的返回路由)(第二条路)
[tachyonAR04]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 2

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
//可以看出去往同一个目的地12.1.1.0/24,我们有两个下一跳,这就称之为负载均衡的方式(返回)
       12.1.1.0/24  Static  60   0          RD   24.1.1.2        GigabitEthernet0/0/1
                    Static  60   0          RD   34.1.1.3        GigabitEthernet0/0/0

Static routing table status : <Inactive>
         Destinations : 0        Routes : 0
<tachyonAR04>ping -a 44.1.1.1 12.1.1.1    //直接ping12.1.1.1不通是因为写路由。只能-a表明我们是从环回接口发出去的,直接ping它会认为我们已物理接口发出。
  PING 12.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 12.1.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms
    Reply from 12.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 12.1.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms
    Reply from 12.1.1.1: bytes=56 Sequence=5 ttl=254 time=40 ms

  --- 12.1.1.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/28/40 ms

另:

如何开启设备debug

<tachyonAR04>debugging ip icmp    //开启ICMP的debug功能
<tachyonAR04>terminal debugging   //允许在终端上显示