静态路由StaticRou.ppt
静态路由Static Route,深圳职业技术学院计算机系网络专业,教学目标(Objectives),1.IP路由(IP Routing)2.路由选择和路由表(Path Determination and IP Routing Table)3.路由数据包(Routing Packets)4.路径交换(Path Switching)5.被路由协议与路由协议(Routed Protocol and Routing Protocol)6.静态路由和动态路由(Static Routes and Dynamic Routes)7.静态路由(Static Route)8.默认路由(Default Route),路由选择和路由表(Path Determination and IP Routing Table),为了路由数据包,路由器应该知道:To route,a router needs to know:目的地址(Destination addresses)源地址(Sources it can learn from)可能路由(Possible routes)最佳路由(Best route)维护和更新路由信息(Maintain and verify routing information),路由选择和路由表(Path Determination and IP Routing Table),路由器怎样传递数据包(How Routers Route Packets from Source to Destination),1.拆包(remove the data link layer address)2.查表(refer to the routing table)3.打包(encapsulating a new frame)4.转发(forwarding the packet),路由器怎样传递数据包How Routers Route Packets from Source to Destination,主机地址和网络地址(Network Addressing and Host Addressing),路由器用网络地址来确定数据包的目的网络。The router uses the network address to identify the destination network(LAN)of a packet within an internetwork.,路由器确定网络地址(Determining Network Address),路径交换(Path Switching),数据包在传递过程中,网络地址保持不变,MAC地址在不断的变化。As the packet move through the internetwork,its MAC address changes,but its network address remains the same.,被路由协议和路由协议(Routed Protocol and Routing Protocol),被路由协议:用来在路由器之间传递用户的信息Routed protocols:transport data across a network.(IP,IPX)路由协议:用于维护路由器的路由表Routing protocols:allow routers to choose the best path for data from source to destination.(RIP,OSPF,EIGRP),1.静态路由:网络管理员手工定义Static Route:Uses a route that a network administrator enters into the router manually,2.动态路由:自动适应网络拓扑结构变化Dynamic Route:Uses a route that a network routing protocol adjusts automatically for topology or traffic changes,静态路由和动态路由(Static Routes and Dynamic Routes),S0/0,静态路由(Static Routes),B,Network,A,B,Stub Network,S0/0,静态路由操作(Static Route Operation),1.网络管理员配置静态路由Network administrator configures the route 2.路由器将静态路由装入路由表中Router installs the route in the routing table 3.使用静态路由转发数据包Packets are routed using the static route,存根网络(Stub Network),存根网络对外只有一个出口,配置静态路由就足够了When a network is accessible by only one path,a static route to the network can be sufficient.This type of network is called a stub network.,静态路由定义了一条到目标网络或子网的路径Defines a path to an IP destination network or subnet,Router(config)#ip route network mask address|interfacedistance,配置静态路由(Static Route Configuration),ip route:静态路由配置命令(command)Network:目标网络(destination network)mask:网络掩码(subnet mask)Address:下一跳地址(Next-hop address)Interface:本地出接口(Local outgoing interface)Distance:管理距离(administrative distance),Stub Network,S0/0,配置静态路由实例(Static Route Example),B,Network,A,B,这只是单向配置,在另一端也必须有相应的路由,网络才通 This is a unidirectional route.You must have a route configured in the opposite direction.,验证静态路由配置(Verifying Static Route Configuration),R1#show ip route(查看路由表)Gateway of last resort is not setsubnetted,1 subnetsC 1.1.1.0 is directly connected,Loopback0subnetted,1 subnetssubnetted,1 subnetsC 12.12.12.0 is directly connected,Serial0/0,默认路由(Default Routes),当数据包的网络在路由表中每匹配的时候,就使用默认路由转发数据包。如果没有默认路由,则丢包。Default routes are used to route packets with destinations that do not match any of the other routes in the routing table.If default route is not configred,just drop it。,Stub Network,ip route 172.16.2.2,默认路由配置实例(Default Routes Example),S0/0,B,Network,A,B,This route allows the stub network to reach all known networks beyond router A.0.0.0.0 用于默认路由,验证默认路由配置(Verifying Default Route Configuration),R1#show ip route(查看路由表)subnetted,1 subnetsC 1.1.1.0 is directly connected,Loopback0subnetted,1 subnetssubnetted,1 subnetsC 12.12.12.0 is directly connected,Serial0/0,Case Study,配置静态路由,确保网络畅通,思考题(Questions),1.路由器怎样传递数据包?2.路由器怎样计算网络地址?3.数据包在传递过程中,路径交换的特征是怎样的?4.被路由协议和路由协议的作用是怎样的?5.静态路由和动态路由的特征是什么?6.为什么使用默认路由?,