静态路由与缺省路由配置案例
如何配置缺省路由

1、应用场景
缺省路由是一种特殊的路由,在路由表中缺省路由以目的网络为0.0.0.0、子网掩码 为0.0.0.0的形式出现。缺省路由以其简单易用的特点在网络中有大量的应用,特别 是应用在中小型企业网络的出口设备上。应用缺省路由可以大大减小路由表项的规 模,减小维护压力。
如右图所示对于SwitchA而言,如果要到 达SwitchB所直连的172.16.1.0、172.16.2.0 、172.16.3.0网络,就必须有路由指引。如 果采用静态路由的方式为SwitchA添加路由 ,三个目的网络就需要配置三条静态路由 。这样不仅仅增加了配置工作量,另一方 面,也增加了SwitchA的负担,因为它需要 维护更多的路由条目,而承载路由条目的 路由表是需要占用设备内存资源的。
设备上演示……
精选可编辑ppt
3
如何配置缺省路由(默认路由)
3、检查配置结果
(1)配置完成后,可以通过display ip routing-table命令检查配置是否成功 。 可以看到在设备的IP路由表中增加了一条目的网段和子网掩码都是0的路由,这 条就是刚才配置的缺省路由。
精选可编辑ppt
4
配置了缺省路由以后,对于SwitchA来说,当数据包的目的IP匹配不到明细路由的时候将会使 用缺省路由指导报文转发。可作为交换机的“最后求助对象”使用
如何配置缺省路由(默认路由)
2、操作步骤
(1)配置步骤非常简单,只需要一条命令。 详细如下: [SwitchA] ip route-static 0.0.0.0 0.0.0.0 172.16.100.2
如何配置缺省路由(默认路由)
1、应用场景(续)
从网络设计及优化的角度,我们往往在保 证网络路由可达性的同时,尽量减少路由 器路由表的条目数量。 在右图这个场景中,由于SwitchA仅有一条 出口线路,因此我们可以在SwitchA上配置 一条缺省路由, 下一跳为SwitchB,这样 既可在保证SwitchA到SwitchB所直连的三 个网络可达的同时,路由条目达到最简。
实验三--路由器静态路由表配置实验

实验三、路由器静态路由表配置实验一、实验目的:1、进一步了解网络层,了解TCP/IP协议集2、了解IP配置和管理技术3、学习路由器操作,掌握路由器命令4、了解静态选路与动态选路5、进一步学习A、B、C、D、E五类IP地址二、基本原理:路由器是运行在OSI模型网络层上的网络设备,它们将网段和整个网络连接起来,如图3-1所示。
图3-1 路由选择路由器能使网络协议在不同的LAN和WAN系统之间转换,从而解决异构网络互联的问题。
路由器除支持静态路由算法外,还必须支持动态的、自适应的路由选择算法,常用的路由选择协议包括:路由信息协议(RIP)、增强内部网关协议(EIGRP)、和最短路径协议(OSPF)。
Microsoft 的Windows 2000 server 是一个具有完整功能的软件路由器,这意味着Windows2000 Server可以通过几个网络协议(如IPX/SPX各TCP/IP)在不同的网络中路由数据包。
与硬件路由器不同的是,硬件路由器是专门设计用来作路由选择用的,大多数的硬件路由器除了提供IP层的服务外,不执行其它的任务,而Windows 2000 Server软件路由器则同时提供网络层以上的功能。
路由表是一个TCP/IP路由选择集合,它包含了一些关于IP地址网络ID,及转发IP地址的数据,它可以使IP数据报文到达互联网络的某一个网段。
在实验室环境下,由于网络比较简单,路由表的内容不是很复杂,如果是登录到国际互联网,则路由表中的路由条目会比较多,但在实验环境与互联网环境下的路由论断命令是一样的。
路由表中有活动路由与可持续路由两个选项。
活动路由可以由操作系统添加到路由表中,也可以由你手工添加。
可持续路由是静态的,只能手工添加到路由表中。
两者之间的区别是,活动路由在计算机关闭和重启时被丢弃,但可持续路由总是保留在计算机中,除非手工删除这个路由表项。
Windows98环境下的路由命令有两个,一个是route命令,一个是tracert 命令,可以在命令提示符下运行。
静态路由和缺省路由的配置实验

试验三静态路由和缺省路由的配置实验目的1、复习路由器IOS的基本操作和基本命令的使用;2、复习路由器各种配置模式的应用;3、掌握静态路由的配置方法;4、掌握默认路由的设置位置和配置方法试验拓扑结构和相关器材[实验内容]一、按上图所示配置各个设备的名称和相关地址;1、路由器1、2、3、4的基本配置:(1)分别命名为R1、R2、R3和R4并设置特权模式密码(密码为123)(2)设置Telnet登陆用密码(密码为123)(3)给各个端口配IP地址(并设置DCE端的时钟)二、分别在路由器1、2、3、4上配置静态路由,使图中所示的5个网段之间可以相互通信。
Router(config)# ip route <network> [mask] {address|interface}配置完成后用show ip route 查看路由表三、测试:(1)在PC1上用ping命令测试各个PC之间的连通性。
分析出现这种结果的原因。
(2)在任意一台PC上用Telnet分别登录到三台路由器,看能否登陆能否对路由器进行配置。
四、查看各个路由器上的运行配置文件内容五、网络中什么位置可以设置默认路由?在步骤(二)的基础上配置默认路由,并检测设置默认路由后的网络连通性。
Router(config)#ip route 0.0.0.0 0.0.0.0<network-number>或Router(config)# ip default-network <network-number>配置完成后用show ip route 查看路由表六、测试:(1)在Router1上用ping命令测试各个PC之间的连通性。
分析出现这种结果的原因。
(2)用缺省路由的方式配置相关的设备,再次测试各个PC之间的连通性。
(3)在任意一台PC上用Telnet分别登录到三台路由器,看能否登陆能否对路由器进行配置。
七、记录试验结论和体会。
静态路由、缺省路由的配置

Pc3 ping pc5
• • • • • • • • • • C:\Documents and Settings\USER>ping 10.65.1.1 Pinging 10.65.1.1 with 32 bytes of data: Reply from 10.65.1.1: bytes=32 time<1ms TTL=126 Reply from 10.65.1.1: bytes=32 time<1ms TTL=126 Reply from 10.65.1.1: bytes=32 time<1ms TTL=126 Reply from 10.65.1.1: bytes=32 time<1ms TTL=126 Ping statistics for 10.65.1.1: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
实验一:静态路由 实现区域网络的连通
实验拓朴图
IP:10.68.1.2/16
F 1/1 F 1/0
IP:10.68.1.1/16
F 0/24
F 0/3
F 0/4
IP:10.65.1.2/16 IP:10.71.1.3/16
PC5
IP:10. IP: IP:10.71.1.1/16 网关: 网关:10.71.1.3
• • • • • • • • • • • •
Codes: C - connected, S - static, R - RIP B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS- IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is 10.68.1.1 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 10.68.1.1 C 10.65.0.0/16 is directly connected, FastEthernet 1/0 C 10.65.1.2/32 is local host. C 10.68.0.0/16 is directly connected, FastEthernet 1/1 C 10.68.1.2/32 is local host.
H3C路由器静态路由配置综合实例

静态路由配置案例。
路由器A配置:[routeA]interf ace e0[routeA-e0]ip addres s 192.168.0.1 255.255.255.0[routeA]interf ace s0[routeA-s0]ip addres s 192.168.1.1 255.255.255.0[routeA-s0]link-protoc ol ppp [配置封装协议][routeA]ip route-static192.168.3.0 255.255.255.0 192.168.1.2 prefer ence60 [设置静态路由,优先级为60]路由器B配置:[routeB]interf ace e0[routeB-e0]ip addres s 192.168.3.1 255.255.255.0[routeB]interf ace s0[routeB-s0]ip addres s 192.168.2.1 255.255.255.0[routeA-s0]link-protoc ol ppp [配置封装协议][routeA]ip route-static 192.168.0.0 255.255.255.0 192.168.1.1 prefer ence60 [设置静态路由,优先级为60]使用默认路由配置:缺省路由也是一种静态路由.简单地说,缺省路由就是在没有找到任保匹配置的路由项情况下,才使用的路由.即只有当无任何合适的路由时,缺省路由才被使用.[rotueA]ip route-statci 0.0.0.0 0.0.0.0 s0 prefer ence60『注意』上面命令中用到了Ser ial 0,接口的名字,如串口封装P P P 或HD LC协议,这时可以不用指定下一跳地址,只需指定发送接口即可。
H3C-preferrents静态路由配置

1 静态路由配置 ····································································································································· 1-1 1.1 简介 ···················································································································································1-1 1.1.1 静态路由 ·································································································································1-1 1.1.2 缺省路由 ·································································································································1-1 1.1.3 静态路由应用 ··························································································································1-1 1.2 配置静态路由·····································································································································1-2 1.2.1 配置准备 ·································································································································1-2 1.2.2 配置静态路由 ··························································································································1-2 1.3 静态路由显示和维护··························································································································1-3 1.4 静态路由典型配置举例 ······················································································································1-4 1.4.1 静态路由基本功能配置举例 ····································································································1-4
实验8静态路由、缺省路由配置

实验8 静态路由、缺省路由配置一、实验目的1.学习静态路由、缺省路由配置方法2.验证静态路由、缺省路由的工作原理。
二、实验步骤1、绘制拓扑图在绘图过程中,按照"够用为度"的原则,选择805型号路由器。
同时,在给两台路由器之间布线时要选择点到点类型,选择为DCE端的设备不要忘记配置时钟信号。
2、配置路由器(1)通过Boson NetSim中的工具栏按钮"eRouters"选择"R1"并按照下面的过程进行路由器进本参数的配置:Router>enableRouter#config terminalRouter(config)#hostname R1R1(config)#enable secret c1R1(config)#line vty 0 4R1(config-line)#pass c2R1(config-line)#interface ethernet 0R1(conf-if)#ip address 192.168.1.1 255.255.255.0R1(config-if)#no shutdownR1(config-if)#interface serial 0R1(config-if)#ip address 10.0.0.1 255.0.0.0R1(config-if)#no shutdownR1(config-if)#endR1#show ip interface briefR1#copy run start(2)通过Boson NetSim中的工具栏按钮"eRouters"选择"R2"并按照下面的过程进行路由器基本参数的配置:Router>enableRouter#config terminalRouter(config)#hostname R2R2(config)#enable secret c1R2(config)#line vty 0 4R2(config-line)#pass c2R2(config-line)#interface ethernet 0R2(conf-if)#ip address 192.168.2.1 255.255.255.0R2(config-if)#no shutdownR2(config-if)#interface serial 0R2(config-if)#ip address 10.0.0.2 255.255.255.0R2(config-if)#clock rate 64000R2(config-if)#no shutdownR2(config-if)#endR2#show ip interface briefR2#copy run start(3)通过Boson NetSim中的工具栏按钮"eStations"选择"PC1",通过WINIPCFG命令,配置PC1的IP地址为192.168.1.2,网关为192.168.1.1(4)通过Boson NetSim中的工具栏按钮"eStations"选择"PC2",通过WINIPCFG命令,配置PC1的IP地址为192.168.2.2,网关为192.168.2.1三、配置、测试静态路由选择路由器R1并配置相关的静态路由信息,如下所示:R1#config terminalR1(config)#ip route 192.168.2.0 255.255.255.0 10.0.0.2R1(config)#endR1#copy run startR1#show ip route选择路由器R2并配置相关的路由信息,如下所示:R2#config terminalR2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1R2(config)#endR2#copy run startR2#show ip route测试:在pc1中C:>Ping 192.168.2.2C:>tracert 192.168.2.2在pc2中C:>Ping 192.168.1.2C:>tracert 192.168.1.2四、配置、测试缺省路由假设R2位于端网络,保持路由器R1的静态路由配置不变,到路由器R2,并按照下面的步骤配置缺省路由。
静态路由实验报告

静态浮动路由一、实验目的(蓝色字体为参考格式, 具体内容结合实验编写)1.掌握静态路由的原理及配置;2.掌握静态缺省路由的原理及配置;3.掌握静态浮动路由的原理及配置;二、实验要求举例说明: 该部分可以是实习项目的实际需求(根据实习的实际内容自己填写)某公司网络如图所示:其中pc2是内网电脑, 要求在pc2上能ping通pc1(服务器8.8.8.8);在公司的边界路由器上为了可靠性使用了双线做备份, 但是查看RT2路由表正常情况下只能看到202.112.1.1为下一跳的路由, 当202.112.1.1网段的线缆断了才会出现202.113.1.1为下一跳的路由, 在RT1上也是同理;只能看到112的路由, 当112链路断掉才会出现113链路为下一跳的路由;三、实验内容及步骤1 网络拓扑(例如下图所示)2 方法和步骤2.1 : 配置IP地址:RT1:<RT1>system-viewSystem View: return to User View with Ctrl+Z.[RT1]int g0/0/1[RT1-GigabitEthernet0/0/1]ip add 12.1.1.1 255.255.255.0[RT1-GigabitEthernet0/0/1]int g0/0/2[RT1-GigabitEthernet0/0/2]ip add 10.1.1.1 255.255.255.0[RT1-GigabitEthernet0/0/2]int lo0[RT1-LoopBack0]ip add 1.1.1.1 255.255.255.255RT2:<RT2>system-viewSystem View: return to User View with Ctrl+Z.[RT2]int g0/0/1[RT2-GigabitEthernet0/0/1]ip add 12.1.1.2 255.255.255.0[RT2-GigabitEthernet0/0/1]int g0/0/2[RT2-GigabitEthernet0/0/2]ip add 10.1.1.2 255.255.255.0[RT2-GigabitEthernet0/0/2]int g0/0/0[RT2-GigabitEthernet0/0/0]ip add 23.1.1.2 255.255.255.0RT3:<RT3>sySystem View: return to User View with Ctrl+Z.[RT3]int g0/0/0[RT3-GigabitEthernet0/0/0]ip add 23.1.1.3 255.255.255.0[RT3-GigabitEthernet0/0/0]int lo0[RT3-LoopBack0]ip add 3.3.3.3 255.255.255.2552.2.1 : 配置RT3的静态路由:[RT3]ip route-static 12.1.1.0 255.255.255.0 g0/0/0 23.1.1.2[RT3]ip route-static 1.1.1.1 255.255.255.255 g0/0/0 23.1.1.22.2.2 : 配置RT2的静态路由:[RT2]ip route-static 1.1.1.1 255.255.255.255 g0/0/1 12.1.1.1[RT2]ip route-static 1.1.1.1 255.255.255.255 g0/0/2 10.1.1.1 preference 61[RT2]ip route-static 3.3.3.3 255.255.255.255 g0/0/0 23.1.1.32.2.3 : 配置RT1的静态路由:[RT1]ip route-static 23.1.1.3 255.255.255.0 g0/0/1 12.1.1.2[RT1]ip route-static 23.1.1.3 255.255.255.0 g0/0/2 10.1.1.2 preference 61[RT1]ip route-static 3.3.3.3 255.255.255.255 g0/0/2 10.1.1.2 preference 61[RT1]ip route-static 3.3.3.3 255.255.255.255 g0/0/1 12.1.1.2验证:Pc2能ping通pc1查看路由表RT1:[RT1]dis ip routing-tableRouting Tables: PublicDestinations : 10 Routes : 11Destination/Mask Proto Pre Cost NextHop Interface8.8.8.0/24 Direct 0 0 8.8.8.1 GE0/0/2 8.8.8.1/32 Direct 0 0 127.0.0.1 InLoop0 10.0.12.0/24 Static 20 0 202.112.1.2 GE0/0/0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.0/24 Static 60 0 202.113.1.2 GE0/0/1Static 60 0 202.112.1.2 GE0/0/0 202.112.1.0/24 Direct 0 0 202.112.1.1 GE0/0/0 202.112.1.1/32 Direct 0 0 127.0.0.1 InLoop0 202.113.1.0/24 Direct 0 0 202.113.1.1 GE0/0/1 202.113.1.1/32 Direct 0 0 127.0.0.1 InLoop0RT2:[RT2]dis ip roRouting Tables: PublicDestinations : 10 Routes : 10Destination/Mask Proto Pre Cost NextHop Interface8.8.8.0/24 Static 20 0 202.112.1.1 GE0/0/0 10.0.12.0/24 Direct 0 0 10.0.12.1 GE0/0/1 10.0.12.1/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.0/24 Static 60 0 10.0.12.2 GE0/0/1 202.112.1.0/24 Direct 0 0 202.112.1.2 GE0/0/0 202.112.1.2/32 Direct 0 0 127.0.0.1 InLoop0 202.113.1.0/24 Direct 0 0 202.113.1.2 GE0/0/2 202.113.1.2/32 Direct 0 0 127.0.0.1 InLoop0RT3:[RT3]dis ip rodis ip roRouting Tables: PublicDestinations : 9 Routes : 9Destination/Mask Proto Pre Cost NextHop Interface8.8.8.0/24 Static 60 0 10.0.12.1 GE0/0/0 10.0.12.0/24 Direct 0 0 10.0.12.2 GE0/0/0 10.0.12.2/32 Direct 0 0 127.0.0.1 InLoop0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.1.0/24 Direct 0 0 192.168.1.1 GE0/0/1 192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0 202.112.1.0/24 Static 60 0 10.0.12.1 GE0/0/0 202.113.1.0/24 Static 60 0 10.0.12.1 GE0/0/0四、实验心得及体会通过这次试验, 掌握了静态路由的原理及配置, 还有静态缺省路由和静态浮动路由的原理及配置, 静态路由适用小型网络。
H3C静态路由配置亲测

静态路由配置详解(亲测)配置步骤⑴配置交换机各VLAN虚接口的IP地址#配置Switch A的VLAN虚接口地址。
<SwitchA> system-view[SwitchA] vlan 300[SwitchA-Vlan300] quit[SwitchA]interface vlan 300 (此处重点,本人亲测eNSP试用过的)[SwitchA Vlanif300] ] ip address 1.1.2.3 255.255.255.0 [SwitchA-Vlanif300] quit[SwitchA] vlan 500[SwitchA-Vlan500]quit[SwitchA]interface vlan 500[SwitchA-Vlanif500] ip address 1.1.4.1 255.255.255.252[SwitchA-Vlanif500] quit#配置Switch B的VLAN虚接口地址。
<SwitchB> system-view[SwitchB] vlan 100[SwitchB-Vlan100] quit[SwitchB]interface vlan 100[SwitchB-Vlanif100] ip address 1.1.6.1 255.255.255.0[SwitchB-Vlanif100] quit[SwitchB] vlan 500[SwitchB-Vlan500]quit[SwitchB]interface vlan 500[SwitchB-Vlanif500] ip address 1.1.4.2 255.255.255.252[SwitchB-Vlanif500] quit[SwitchB] vlan 600[SwitchB-Vlan600] quit[SwitchB]interface vlan 600[SwitchB-Vlanif600] ip address 1.1.5.5 255.255.255.252[SwitchB-Vlanife600] quit#配置Switch C的VLAN虚接口地址。
H3C的静态路由、Track与NQA联动配置举例

H3C的静态路由、Track与NQA联动配置举例标签:nqa静态路由track1. 组网需求Device A、Device B、Device C和Device D连接了20.1.1.0/24和30.1.1.0/24两个网段,在设备上配置静态路由以实现两个网段的互通,并配置路由备份以提高网络的可靠性。
Device A作为20.1.1.0/24网段内主机的缺省网关,在Device A上存在两条到达30.1.1.0/24网段的静态路由,下一跳分别为Device B和Device C。
这两条静态路由形成备份,其中:●下一跳为Device B的静态路由优先级高,作为主路由。
该路由可达时,Device A通过Device B将报文转发到30.1.1.0/24网段。
●下一跳为Device C的静态路作为备份路由。
●在Device A上通过静态路由、Track与NQA联动,实时判断主路由是否可达。
当主路由不可达时,备份路由生效,Device A通过Device C将报文转发到30.1.1.0/24网段。
同样地,Device D作为30.1.1.0/24网段内主机的缺省网关,在Device D上存在两条到达20.1.1.0/24网段的静态路由,下一跳分别为Device B和Device C。
这两条静态路由形成备份,其中:●下一跳为Device B的静态路由优先级高,作为主路由。
该路由可达时,Device D通过Device B将报文转发到20.1.1.0/24网段。
●下一跳为Device C的静态路作为备份路由。
●在Device D上通过静态路由、Track与NQA联动,实时判断主路由是否可达。
当主路由不可达时,备份路由生效,Device D通过Device C将报文转发到20.1.1.0/24网段。
2. 组网图图1-2 静态路由、Track与NQA联动配置组网图3. 配置步骤(1)按照图1-2创建VLAN,在VLAN中加入对应的端口,并配置各VLAN接口的IP地址,具体配置过程略。
静态和缺省路由配置

一、实验目的掌握路由表的概念,理解路由表的内容,理解IP路由过程,掌握静态路由和缺省路由的配置。
二、实验原理三、实验过程(1) 选择三台C2811 路由器,分别关闭电源后添加WIC-2T 模块,添加位置53为插槽0/接口适配器0(即4个小插槽中位于右下角的那个插槽)。
添加两台计算机分别连接C2811A 和C2811B 路由器的f0/1 接口,计算机IP地址与网关设置如图11-3所示。
(2) 按实验线路连接图完成各个路由器接口的IP地址设置,其中serial 接口采用默认HDLC封装即可(即不用配置封装),注意DCE接口要配置时钟频率。
测试C2811A 与192.168.10.2之间、C2811A与C2811B之间、C2811A与Internet接入路由器之间相互ping 通,测试C2811B 与192.168.30.2 之间相互ping通。
(3) 完成以上配置之后,192.168.30.2 与192.168.10.2 之间无法ping通,思考无法ping通的原因是什么。
没有配置回程静态路由。
(4)在C2811A上配置到达192.168.30.0/24的静态路由,在C2811A上配置到达Internet的缺省路由。
在C2811B上配置到达192.168.10.0/24 和Internet的缺省路由。
在Internet接入路由器上配置到达192.168.0.0/16 的静态路由。
(5) 在各台路由器上使用show ip route 查看路由表,详细理解路由表的内容。
(6) 192.168.30.2 与192.168.10.2 之间相互ping 通,192.168.30.2 与10.1.1.1 之间相互ping 通。
四、思考并回答以下问题1. 如果不在 Internet 接入路由器上配置到达 192.168.0.0/16 的静态路由,会发生什么情况?静态路由是具有单向性的,仅为数据提供下一跳的方向进行路由,不提供反向路由,会ping不通,下一跳IP地址是静态路由的根本,没有下一跳地址,那么路由就不会到达想要的网域。
路由器配置深入浅出—静态路由和缺省路由配置

路由器配置深⼊浅出—静态路由和缺省路由配置知识域:实验拓扑:关键配置:#静态路由配置命令:ip route命令# r(config)#ip route dest_net_id dest_net_mask next_hop_ip#缺省路由配置命令:⽬的⽹络id和掩码均为0.0.0.0# r(config)#ip route 0.0.0.0 0.0.0.0 next_hop_ip#配置步骤:#1. 配置接⼝:终端接⼝、⽹络设备接⼝#2. 配置路由器路由协议、静态路由、默认路由# c2811a的配置c2811a(config)#interface serial 0/0/1c2811a(config-if)#ip address 10.1.1.2 255.255.255.0c2811a(config-if)#no shutdownc2811a(config-if)#exitc2811a(config)#interface serial 0/0/2c2811a(config-if)#ip address 192.168.20.1 255.255.255.0c2811a(config-if)#no shutdownc2811a(config-if)#exitc2811a(config)#interface fa0/1c2811a(config-if)#ip address 192.168.10.1 255.255.255.0c2811a(config-if)#no shutdownc2811a(config-if)#exitc2811a(config)#ip route 192.168.30.0 255.255.255.0 192.168.20.2 #静态路由c2811a(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1 #缺省路由配置完成后,c2811a路由表为:c 10.1.1.0/24c 192.168.10.1/24c 192.168.20.0/24S 192.168.30.0/24 via 192.168.20.2S* 0.0.0.0/0 via 10.1.1.1c2811b和2811两台路由器的配置类似,这⾥省略,配置完成后:c2811b路由表c 192.168.20.0/24c 192.168.30.0/24S 192.168.10.0/24 via 192.168.20.1S* 0.0.0.0/0 via 192.168.20.12811的路由表:c 10.1.1.0/24S 192.168.10.0/24 10.1.1.2S 192.168.20.0/24 10.1.1.2S 192.168.30.0/24 10.1.1.2。
剪不断理还乱的缺省路由(第二篇)

剪不断理还乱的缺省路由(第二篇)作者:黄明祥▪资料开发部BGP缺省路由BGP发布缺省路由有三种方法:直接用import-route 命令是不能引入缺省路由的,但是如果在BGP视图下加上default-route imported命令就可以加入缺省路由。
该命令只用于引入本地路由表中已经存在的缺省路由。
在bgp视图下用network 0.0.0.0 0 命令就可以配置缺省路由。
此时的origin 属性为igp。
该命令要求本地路由表中必须已经存在一条活跃的缺省路由,否则发布失败。
peer x.x.x.x group default-route-advertise,可以向特定的peer 发布缺省路由,而且它的origin属性为igp。
该命令不要求在路由表中存在缺省路由,而是无条件地向对等体发送一个下一跳为自身的缺省路由。
通过import-route 命令引入缺省路由图1 BGP协议中通过import-route命令引入缺省路由如图1 所示:在RTA上配置一条静态缺省路由ip route-static 0.0.0.0 0.0.0.0 NULL 0。
RTA上的简要配置:#ip route-static 0.0.0.0 0.0.0.0 NULL0##bgp 100router-id 10.1.1.1peer 10.2.2.2 as-number 100peer 10.2.2.2 connect-interface LoopBack0#ipv4-family unicastundo synchronizationdefault-route importedimport-route staticpeer 10.2.2.2 enable#在RTA的BGP视图下配置import-route static,然后查看RTA和RTB的BGP 路由表,RTA上不能发布缺省路由,RTB上也学习不到缺省路由。
在RTA的BGP视图下同时再配置default-route imported,此时RTA的BGP 路由表里产生了缺省路由,同时RTB也学习到了这条缺省路由。
实验七 静态路由及缺省路由实验

实验七静态路由及缺省路由实验【实验目地】掌握路由器命令行各种操作模式的区别,模式之间的切换;掌握路由器端口的常用基本配置,参数;会查看路由器配置信息,了解当前路由器的工作状态;掌握静态路由和默认路由的配置【背景描述】假设校园网分为 2 个区域,每个区域内使用1 台路由器连接1 个子网,现要在路由器上做适当配置,实现校园网内各个区域子网之间的相互通信。
【实验环境】在cisco Packet模拟器中选用1841路由器2台,PC机2台。
【实验步骤】一、建立实验网络建立如图所示的实验网络,要求通过配置静态路由或默认路由,使任意两台计算机或路由器之间都能连通二、配置PC机IP和网关三、在PC1上分别去ping网关地址及PC2的IP地址,看能否ping 通?为什么?Ping不通原因:PC1和PC2的IP地址不是同一网段四、配置路由器1、先配置路由器1(1)命名路由器,设置密码Router>enaRouter#conf tRouter(config)#host R1R1(config)#en se 123R1(config)#line vty 0 4R1(config-line)#loginR1(config-line)#pass 456(2)配置路由器端口R1(config-line)#int f0/0R1(config-if)#ip add 192.168.1.1 255.255.255.0R1(config-if)no shutR1(config-if)int s0/0/0R1(config-if)ip add 10.0.0.1 255.0.0.0R1(config-if)clock rate 64000 (设置同步时钟)R1(config-if)no shutR1(config-if)exit(3)配置静态路由或缺省路由R1(config)ip route 192.168.2.0 255.255.255.0 10.0.0.2(静态路由)或R1(config)ip route 0.0.0.0 0.0.0.0 10.0.0.2 (缺省路由)R1(config)endR1#show ip Int brief (查看端口信息)R1#show ip route(查看路由表信息)2、配置路由器2(略)五、实验报告1、完成路由器2的配置过程Continue with configuration dialog? [yes/no]: noPress RETURN to get started!Router>Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host R2R2(config)#en se 123% Ambiguous command: "en se 123"R2(config)#line vty 0 4R2(config-line)#login% Login disabled on line 66, until 'password' is set% Login disabled on line 67, until 'password' is set% Login disabled on line 68, until 'password' is set% Login disabled on line 69, until 'password' is set% Login disabled on line 70, until 'password' is setR2(config-line)#pass 456R2(config-line)#exitR2(config)#int f0/0R2(config-if)#ip add 192.168.2.1 255.255.255.0R2(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#int s0/0/0R2(config-if)#ip add 10.0.0.2 255.255.255.0R2(config-if)#no shut%LINK-5-CHANGED: Interface Serial0/0/0, changed state to upR2(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to upR2(config-if)#exitR2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1R2(config)#2、将R1、R2的路由表粘贴如下,并查看路由表项是否完整?并做简单分析R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setC 10.0.0.0/8 is directly connected, Serial0/0/0C 192.168.1.0/24 is directly connected, FastEthernet0/0S 192.168.2.0/24 [1/0] via 10.0.0.2R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.0.0.0 is directly connected, Serial0/0/0S 192.168.1.0/24 [1/0] via 10.0.0.1C 192.168.2.0/24 is directly connected, FastEthernet0/0两个路由表是完整的分析:从上面路由表上可以看到目标子网地址、路由表的端口IP、下一跳的IP3、在路由器1上ping 路由器2地址及目标网络网关地址,看能否ping通?为什么?能ping 通原因:路由器1的路由表上有路由器2的地址及目标网络网关地址4、在PC1上ping PC2的IP地址,能否ping 通?为什么?能ping 通原因:路由将两个不同的网络互联六、扩展部分(1)请将R1、R2、R3路由表粘贴如下R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.0.0.0 is directly connected, Serial0/0/0C 192.168.1.0/24 is directly connected, FastEthernet0/0S 192.168.2.0/24 [1/0] via 10.0.0.2S 192.168.3.0/24 [1/0] via 10.0.0.2R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.0.0.0 is directly connected, Serial0/0/011.0.0.0/24 is subnetted, 1 subnetsC 11.1.1.0 is directly connected, Serial0/0/1S 192.168.1.0/24 [1/0] via 10.0.0.1C 192.168.2.0/24 is directly connected, FastEthernet0/0S 192.168.3.0/24 [1/0] via 11.1.1.2R3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set11.0.0.0/24 is subnetted, 1 subnetsC 11.1.1.0 is directly connected, Serial0/0/1S 192.168.1.0/24 [1/0] via 11.1.1.1S 192.168.2.0/24 [1/0] via 11.1.1.1C 192.168.3.0/24 is directly connected, FastEthernet0/0(2)请将测试结果粘贴如下:测试PC1到PC2的连通性、测试PC1到PC3的连通性。
计算机网络实验报告——静态路由与缺省路由的使用

实验三静态路由与缺省路由的使用一、实验环境:Windows7操作系统的计算机;Boson Netsim for CCNA v6.0805交换机二、实验步骤;rt1接到pc1,rt2接到pc2,rt1到rt2选择点到点类型,rt2的serial0作为DCE端。
配置如下:(1)Router1配置:Router>enableRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname router1router1(config)#ena se c1router1(config)#vty 0 4^% Invalid input detected at '^' marker.router1(config)#line vty 0 4router1(config-line)#loginrouter1(config-line)#pass c2router1(config-line)#int eth 0router1(config-if)#ip address 192.168.1.1 255.255.255.0router1(config-if)#no shut%LINK-3-UPDOWN: Interface Ethernet0, changed state to uprouter1(config-if)#int se 0router1(config-if)#ip address 10.0.0.1 255.0.0.0router1(config-if)#clock rate 64000router1(config-if)#no shut%LINK-3-UPDOWN: Interface Serial0, changed state to up%LINK-3-UPDOWN: Interface Serial0, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to downrouter1(config-if)#endrouter1#copy run startDestination filename [startup-config]?Building configuration...[OK](2)Router2配置:Router>enableRouter#config tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host router2router2(config)#ena se c1router2(config)#line vty 0 4router2(config-line)#loginrouter2(config-line)#pass c2router2(config-line)#int eth 0router2(config-if)#ip address 192.168.2.1 255.255.255.0router2(config-if)#no shut%LINK-3-UPDOWN: Interface Ethernet0, changed state to uprouter2(config-if)#int se 0router2(config-if)#ip add 10.0.0.2 255.0.0.0router2(config-if)#no shut%LINK-3-UPDOWN: Interface Serial0, changed state to up%LINK-3-UPDOWN: Interface Serial0, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to downrouter2(config-if)#endrouter2#copy run startDestination filename [startup-config]?Building configuration...[OK](3)PC配置:PC1 192.168.1.2 255.255.255.0 192.168.1.1PC2 192.168.2.2 255.255.255.0 192.168.1.1(4)配置,测试静态路由在Rputer1中配置:router1#ip route 192.168.2.0 255.255.255.0 10.0.0.2^% Invalid input detected at '^' marker.router1# ip router 192.168.2.0 255.255.255.0 10.0.0.2^% Invalid input detected at '^' marker.router1#config tEnter configuration commands, one per line. End with CNTL/Z.router1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2router1(config)#endrouter1#copy run startDestination filename [startup-config]?Building configuration...[OK]router1#router1#show ip rpute^% Invalid input detected at '^' marker.router1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 192.168.1.0 is directly connected, Ethernet0S 192.168.2.0 [1/0] via 10.0.0.2在Router2中配置:router2#router2#router2#config tEnter configuration commands, one per line. End with CNTL/Z.router2(config)#ip route 192.168.1,0 255.255.255.0 10.0.0.1% Invalid input detected at '^' marker.router2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1router2(config)#endrouter2#copy run startDestination filename [startup-config]?Building configuration...[OK]router2#show ip rpute^% Invalid input detected at '^' marker.router2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 192.168.2.0 is directly connected, Ethernet0S 192.168.1.0 [1/0] via 10.0.0.1再分别选择R1,R2测试静态路由,命令如下:router1#show ip rpute^% Invalid input detected at '^' marker.router1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 192.168.1.0 is directly connected, Ethernet0S 192.168.2.0 [1/0] via 10.0.0.2router2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 192.168.2.0 is directly connected, Ethernet0S 192.168.1.0 [1/0] via 10.0.0.1(5) 配置,测试缺省路由:router2#config tEnter configuration commands, one per line. End with CNTL/Z.router2(config)#no ip route 192.168.1.0 255.255.255.0 10.0.0.1router2(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1router2(config)#endrouter2#copy run startDestination filename [startup-config]?Building configuration...[OK]三、最终配置列表:四、结果分析:配置完PC后,先测试一下:在PC1 ping Router1C:>ping 192.168.1.1Pinging 192.168.1.1 with 32 bytes of data:Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Reply from 192.168.1.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55ms在PC2 ping Router2C:>ping 192.168.2.1Pinging 192.168.2.1 with 32 bytes of data:Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Reply from 192.168.2.1: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.1: Packets: Sent = 5, Received = 5, Lost= 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55msC:>:>ping 192.168.2.2Pinging 192.168.2.2 with 32 bytes of data:Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Reply from 192.168.2.2: bytes=32 time=60ms TTL=241Ping statistics for 192.168.2.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55ms配置缺省路由后:C:>ping 172.16.1.1Pinging 172.16.1.1with 32 bytes of data:Reply from 172.16.1.1: bytes=32 time=60ms TTL=241Reply from 172.16.1.1: bytes=32 time=60ms TTL=241Reply from 172.16.1.1: bytes=32 time=60ms TTL=241Reply from 172.16.1.1: bytes=32 time=60ms TTL=241Reply from 172.16.1.1: bytes=32 time=60ms TTL=241Ping statistics for 172.16.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 50ms, Maximum = 60ms, Average = 55ms五、实验拓扑截图:六、心得体会:通过本次实验掌握了静态路由与缺省路由的配置方法,但是对于实验中的许多命令还是不熟练,今后要多加练习。
实训项目十静态路由、缺省路由实训.

实训项目十:静态路由、缺省路由实训一、实训目的:明确静态路由和动态路由的原理,以及它们的区别,学习如何配置静态路由和动态路由,明确缺省路由的作用。
二、实训任务与要求:1、明确什么是静态路由;2、明确什么是动态路由;3、学习如何配置静态路由,在以上知识的基础上了解静态路由和动态路由的区别;4、在配置静态路由时的注意点,以及缺省路由的作用是什么;5、最后学会如何设置缺省路由。
三、实训原理:1、静态路由基本思想是,如果想要路由器知道某个网络,就手工输入这些路径。
静态路由十分容易理解也十分容易配置,至少在一个小型网络中是如此,而且无疑是最简单的路由方法;2、在没有配置任何路由的网络上,所有的路由器一般在它的路由表中只列出与其直接相连的网络地址,其它的地址都没有列出,也就是说路由器根本不知道如何才能到达这些地址,如果在一个小型的网络中,这样的地址方案可以选择静态路由来完成,就是将这些地址通过手工的方式来输入了;3、通过以上的介绍我们应该知道,静态路由中的路由器是被动的,因为它不会主动去寻找新的路由地址,也不会去更新路由表,这些工作必须由管理员来手工完成,所以这在大型的网络中是不现实的,因为大型网络中的路由是每时每刻都变化的,管理员也无法知道具体的路由信息,所以这个时候就要使用动态路由了,这也就是静态路由和动态路由的区别,但静态路由是所有路由中速度最快,耗用带宽最少的一种路由方式,因此它的管理员号是最小的值为0,也就是可靠度最高的,如果它和其他路由并存的话,那么它的优先级最高,再有它的路由路径是手工配置的所以这条路是死得只要管理员不去动它一般是不会变的;4、缺省路由:静态路由的一种用途,当路由选择表中没有明确列出到达目的网络的下一跳时,则选择缺省路由选择表条目所指定的下一跳网络。
四、实训设备:(注:因我们现在用的是模拟环境,有一些不同)●CISCO2600系列的路由器4台(每台2~3个Serial口用于路由器互连,1个FastEthernet口用于连局域网,一个Console口用于与配置的计算机连接,还有一个AUX辅助接口用于连接Modem)。
实训十五、静态路由及默认路由的配置

二、静态路由的配置
1、配置命令格式 Router(config)#ip route ip-address mask {address | interface} ip 2、命令参数含义 此命令需要在路由器的全局配置模式下使用,ip-address是所要到达的 目的网络、mask为子网掩码、address为下一跳的IP地址,即相邻路由器的 (入口)接口地址、interface为本地路由器的(出口)接口。要删除配置只 要在整条语名前面加no命令就可以了。 3、静态路由配置举例
路由表中的静态路由项目的形式如下: S 192.168.1.0/24 [1/0] via 172.16.10.1 路由含义:S是单词Static的首字母表示静态路由,192.168.1.0 为目的 网段,[1/0]分别为管理距离和度,“via”表示经过的意思。本条路由项的意 思是当前路由器遇到送往“192.168.1.0”网络的数据包就从下一跳路由器入 口(即IP地址为“172.16.10.1”)处转发出去。 3、默认路由 默认路由又称缺省路由也是由网管手动配置,它是静态路由的一种特殊 情况,功能是让路由器把所有地址不能识别的数据包通过指定的路由接口 发送出去,让其它路由器进行处理。默认路由的目的地址是 0.0.0.0/0,它 可以和任何地址相匹配。路由表中的默认路由项目的形式如下: S* 0.0.0.0/0 [1/0] via 172.16.10.1 路由含义:S* 表示默认路由,172.16.10.1为下一跳地址。本条路由项的 路由含义:S* 表示默认路由,172.16.10.1为下一跳地址。本条路由项的 意思是当我接收到一个数据包的目的网段不在我的路由表中,我会将该数据 包发送到“172.16.10.1”这个地址,这个地址是下一个路由器的入口接口,这 包发送到“172.16.10.1”这个地址,这个地址是下一个路由器的入口接口,这 样这个数据包就交付给下一个路由器处理。
缺省、静态路由

缺省、静态路由静态路由和缺省路由的配置本部分包括以下内容:配置静态路由配置默认路由配置缺省⽹络配置可被动态路由覆盖的静态路由静态路由是⼿⼯配置的路由项⽬,在路由表中标志为“S”。
缺省路由主要⽤于简化路由表,它在路由表中带有“*”标志。
路由表可以⽤ show ip route 命令查看。
配置静态路由静态是⼿⼯添加的路由项⽬。
模式:全局配置模式。
1、配置静态路由:Ruijie(config)#ip route network-number network-mask ip-address参数:network-number 是⽬的地址,⼀般是⼀个⽹络地址。
network-mask 是⽬的地址的⼦⽹掩码。
ip-address 是下⼀跳地址。
说明:ip route命令定义的是⼀条传输路径,可以告知设备把某个地址的数据报送往何处。
配置完成后可以使⽤ show ip route 命令查看路由表。
2、删除静态路由:Ruijie(config)#no ip route network-number network-mask配置举例1:Ruijie>enableRuijie#configure terminalRuijie(config)#ip route 172.16.0.0 255.255.0.0 192.168.3.2ip route 172.16.0.0 255.255.0.0 192.168.3.2 命令表⽰把所有⽬的地址在172.16.0.0/16⽹络中的数据报发往地址 192.168.3.2处。
配置举例2:Ruijie>enableRuijie#configure terminalRuijie(config)#no ip route 172.16.0.0 255.255.0.0本例删除了路由表中⽬的地址为172.16.0.0/16⽹络的静态路由。
配置默认路由默认路由⼜称为缺省静态路由,是静态路由的特例,它表⽰把所有本机不能处理的数据报发往指定的设备。
静态路由表配置详细实例

静态路由表配置实例当一个局域网内存在2台以上的路由器时,由于其下主机互访的需求,往往需要设置路由。
由于网络规模较小且不经常变动,所以静态路由是最合适的选择。
随着宽带接入的普及,很多家庭和小企业都组建了局域网来共享宽带接入。
而且随着局域网规模的扩大,很多地方都涉及到2台或以上路由器的应用。
当一个局域网内存在2台以上的路由器时,由于其下主机互访的需求,往往需要设置路由。
由于网络规模较小且不经常变动,所以静态路由是最合适的选择。
本文作为一篇初级入门类文章,会以几个简单实例讲解静态路由,并在最后讲解一点关于路由汇总(归纳)的知识。
由于这类家庭和小型办公局域网所采用的一般都是中低档宽带路由器,所以这篇文章就以最简单的宽带路由器为例。
(其实无论在什么档次的路由器上,除了配置方式和命令不同,其配置静态路由的原理是不会有差别的。
)常见的1WAN口、4LAN口宽带路由器可以看作是一个最简单的双以太口路由器+一个4口小交换机,其W AN 口接外网,LAN口接内网以做区分。
路由就是把信息从源传输到目的地的行为。
形象一点来说,信息包好比是一个要去某地点的人,路由就是这个人选择路径的过程。
而路由表就像一张地图,标记着各种路线,信息包就依靠路由表中的路线指引来到达目的地,路由条目就好像是路标。
在大多数宽带路由器中,未配置静态路由的情况下,内部就存在一条默认路由,这条路由将LAN口下所有目的地不在自己局域网之内的信息包转发到WAN口的网关去。
宽带路由器只需要进行简单的WAN 口参数的配置,内网的主机就能访问外网,就是这条路由在起作用。
本文将分两个部分,第一部分讲解静态路由的设置应用,第二部分讲解关于路由归纳的方法和作用。
下面就以地瓜这个网络初学者遇到的几个典型应用为例,让高手大虾来说明一下什么情况需要设置静态路由,静态路由条目的组成,以及静态路由的具体作用。
例一:最简单的串连式双路由器型环境这种情况多出现于中小企业在原有的路由器共享Internet的网络中,由于扩展的需要,再接入一台路由器以连接另一个新加入的网段。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Router 0
Router>
Router>
Router>
Router>en
Router#confi
Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int
Router(config)#interface f
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip add
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#
Router(config-if)#
Router(config-if)#
Router(config-if)#exit
Router(config)#int
Router(config)#interface s
Router(config)#interface serial 0/0/0
Router(config-if)#cl
Router(config-if)#clock ra
Router(config-if)#clock rate 64000
Router(config-if)#ip add
Router(config-if)#ip address 192.168.2.1
% Incomplete command.
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#exit
Router(config)#ip route
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2
Router(config)#
Router 1
Router>
Router>
Router>en
Router#conf
Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int
Router(config)#interface s
Router(config)#interface serial 0/0/0
Router(config-if)#ip add
Router(config-if)#ip address 192.168.2.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
Router(config-if)#exit
Router(config)#int
Router(config)#interface s
Router(config)#interface serial 0/0/1
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
Router(config-if)#cl
Router(config-if)#clock ra
Router(config-if)#clock rate 64000
Router(config-if)#ip add
Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down Router(config-if)#
Router(config-if)#exit
Router(config)#ip rout
Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1 Router(config)#ip rou
Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.2 Router(config)#
Router 2
Router>
Router>
Router>en
Router#conf
Router#configure
Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int
Router(config)#interface s
Router(config)#interface serial 0/0/0
Router(config-if)#ip add
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
Router(config-if)#exit
Router(config)#int
Router(config)#interface f
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip add
Router(config-if)#ip address 192.168.4.1 255.255.255.0
Router(config-if)#exit
Router(config)#ip rout
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1
Router(config)#。