第六天 HCIA 149
今日授课内容:
1、静态路由介绍
静态路由的配置 第一步:基本配置 IP地址 连通性的测试
第二步:R1访问192.168.23.3路由 [R1]ip route-static 192.168.23.0 24 GigabitEthernet 0/0/0 192.168.12.2
检查静态路由是否生效 [R1]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> ----路由条目在active里面才表示生效 Destinations : 1 Routes : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.23.0/24 Static 60 0 D 192.168.12.2 GigabitEthernet 0/0/0
Static routing table status : <Inactive> Destinations : 0 Routes : 0
[R1]
R1会根据路由表RIB把去往192.168.23.3从出接口G00/0/0 发出 传递给R2设备
R2设备会检查路由表RIB 发现到达192.168.23.3 是我直连 从而把数据包传递给R3设备
R3设备收到SIP 192.168.12.1 DIP 192.168.23.3 刚好目标IP是我自己的接口IP地址 会进行接收
R3将数据包进行返回 SIP 192.168.23.3 DIP 192.168.12.1 我们可以在R3上面写到达192.168.12.0静态路由 ip route-static 192.168.12.0 255.255.255.0 GigabitEthernet0/0/1 192.168.23.2 检查如下: [R3]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
192.168.12.0/24 Static 60 0 D 192.168.23.2 GigabitEthernet 0/0/1
Static routing table status : <Inactive> Destinations : 0 Routes : 0
R3设备会检查路由表RIB 发现到达192.168.12.1 从而把数据包传递给R2设备
R2设备会检查路由表RIB 发现到达192.168.12.1 是我直连 从而把数据包传递给R1设备
R1设备收到SIP 192.168.23.3 DIP 192.168.12.1 刚好目标IP是我自己的接口IP地址 会进行接收
第三步:能够访问成功 <R1>ping 192.168.23.3 PING 192.168.23.3: 56 data bytes, press CTRL_C to break Reply from 192.168.23.3: bytes=56 Sequence=1 ttl=254 time=50 ms Reply from 192.168.23.3: bytes=56 Sequence=2 ttl=254 time=40 ms Reply from 192.168.23.3: bytes=56 Sequence=3 ttl=254 time=20 ms Reply from 192.168.23.3: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 192.168.23.3: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 192.168.23.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 20/34/50 ms
<R1>
2、静态路由应用场景 小型网络 用静态路由来保证咱们数据传输 大型网络 静态路由优化咱们网络架构
3、静态路由的缺点 人工配置,配置量大,容易出错
如果配置错误了 用TTL值来防环
默认路由
MA网络 多路访问 比如:Ethernet A、使用下一跳 B、使用出接口+下一跳
P2P网络 点对点网络 比如:PPP A、使用出接口 B、使用下一跳 C、使用出接口+下一跳
3、负载分担和浮动路由介绍
负载分担 当断掉其中一个链路 立马就可以通信
对于数通来说 来回路径不一致没问题