{"id":2530,"date":"2021-10-14T16:02:53","date_gmt":"2021-10-14T23:02:53","guid":{"rendered":"https:\/\/www.xh86.me\/?p=2530"},"modified":"2021-10-14T16:02:53","modified_gmt":"2021-10-14T23:02:53","slug":"%e6%80%9d%e7%a7%91%e8%b7%af%e7%94%b1%e5%99%a8%e9%85%8d%e7%bd%ae%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=2530","title":{"rendered":"\u601d\u79d1\u8def\u7531\u5668\u914d\u7f6e\u7b14\u8bb0"},"content":{"rendered":"<p>\u8def\u7531\u5668,\u5176\u6700\u91cd\u8981\u7684\u529f\u80fd\u5c31\u662f\u8def\u7531,\u8def\u7531\u662f\u6307\u8def\u7531\u5668\u63a5\u6536\u5230\u6570\u636e\u65f6\u9009\u62e9\u6700\u4f73\u8def\u5f84\u5c06\u6570\u636e\u7a7f\u8fc7\u7f51\u7edc\u4f20\u8f93\u5230\u76ee\u6807\u5730\u5740\u7684\u884c\u4e3a,\u6bcf\u4e2a\u8def\u7531\u5668\u8d1f\u8d23\u81ea\u5df1\u7684\u672c\u5730\u6570\u636e\u7684\u8def\u7531\u6216\u8f6c\u53d1,\u901a\u8fc7\u591a\u4e2a\u8def\u7531\u5668\u4f9d\u6b21\u63a5\u529b\u5c06\u6570\u636e\u6700\u7ec8\u4f20\u9012\u5230\u76ee\u6807\u4e3b\u673a,\u8def\u7531\u7684\u5de5\u4f5c\u6d41\u7a0b\u5305\u62ec\u8def\u7531\u9009\u62e9\u548c\u8def\u7531\u8f6c\u53d1\u4e24\u4e2a\u65b9\u9762.<\/p>\n<h3>\u8def\u7531\u57fa\u672c\u914d\u7f6e<\/h3>\n<p>\u8def\u7531\u5668\u4e0e\u4ea4\u6362\u673a\u4e0d\u540c,\u4ea4\u6362\u673a\u4e0d\u9700\u8981\u914d\u7f6e\u4e5f\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c,\u4f46\u662f\u8def\u7531\u5668\u5fc5\u987b\u7ecf\u8fc7\u914d\u7f6e\u540e\u624d\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528,\u8def\u7531\u5668\u7684\u767b\u9646\u65b9\u5f0f\u57fa\u672c\u548c\u4ea4\u6362\u673a\u4fdd\u6301\u4e00\u81f4,\u4e0b\u9762\u5c06\u7528\u4e00\u4e2a\u5b9e\u4f8b\u5b9e\u73b0\u8def\u7531\u5668\u7684\u57fa\u672c\u914d\u7f6e,\u5305\u62ec\u914d\u7f6e\u8def\u7531\u5668\u7684\u4e3b\u673a\u540d\u79f0,\u5bc6\u7801,\u63a7\u5236\u53f0\u7aef\u53e3,WAN\u63a5\u53e3\u548cLAN\u63a5\u53e3\u7b49,\u6765\u5b9e\u73b0\u4e00\u4e2a\u57fa\u672c\u7684\u8def\u7531\u7ed3\u6784.<\/p>\n<p>\u9996\u5148\u6211\u4eec\u51c6\u5907\u4e24\u53f0\u8def\u7531\u5668(1841\u578b\u53f7),\u9700\u8981\u6ce8\u610f\u7684\u662f\u8bbe\u5907\u4e4b\u95f4\u7684\u8fde\u63a5\u6240\u9009\u7528\u7684\u7ebf\u8def\u7c7b\u578b,\u4e00\u822c\u60c5\u51b5\u4e0b\u8def\u7531\u5668\u548cPC\u4e4b\u95f4\u4f7f\u7528\u4ea4\u53c9\u7ebf,\u4e24\u53f0\u8def\u7531\u5668\u76f8\u8fde\u63a5\u4f7f\u7528\u4e32\u884c\u7ebf,\u914d\u7f6e\u6210\u4ee5\u4e0b\u62d3\u6251\u7ed3\u6784\u5373\u53ef:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"899\" height=\"333\" class=\"wp-image-2531\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-6.jpeg\" alt=\"Diagram\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-6.jpeg 899w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-6-300x111.jpeg 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-6-768x284.jpeg 768w\" sizes=\"auto, (max-width: 899px) 100vw, 899px\" \/><\/p>\n<p>\u4f46\u5728\u5b9e\u9645\u8fde\u63a5\u4e24\u4e2a\u8def\u7531\u5668\u65f6,\u53d1\u73b0\u6ca1\u6709Serial\u63a5\u53e3,\u8fd9\u662f\u56e0\u4e3a\u8be5\u578b\u53f7\u7684\u8def\u7531\u5668\u9ed8\u8ba4\u6ca1\u6709\u63d0\u4f9b\u4e32\u53e3,\u6211\u4eec\u53ef\u4ee5\u5728\u601d\u79d1\u6a21\u62df\u5668\u4e0a\u9009\u62e9WIC-2T\u6a21\u5757,\u5e76\u5c06\u5176\u62d6\u5165\u7a7a\u7684\u63d2\u69fd\u5904,\u91cd\u542f\u4ea4\u6362\u673a\u5373\u53ef\u5b8c\u6210\u914d\u7f6e.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"337\" class=\"wp-image-2532\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/graphical-user-interface-application-word-descr.jpeg\" alt=\"Graphical user interface, application, Word\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/graphical-user-interface-application-word-descr.jpeg 866w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/graphical-user-interface-application-word-descr-300x117.jpeg 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/graphical-user-interface-application-word-descr-768x299.jpeg 768w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/p>\n<p>\u63a5\u7740\u6765\u770b\u4e00\u4e0b\u7f51\u7edc\u62d3\u6251\u7ed3\u6784\u4e2d,\u6bcf\u4e2a\u8bbe\u5907\u7684\u5177\u4f53\u914d\u7f6e\u53c2\u6570,\u5305\u62ec\u7c7b\u578b,IP\u5730\u5740,\u9ed8\u8ba4\u7f51\u5173\u7b49\u4fe1\u606f.<\/p>\n<p>[\u8bbe\u5907\u540d\u79f0] [\u8bbe\u5907\u63a5\u53e3] [IP\u5730\u5740] [\u9ed8\u8ba4\u7f51\u5173]<\/p>\n<p>PC1 &#8212; 192.168.1.2\/24 192.168.1.1<\/p>\n<p>PC2 &#8212; 192.168.2.2\/24 192.168.2.1<\/p>\n<p>Router0 Fa0\/0 192.168.1.1\/24 &#8212;<\/p>\n<p>Serial0\/0\/0 10.10.10.10\/24 &#8212;<\/p>\n<p>Router1 Fa0\/0 192.168.2.1\/24 &#8212;<\/p>\n<p>Serial0\/0\/0 10.10.10.20\/24 &#8212;<\/p>\n<p><strong>\u5f00\u542f\u8def\u7531\u8fdc\u7a0b\u767b\u9646:<\/strong>\u00a0\u8fd9\u91cc\u6211\u4eec\u5c06\u542f\u7528Router1\u8def\u7531\u5668\u7684\u8fdc\u7a0b\u767b\u9646\u529f\u80fd,\u5e76\u8bbe\u7f6e\u4e00\u4e2a\u767b\u9646\u5bc6\u7801\u4e3alyshark.<\/p>\n<p>Router# enable<\/p>\n<p>Router# configure terminal<\/p>\n<p>Router(config)# hostname Router0 \/\/ \u914d\u7f6e\u4e3b\u673a\u540d\u4e3aRouter0<\/p>\n<p>Router0(config)# enable secret lyshark \/\/ \u914d\u7f6e\u7279\u6743\u6a21\u5f0f\u5bc6\u7801\u4e3alyshark<\/p>\n<p>Router0(config)# line console 0 \/\/ \u542f\u7528\u63a7\u5236\u53f0<\/p>\n<p>Router0(config-line)# password lyshark \/\/ \u8bbe\u7f6e\u63a7\u5236\u53f0\u767b\u5f55\u5bc6\u7801<\/p>\n<p>Router0(config-line)# login \/\/ \u5141\u8bb8\u7528\u6237\u767b\u5f55<\/p>\n<p>Router0(config-line)# exit<\/p>\n<p>Router0(config)# line vty 0 2 \/\/ \u914d\u7f6e\u5e8f\u53f7\u4e3a0-2\u76843\u4e2a\u865a\u62df\u767b\u9646\u7ec8\u7aef<\/p>\n<p>Router0(config-line)# password lyshark \/\/ \u914d\u7f6e\u7ec8\u7aef\u767b\u5f55\u5bc6\u7801<\/p>\n<p>Router0(config-line)# login \/\/ \u542f\u7528\u767b\u9646\u7ec8\u7aef<\/p>\n<p><strong>\u914d\u7f6eWAN\u63a5\u53e3:<\/strong>\u00a0\u8def\u7531\u5668\u901a\u8fc7WAN\u63a5\u53e3\u63a5\u5165\u5230\u4e92\u8054\u7f51\u4e0a,\u800c\u5e38\u89c1\u7684WAN\u63a5\u53e3\u90fd\u662f\u4e32\u884c\u63a5\u53e3\u7528Serial\u8868\u793a,\u9996\u5148\u53ef\u4ee5\u4f7f\u7528show controller \u547d\u4ee4\u5224\u65adSerial 0\/0\/0\u662f\u5426\u4e3aDCE\u7aef,\u7136\u540e\u51b3\u5b9a\u662f\u5426\u8981\u914d\u7f6e.<\/p>\n<p>Router0&gt; show controller Serial0\/0\/0<\/p>\n<p>Interface Serial0\/0\/0<\/p>\n<p>Hardware is PowerQUICC MPC860<\/p>\n<p>DCE V.35, clock rate 2000000 \/\/ \u6b64\u5904\u5224\u65ad\u662fDEC\u7aef<\/p>\n<p>\u6839\u636e\u4e0a\u8ff0\u6807\u6ce8\u663e\u793a\u5185\u5bb9Srial0\/0\/0\u4e3aDCE\u7aef\u53e3,\u4e0b\u9762\u9700\u8981\u5bf9\u4e24\u53f0\u8def\u7531\u5206\u522b\u914d\u7f6e\u65f6\u949f\u9891\u7387.<\/p>\n<p>#&#8212;-\u5728Router0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0&gt; enable<\/p>\n<p>Router0# configure terminal<\/p>\n<p>Router0(config)# interface Serial0\/0\/0 \/\/ \u9009\u62e9\u4e32\u884c\u63a5\u53e3Srial0\/0\/0<\/p>\n<p>Router0(config-if)# ip address 10.10.10.10 255.255.255.0 \/\/ \u914d\u7f6e\u5916\u7f51IP\u5730\u5740<\/p>\n<p>Router0(config-if)# clock rate 64000 \/\/ \u914d\u7f6e\u59cb\u7ec8\u9891\u7387\u4e3a6400<\/p>\n<p>Router0(config-if)# no shutdown \/\/ \u5f00\u542f\u7aef\u53e3<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1&gt; enable<\/p>\n<p>Router1# configure terminal<\/p>\n<p>Router1(config)# interface Serial0\/0\/0<\/p>\n<p>Router1(config-if)# ip address 10.10.10.20 255.255.255.0<\/p>\n<p>Router1(config-if)# clock rate 64000<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p><strong>\u914d\u7f6eLAN\u63a5\u53e3:<\/strong>\u00a0LAN\u63a5\u53e3\u7528\u6765\u6307\u5b9a\u5185\u7f51\u901a\u8baf\u7684\u5730\u5740,\u63a5\u4e0b\u6765\u5206\u522b\u5bf9\u4e24\u53f0\u8def\u7531\u5668\u505a\u914d\u7f6e.<\/p>\n<p>#&#8212;-\u5728Router0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0&gt; enable<\/p>\n<p>Router0# configure terminal<\/p>\n<p>Router0(config)# interface fa0\/0 \/\/ \u9009\u62e9\u4ee5\u592a\u7f51\u63a5\u53e3fa0\/0<\/p>\n<p>Router0(config)# ip address 192.168.1.1 255.255.255.0<\/p>\n<p>Router0(config)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1&gt; enable<\/p>\n<p>Router1# configure terminal<\/p>\n<p>Router1(config)# interface fa0\/0<\/p>\n<p>Router1(config)# ip address 192.168.2.1 255.255.255.0<\/p>\n<p>Router1(config)# no shutdown<\/p>\n<p><strong>\u67e5\u914d\u7f6e\u4fe1\u606f:<\/strong>\u00a0\u6700\u540e\u53ef\u4ee5\u4f7f\u7528show ip route\u547d\u4ee4,\u67e5\u770b\u8def\u7531\u5668\u7684\u8def\u7531\u4fe1\u606f,\u786e\u5b9a\u7f51\u7edc\u662f\u5426\u6b63\u786e\u8fde\u63a5.<\/p>\n<p>Router0# show ip route<\/p>\n<p>Codes: C &#8211; connected, S &#8211; static, I &#8211; IGRP, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<\/p>\n<p>D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<\/p>\n<p>N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<\/p>\n<p>E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2, E &#8211; EGP<\/p>\n<p>i &#8211; IS-IS, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2, ia &#8211; IS-IS inter area<\/p>\n<p>* &#8211; candidate default, U &#8211; per-user static route, o &#8211; ODR<\/p>\n<p>P &#8211; periodic downloaded static route<\/p>\n<p>Gateway of last resort is not set<\/p>\n<p>10.0.0.0\/24 is subnetted, 1 subnets<\/p>\n<p>C 10.10.10.0 is directly connected, Serial0\/0\/0 \/\/ \u5916\u7f51\u5730\u5740<\/p>\n<p>C 192.168.1.0\/24 is directly connected, FastEthernet0\/0 \/\/ \u5185\u7f51\u5730\u5740<\/p>\n<p><strong>\u67e5\u63a5\u53e3\u4fe1\u606f:<\/strong>\u00a0\u4e5f\u53ef\u4ee5\u4f7f\u7528show ip interface brief\u547d\u4ee4,\u67e5\u770b\u8def\u7531\u5668\u7684\u63a5\u53e3\u4fe1\u606f.<\/p>\n<p>Router0# show ip interface brief<\/p>\n<p>Interface IP-Address OK? Method Status Protocol<\/p>\n<p>FastEthernet0\/0 192.168.1.1 YES manual up up<\/p>\n<p>Serial0\/0\/0 10.10.10.10 YES manual up up<\/p>\n<p>Serial0\/0\/1 unassigned YES unset administratively down down<\/p>\n<p>Vlan1 unassigned YES unset administratively down down<\/p>\n<p><strong>\u6700\u540e\u6d4b\u8bd5\u901a\u4fe1:<\/strong>\u00a0\u5728\u8def\u7531\u5668Route0\u4e0a\u53ef\u4ee5ping\u901aRoute1,\u6bcf\u4e2a\u4e3b\u673a\u4e5f\u53ef\u4ee5ping\u901a\u81ea\u5df1\u7f51\u6bb5\u7684\u8def\u7531\u5668.<\/p>\n<p>Router0# ping 10.10.10.20<\/p>\n<p>Type escape sequence to abort.<\/p>\n<p>Sending 5, 100-byte ICMP Echos to 10.10.10.20, timeout is 2 seconds:<\/p>\n<p>!!!!!<\/p>\n<p>Success rate is 100 percent (5\/5), round-trip min\/avg\/max = 1\/2\/6 ms<\/p>\n<p>\u4e0a\u8ff0\u5c0f\u5b9e\u9a8c\u5230\u8fd9\u91cc\u5c31\u7b97\u914d\u7f6e\u6210\u529f\u4e86,\u4f46\u662f\u8fd9\u91cc\u7559\u4e0b\u4e86\u4e00\u4e2a\u7591\u95ee,\u90a3\u5c31\u662fPC0PingPC1\u65e0\u6cd5\u901a\u4fe1,\u8fd9\u5c31\u6d89\u53ca\u5230\u8def\u7531\u5668\u6ca1\u6709\u76f8\u5e94\u7684\u8def\u7531\u6761\u76ee\u7684\u95ee\u9898,\u8fd9\u4e9b\u95ee\u9898\u5c06\u5728\u540e\u9762\u5c0f\u5b9e\u9a8c\u4e2d\u505a\u89e3\u91ca.<\/p>\n<h3>\u914d\u7f6e\u9759\u6001\u8def\u7531<\/h3>\n<p>\u9759\u6001\u8def\u7531\u9700\u8981\u7ba1\u7406\u5458\u6839\u636e\u5b9e\u9645\u9700\u6c42\u4e00\u6761\u6761\u81ea\u5df1\u624b\u52a8\u914d\u7f6e,\u8def\u7531\u5668\u4e0d\u4f1a\u81ea\u52a8\u751f\u6210\u6240\u9700\u7684\u9759\u6001\u8def\u7531,\u9759\u6001\u8def\u7531\u4e2d\u5305\u62ec\u76ee\u6807\u8282\u70b9\u6216\u76ee\u6807\u7f51\u7edc\u7684IP\u5730\u5740,\u8fd8\u53ef\u4ee5\u5305\u62ec\u4e0b\u4e00\u8df3IP\u5730\u5740,\u4ee5\u53ca\u5728\u672c\u8def\u7531\u5668\u4e0a\u4f7f\u7528\u8be5\u9759\u6001\u8def\u7531\u65f6\u7684\u6570\u636e\u5305\u51fa\u63a5\u53e3\u7b49,\u4f46\u662f\u624b\u52a8\u914d\u7f6e\u9759\u6001\u8def\u7531\u9700\u8981\u7ba1\u7406\u5458\u975e\u5e38\u4e86\u89e3\u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784\u624d\u80fd\u591f\u5b8c\u6210\u914d\u7f6e,\u5728\u7f51\u7edc\u89c4\u6a21\u8f83\u5927\u65f6\u8fd8\u9700\u8981\u8017\u8d39\u5927\u91cf\u7684\u7ecf\u5386\u548c\u65f6\u95f4\u53bb\u7ef4\u62a4,\u6240\u4ee5\u5e76\u4e0d\u662f\u6240\u6709\u7684\u7f51\u7edc\u90fd\u9002\u5408\u914d\u7f6e\u9759\u6001\u8def\u7531.<\/p>\n<p>\u4e00\u822c\u60c5\u51b5\u4e0b\u4ee5\u4e0b\u51e0\u79cd\u60c5\u51b5\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u9759\u6001\u8def\u7531<\/p>\n<p>1.\u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784\u76f8\u5bf9\u8f83\u7b80\u5355,\u6bd4\u5982\u5c31\u4e00\u53f0\u8def\u7531\u5668\u548c\u4ea4\u6362\u673a\u7684\u60c5\u51b5,\u53ef\u4f7f\u7528\u9759\u6001\u8def\u7531.<br \/>\n2.\u7f51\u7edc\u4fdd\u5bc6\u6027\u8981\u6c42\u8f83\u9ad8,\u7f51\u7edc\u7ba1\u7406\u5458\u9700\u8981\u63a7\u5236\u94fe\u8def\u6216\u8005\u63a7\u5236\u8def\u7531\u8868,\u5219\u53ef\u4f7f\u7528\u9759\u6001\u8def\u7531.<br \/>\n3.\u7f51\u7edc\u4ec5\u901a\u8fc7\u5355\u4e2aISP\u63a5\u5165Internet,\u5219\u8be5ISP\u5c31\u662f\u7f51\u7edc\u552f\u4e00\u7684\u51fa\u53e3,\u6240\u4ee5\u4e0d\u9700\u8981\u914d\u7f6e\u9759\u6001\u8def\u7531.<br \/>\n4.\u8def\u7531\u8d44\u6e90\u6709\u9650,\u65e0\u6cd5\u8fd0\u884c\u8def\u7531\u9009\u62e9\u534f\u8bae,\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b,\u9700\u8981\u624b\u52a8\u914d\u7f6e\u8def\u7531\u6761\u76ee\u6765\u66f4\u65b0\u8def\u7531\u8868\u6570\u636e.<\/p>\n<p>\u63a5\u4e0b\u6765\u4ee5\u4e00\u4e2a\u5b9e\u4f8b\u5177\u4f53\u4ecb\u7ecd\u9759\u6001\u8def\u7531\u7684\u914d\u7f6e\u6d41\u7a0b,\u5728\u601d\u79d1\u6a21\u62df\u5668\u4e2d\u9009\u62e92\u53f01841\u8def\u7531\u5668,\u6309\u7167\u4ee5\u4e0b\u7f51\u7edc\u62d3\u6251\u7ed3\u6784\u6784\u5efa\u7f51\u8def,\u7136\u540e\u4e3a\u6bcf\u53f0\u8def\u7531\u5668\u914d\u7f6e\u9759\u6001\u8def\u7531,\u5b9e\u73b0\u4e0d\u540c\u7f51\u7edc\u95f4\u7684\u6570\u636e\u4e92\u901a.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"999\" height=\"468\" class=\"wp-image-2533\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-7.jpeg\" alt=\"Diagram\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-7.jpeg 999w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-7-300x141.jpeg 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-7-768x360.jpeg 768w\" sizes=\"auto, (max-width: 999px) 100vw, 999px\" \/><\/p>\n<p><strong>\u914d\u7f6e\u5ba2\u6237\u4e3b\u673a:<\/strong>\u00a0\u9996\u5148\u6211\u4eec\u6839\u636e\u4e0a\u56fe\u7684\u914d\u7f6e\u8981\u6c42\u914d\u7f6e\u597dIP\u5730\u5740\u7f51\u5173\u7b49\u6570\u636e,\u4e0b\u9762\u7684\u53c2\u6570\u662f\u5177\u4f53\u7684\u5730\u5740\u89c4\u5212.<\/p>\n<p>[\u8bbe\u5907\u540d\u79f0] [\u8bbe\u5907\u63a5\u53e3] [IP\u5730\u5740] [\u9ed8\u8ba4\u7f51\u5173]<\/p>\n<p>PC0 &#8212; 192.168.1.2\/24 192.168.1.1<\/p>\n<p>PC1 &#8212; 192.168.1.3\/24 192.168.1.1<\/p>\n<p>PC2 &#8212; 192.168.2.2\/24 192.168.2.1<\/p>\n<p>PC3 &#8212; 192.168.2.3\/24 192.168.2.1<\/p>\n<p>Router0 Fa0\/0 192.168.1.1\/24 &#8212;<\/p>\n<p>Serial0\/0\/0 10.10.10.10\/24 &#8212;<\/p>\n<p>Router1 Fa0\/0 192.168.2.1\/24 &#8212;<\/p>\n<p>Serial0\/0\/0 10.10.10.20\/24 &#8212;<\/p>\n<p><strong>\u914d\u7f6e\u8def\u7531\u5668:<\/strong>\u00a0\u63a5\u7740\u6211\u4eec\u5206\u522b\u7ed9\u8def\u7531\u5668\u914d\u7f6e\u597d\u5730\u5740\u53c2\u6570,\u5728\u8fd9\u91ccfa0\/0\u7aef\u53e3\u662f\u5185\u7f51IP\u5730\u5740,serial0\/0\/0\u7aef\u53e3\u5219\u662f\u5916\u7f51IP\u5730\u5740,\u914d\u7f6e\u662f\u5e94\u6ce8\u610f\u6b21\u5e8f,\u5982\u679c\u914d\u53cd\u4e86\u5219\u770b\u4e0d\u5230\u6548\u679c.<\/p>\n<p>#&#8212;-\u5728Router0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0&gt; enable<\/p>\n<p>Router0# configure terminal<\/p>\n<p>Router0(config)# interface fa0\/0 \/\/ \u914d\u7f6e\u5185\u7f51\u5730\u5740<\/p>\n<p>Router0(config-if)# ip address 192.168.1.1 255.255.255.0<\/p>\n<p>Router0(config-if)# no shutdown<\/p>\n<p>Router0(config)# interface serial0\/0\/0 \/\/ \u914d\u7f6e\u5916\u7f51\u5730\u5740<\/p>\n<p>Router0(config-if)# clock rate 64000<\/p>\n<p>Router0(config-if)# ip address 10.10.10.10 255.255.255.0<\/p>\n<p>Router0(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0&gt; enable<\/p>\n<p>Router0# configure terminal<\/p>\n<p>Router1(config)# interface fa0\/0 \/\/ \u914d\u7f6e\u5185\u7f51\u5730\u5740<\/p>\n<p>Router1(config-if)# ip address 192.168.2.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router1(config)# interface serial0\/0\/0 \/\/ \u914d\u7f6e\u5916\u7f51\u5730\u5740<\/p>\n<p>Router1(config-if)# clock rate 64000<\/p>\n<p>Router1(config-if)# ip address 10.10.10.20 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p><strong>\u68c0\u6d4b\u8def\u7531\u914d\u7f6e:<\/strong>\u00a0\u5f53\u914d\u7f6e\u597d\u4e0a\u9762\u7684\u6b65\u9aa4\u4ee5\u540e,PC0\u4e0ePC1\u4e3b\u673a\u662f\u53ef\u901a\u4fe1\u7684,Route0\u4e0eRoute1\u4e5f\u53ef\u901a\u4fe1,\u4f46PC0\u65e0\u6cd5\u4e0ePC3\u901a\u4fe1,\u539f\u56e0\u5c31\u662f\u56e0\u4e3a\u8def\u7531\u5668\u6ca1\u6709\u914d\u7f6e\u9759\u6001\u8def\u7531\u7684\u5173\u7cfb,\u8fd9\u4e00\u6b65\u6211\u4eec\u53ea\u9700\u8981\u786e\u4fdd\u540c\u4e00\u4e2a\u7f51\u6bb5\u5185\u80fd\u901a\u4fe1\u5373\u53ef.<\/p>\n<p>#&#8212;-\u5728PC0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>PC0&gt; ping 192.168.1.1<\/p>\n<p>PC0&gt; ping 192.168.1.2<\/p>\n<p>PC0&gt; ping 192.168.1.3<\/p>\n<p>Pinging 192.168.1.3 with 32 bytes of data:<\/p>\n<p>Reply from 192.168.1.3: bytes=32 time=0ms TTL=128<\/p>\n<p>#&#8212;-\u5728Route0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0#ping 10.10.10.20<\/p>\n<p>Type escape sequence to abort.<\/p>\n<p>Sending 5, 100-byte ICMP Echos to 10.10.10.20, timeout is 2 seconds:<\/p>\n<p>!!!!!<\/p>\n<p>Success rate is 100 percent (5\/5), round-trip min\/avg\/max = 1\/7\/12 ms<\/p>\n<p><strong>\u914d\u7f6e\u9759\u6001\u8def\u7531:<\/strong>\u00a0\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u5728\u4e24\u53f0\u8def\u7531\u5668\u4e0a\u5206\u522b\u914d\u7f6e\u8def\u7531\u6761\u76ee,\u4f7f\u7528ip route\u547d\u4ee4\u914d\u7f6e,\u5982\u679c\u60f3\u8981\u5220\u9664\u8def\u7531\u53ef\u4f7f\u7528no ip route\u547d\u4ee4\u5373\u53ef\u5220\u9664\u6307\u5b9a\u8def\u7531\u6761\u76ee.<\/p>\n<p>#&#8212;-\u5728Router0\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0&gt; enable<\/p>\n<p>Router0# configure terminal<\/p>\n<p>[\u76ee\u7684\u7f51\u7edc] [\u76ee\u7684\u63a9\u7801] [\u4e0b\u4e00\u8df3\u5730\u5740]<\/p>\n<p>Router0(config)# ip route 192.168.2.0 255.255.255.0 10.10.10.20<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1&gt; enable<\/p>\n<p>Router1# configure terminal<\/p>\n<p>Router1(config)# ip route 192.168.1.0 255.255.255.0 10.10.10.10 \/\/ \u6307\u5b9a\u8fd4\u56de\u65f6\u7684\u8def\u7531<\/p>\n<p>#&#8212;-\u68c0\u67e5\u914d\u7f6e\u53c2\u6570\u60c5\u51b5&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0# show ip interface brief \/\/ \u663e\u793a\u7aef\u53e3ip<\/p>\n<p>Router0# show ip route \/\/ \u68c0\u67e5\u8def\u7531\u53c2\u6570<\/p>\n<p>Codes: C &#8211; connected, S &#8211; static, I &#8211; IGRP, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<\/p>\n<p>D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<\/p>\n<p>N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<\/p>\n<p>E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2, E &#8211; EGP<\/p>\n<p>i &#8211; IS-IS, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2, ia &#8211; IS-IS inter area<\/p>\n<p>* &#8211; candidate default, U &#8211; per-user static route, o &#8211; ODR<\/p>\n<p>P &#8211; periodic downloaded static route<\/p>\n<p>Gateway of last resort is not set<\/p>\n<p>10.0.0.0\/24 is subnetted, 1 subnets<\/p>\n<p>C 10.10.10.0 is directly connected, Serial0\/0\/0<\/p>\n<p>C 192.168.1.0\/24 is directly connected,FastEthernet0\/0<\/p>\n<p>S 192.168.2.0\/24 [1\/0] via 10.10.10.20<\/p>\n<p><strong>\u6700\u540e\u7684\u6d4b\u8bd5:<\/strong>\u00a0\u5f53\u914d\u7f6e\u597d\u8def\u7531\u6761\u76ee\u4ee5\u540e,\u6211\u4eec\u5728PC0\u4e3b\u673a\u4e0aPing\u68c0\u6d4bPC3\u7684\u8fde\u901a\u6027,\u4f1a\u53d1\u73b0\u539f\u6765\u65e0\u6cd5\u8fde\u901a\u7684\u4e24\u4e2a\u7f51\u6bb5,\u73b0\u5728\u53ef\u4ee5\u6b63\u5e38\u901a\u4fe1\u4e86,\u4e5f\u5c31\u8bf4\u660e\u6211\u4eec\u7684\u8def\u7531\u914d\u7f6e\u751f\u6548\u4e86.<\/p>\n<p>PC0&gt; ping 192.168.2.2<\/p>\n<p>Pinging 192.168.2.2 with 32 bytes of data:<\/p>\n<p>Reply from 192.168.2.2: bytes=32 time=12ms TTL=126<\/p>\n<p>Ping statistics for 192.168.2.2:<\/p>\n<p>Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),<\/p>\n<p>Approximate round trip times in milli-seconds:<\/p>\n<p>Minimum = 12ms, Maximum = 12ms, Average = 12ms<\/p>\n<p>\u4ee5\u4e0a\u7684\u8def\u7531\u914d\u7f6e\u65b9\u6cd5,\u9002\u7528\u4e8e\u5c0f\u578b\u7f51\u7edc\u73af\u5883,\u5728\u5927\u578b\u7f51\u7edc\u73af\u5883\u4e2d\u8fd9\u79cd\u9759\u6001\u8def\u7531\u7684\u914d\u7f6e\u65b9\u5f0f\u5f88\u4e0d\u9002\u5408\u7ef4\u62a4,\u4e00\u65e6\u8bbe\u5907\u8fc7\u591a,\u5219\u53ef\u80fd\u81ea\u5df1\u90fd\u641e\u4e0d\u6e05\u5934\u7eea,\u6240\u4ee5\u5728\u751f\u4ea7\u73af\u5883\u4e2d,\u6211\u4eec\u4f1a\u4f7f\u7528\u52a8\u6001\u8def\u7531\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u8def\u7531\u5668\u7684\u914d\u7f6e,\u63a5\u4e0b\u6765\u7ee7\u7eed\u5b66\u4e60\u52a8\u6001\u8def\u7531\u7684\u914d\u7f6e\u65b9\u5f0f\u5427.<\/p>\n<h3>RIP \u52a8\u6001\u8def\u7531<\/h3>\n<p>\u52a8\u6001\u8def\u7531\u662f\u57fa\u4e8e\u67d0\u79cd\u534f\u8bae\u5b9e\u73b0\u7684,\u5e38\u89c1\u7684\u8def\u7531\u534f\u8bae\u6709\u5185\u5185\u90e8\u7f51\u5173\u534f\u8bae(IGP)\u548c\u8fb9\u754c\u7f51\u5173\u534f\u8bae(BGP),\u5176\u4e2d\u5185\u90e8\u7f51\u5173\u534f\u8bae\u53c8\u5206\u4e3a\u8def\u7531\u4fe1\u606f\u534f\u8bae(RIP)\u548c\u5f00\u653e\u5f0f\u6700\u77ed\u8def\u5f84\u4f18\u5148\u534f\u8bae(OSPF)\u534f\u8bae.<\/p>\n<p>\u5176\u4e2dRIP(\u8def\u7531\u4fe1\u606f\u534f\u8bae)\u662f\u6700\u5148\u88ab\u5e7f\u6cdb\u5e94\u7528\u7684\u5185\u90e8\u7f51\u5173\u8def\u7531\u534f\u8bae,RIP\u4f7f\u7528\u8df3\u6570\u6765\u8861\u91cf\u5230\u8fbe\u76ee\u6807\u5730\u5740\u7684\u8ddd\u79bb,\u8df3\u6570\u662f\u6307\u6570\u636e\u4ece\u6e90\u5730\u5740\u5230\u8fbe\u76ee\u6807\u5730\u5740\u4e4b\u95f4\u7ecf\u8fc7\u7684\u8def\u7531\u5668\u4e2a\u6570.\u4ece\u8def\u7531\u5668\u5230\u76f4\u63a5\u8fde\u63a5\u7684\u7f51\u7edc\u7684\u8df3\u6570\u5b9a\u4e49\u4e3a1,\u6bcf\u7ecf\u8fc7\u4e00\u4e2a\u8def\u7531\u5668\u5219\u6570\u503c\u4f1a\u589e\u52a01,RIP\u5141\u8bb8\u7684\u6700\u5927\u8df3\u6570\u662f15\u8df3,\u8d85\u8fc715\u8df3\u7684\u7f51\u7edc\u5c06\u65e0\u6cd5\u5230\u8fbe,\u56e0\u6b64RIP\u9002\u5408\u7528\u4e8e\u5c0f\u578b\u7684\u7f51\u7edc\u73af\u5883\u4e2d.<\/p>\n<p>RIP\u534f\u8bae\u9ed8\u8ba4\u4f1a\u6bcf\u969430\u79d2\u5c31\u4f1a\u4e0e\u5176\u4ed6\u76f8\u8fde\u7684\u7f51\u7edc\u5e7f\u64ad\u81ea\u5df1\u7684\u8def\u7531\u8868,\u6536\u5230\u5e7f\u64ad\u7684\u8def\u7531\u5668\u4f1a\u5c06\u6536\u5230\u7684\u4fe1\u606f\u4e0e\u81ea\u5df1\u8def\u7531\u8868\u8fdb\u884c\u6bd4\u8f83,\u5224\u65ad\u662f\u5426\u5c06\u5176\u4e2d\u7684\u8def\u7531\u6761\u76ee\u52a0\u5165\u5230\u81ea\u5df1\u7684\u8def\u7531\u8868\u4e2d,\u76ee\u524dRIP\u5171\u67093\u4e2d\u7248\u672c,RIPv1,RIPv2,RIPng,\u5176\u4e2dRIPng\u5e94\u7528\u4e8eIPv6\u7f51\u7edc\u73af\u5883\u4e2d,RIPv1\u662f\u6709\u7c7b\u8def\u7531\u534f\u8bae,RIPv2\u5219\u662f\u65e0\u7c7b\u8def\u7531\u534f\u8bae.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"308\" class=\"wp-image-2534\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-application-description-automatically-ge.jpeg\" alt=\"Diagram, application\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-application-description-automatically-ge.jpeg 900w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-application-description-automatically-ge-300x103.jpeg 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-application-description-automatically-ge-768x263.jpeg 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/p>\n<p><strong>\u914d\u7f6e\u53c2\u6570\u7b80\u4ecb:<\/strong>\u00a0\u9996\u5148\u6211\u4eec\u6839\u636e\u4e0a\u56fe\u7684\u914d\u7f6e\u8981\u6c42\u914d\u7f6e\u597d\u8def\u7531\u5668\u5404\u79cd\u57fa\u672c\u53c2\u6570,\u4e0b\u9762\u7684\u53c2\u6570\u662f\u5177\u4f53\u7684\u5730\u5740\u89c4\u5212.<\/p>\n<p>[\u8bbe\u5907\u540d\u79f0] [\u8bbe\u5907\u63a5\u53e3] [IP\u5730\u5740] [\u9ed8\u8ba4\u7f51\u5173]<\/p>\n<p>Router1 Serial0\/0\/0 192.168.10.1\/24 &#8212;<\/p>\n<p>Router2 Serial0\/0\/0 192.168.10.2\/24 &#8212;<\/p>\n<p>Serial0\/0\/1 192.168.20.1\/24 &#8212;<\/p>\n<p>Router3 Serial0\/0\/0 192.168.20.2\/24 &#8212;<\/p>\n<p>Serial0\/0\/1 192.168.30.1\/24 &#8212;<\/p>\n<p>Router4 Serial0\/0\/0 192.168.30.2\/24 &#8212;<\/p>\n<p><strong>\u914d\u7f6e\u8def\u7531\u5668:<\/strong>\u00a0\u6839\u636e\u4e0a\u8868\u7684\u7ed3\u6784\u914d\u7f6e\u597d\u8def\u7531\u5668\u7684\u5404\u79cd\u53c2\u6570,\u4e3b\u8981\u914d\u7f6e\u8def\u7531\u5668\u7684\u63a5\u53e3IP\u5730\u5740.<\/p>\n<p>Router&gt;enable<\/p>\n<p>Router#configure terminal<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# interface Serial0\/0\/0<\/p>\n<p>Router1(config-if)# ip address 192.168.10.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router2\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router2(config)# interface Serial0\/0\/0<\/p>\n<p>Router2(config-if)# ip address 192.168.10.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router2(config)# interface Serial0\/0\/1<\/p>\n<p>Router2(config-if)# ip address 192.168.20.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router3\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router3(config)# interface Serial0\/0\/0<\/p>\n<p>Router3(config-if)# ip address 192.168.20.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router3(config)# interface Serial0\/0\/1<\/p>\n<p>Router3(config-if)# ip address 192.168.30.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router4\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router4(config)#interface Serial0\/0\/0<\/p>\n<p>Router4(config-if)#ip address 192.168.30.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p><strong>\u914d\u7f6e\u5e76\u542f\u7528RIP\u8def\u7531:<\/strong>\u00a0\u5728\u6bcf\u53f0\u8def\u7531\u5668\u4e0a\u542f\u7528\u5e76\u914d\u7f6e\u597dRIP\u52a8\u6001\u8def\u7531.<\/p>\n<p>Router&gt;enable<\/p>\n<p>Router#configure terminal<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u542f\u7528RIP\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# router rip \/\/ \u542f\u7528RIP\u8def\u7531<\/p>\n<p>Router1(config-router)# version 2 \/\/ \u6307\u5b9a\u4f7f\u7528RIP\u7248\u672c\u4e3aRIPv2<\/p>\n<p>Router1(config-router)# network 192.168.10.0 \/\/ \u58f0\u660e\u4e0eRouter1\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router1(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router2\u4e0a\u542f\u7528RIP\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router2(config)# router rip<\/p>\n<p>Router2(config-router)# version 2<\/p>\n<p>Router2(config-router)# network 192.168.10.0 \/\/ \u58f0\u660e\u4e0eRouter2\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router2(config-router)# network 192.168.20.0 \/\/ \u58f0\u660e\u4e0eRouter3\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router2(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router3\u4e0a\u542f\u7528RIP\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router3(config)# router rip<\/p>\n<p>Router3(config-router)# version 2<\/p>\n<p>Router3(config-router)# network 192.168.20.0 \/\/ \u58f0\u660e\u4e0eRouter3\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router3(config-router)# network 192.168.30.0 \/\/ \u58f0\u660e\u4e0eRouter4\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router3(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router4\u4e0a\u542f\u7528RIP\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router4(config)# router rip<\/p>\n<p>Router4(config-router)# version 2<\/p>\n<p>Router4(config-router)# network 192.168.30.0 \/\/ \u58f0\u660e\u4e0eRouter4\u76f4\u8fde\u7684\u7f51\u7edc\u53f7<\/p>\n<p>Router4(config-router)# exit<\/p>\n<p><strong>\u68c0\u67e5\u914d\u7f6e\u4fe1\u606f:<\/strong>\u00a0\u914d\u7f6e\u5b8c\u6210\u540e,\u5728Router1\u4e0a\u6267\u884cshow ip route \u547d\u4ee4\u67e5\u770bRIP\u914d\u7f6e\u7ed3\u679c,\u5982\u4e0b.<\/p>\n<p>Router1#show ip route<\/p>\n<p>Codes: C &#8211; connected, S &#8211; static, I &#8211; IGRP, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<\/p>\n<p>D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<\/p>\n<p>N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<\/p>\n<p>E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2, E &#8211; EGP<\/p>\n<p>i &#8211; IS-IS, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2, ia &#8211; IS-IS inter area<\/p>\n<p>* &#8211; candidate default, U &#8211; per-user static route, o &#8211; ODR<\/p>\n<p>P &#8211; periodic downloaded static route<\/p>\n<p>Gateway of last resort is not set<\/p>\n<p>C 192.168.10.0\/24 is directly connected, Serial0\/0\/0<\/p>\n<p>R 192.168.20.0\/24 [120\/1] via 192.168.10.2, 00:00:01, Serial0\/0\/0 \/\/ R\u8868\u793a\u5f53\u524d\u662fRIP\u8def\u7531<\/p>\n<p>R 192.168.30.0\/24 [120\/2] via 192.168.10.2, 00:00:01, Serial0\/0\/0 \/\/ \u8def\u7531\u6761\u76ee\u662fRIP\u81ea\u52a8\u751f\u6210\u7684<\/p>\n<p><strong>\u6d4b\u8bd5\u8fde\u901a\u6027:<\/strong>\u00a0\u6b64\u65f6\u6211\u4eec\u5728Router1\u8def\u7531\u5668\u4e0aPing\u8def\u7531\u5668Router4\u662f\u53ef\u4ee5\u901a\u4fe1\u7684,\u8bf4\u660e\u914d\u7f6e\u6210\u529f\u4e86.<\/p>\n<p>Router1#ping 192.168.30.2<\/p>\n<p>Type escape sequence to abort.<\/p>\n<p>Sending 5, 100-byte ICMP Echos to 192.168.30.2, timeout is 2 seconds:<\/p>\n<p>!!!!!<\/p>\n<p>Success rate is 100 percent (5\/5), round-trip min\/avg\/max = 3\/15\/27 ms<\/p>\n<h3>OSPF \u52a8\u6001\u8def\u7531<\/h3>\n<p>\u5728\u4e0a\u9762\u7684\u914d\u7f6e\u8bd5\u9a8c\u4e2d\u6211\u4eec\u901a\u8fc7\u4f7f\u7528RIP\u534f\u8bae\u5b8c\u6210\u4e86\u4e00\u4e2a\u8def\u7531\u5668\u4e4b\u95f4\u7684\u6570\u636e\u901a\u4fe1,\u4f46\u662fRIP\u534f\u8bae\u6700\u5927\u4ec5\u4ec5\u652f\u630115\u4e2a\u8def\u7531\u8282\u70b9,\u867d\u7136\u5728\u4e2d\u5c0f\u578b\u7f51\u7edc\u4e2d\u8fd9\u4e9b\u8282\u70b9\u8db3\u591f\u4f7f\u7528\u4e86,\u4f46\u662f\u5728\u4e00\u4e9b\u5927\u578b\u4f01\u4e1a\u4e2d\u5f80\u5f80\u9700\u66f4\u591a\u7684\u8df3\u6570,\u5c31\u662f\u56e0\u4e3a\u8fd9\u79cd\u9700\u6c42\u6211\u4eec\u7684OSPF\u534f\u8bae\u5c31\u7531\u6b64\u8bde\u751f\u5566.<\/p>\n<p>OSPF(\u5f00\u653e\u5f0f\u6700\u77ed\u8def\u5f84\u4f18\u5148),\u8be5\u534f\u8bae\u662f\u57fa\u4e8e\u94fe\u8def\u72b6\u6001\u7684\u534f\u8bae\u89c4\u8303,\u56e0\u6b64\u4e5f\u53ef\u4ee5\u79f0\u4e3a\u94fe\u8def\u72b6\u6001\u534f\u8bae,\u548cRIP\u534f\u8bae\u76f8\u540c,OSPF\u534f\u8bae\u540c\u6837\u4f7f\u7528\u8df3\u6570\u8ba1\u91cf\u8def\u5f84\u5f00\u9500,\u4f46\u662f\u4e0eRIP\u4e0d\u540c\u7684\u662f,OSPF\u534f\u8bae\u4e0d\u53d7\u7269\u7406\u8df3\u6570\u7684\u9650\u5236,\u5176\u8def\u5f84\u5f00\u9500\u4e0e\u7f51\u7edc\u4e2d\u7684\u94fe\u8def\u5f00\u9500\u7b49\u76f8\u5173.<\/p>\n<p>OSPF\u534f\u8bae\u91c7\u7528\u4e86FPS\u7b97\u6cd5\u6765\u8ba1\u7b97\u6700\u77ed\u8def\u5f84\u6570,SPF\u7b97\u6cd5\u5c06\u6bcf\u4e00\u4e2a\u8def\u7531\u4f5c\u4e3a\u6839(ROOT),\u6765\u8ba1\u7b97\u5176\u6570\u636e\u5305\u5230\u8fbe\u6bcf\u4e00\u4e2a\u76ee\u6807\u8def\u7531\u5668\u4e4b\u95f4\u7684\u8ddd\u79bb,\u6bcf\u4e2a\u8def\u7531\u5668\u6839\u636e\u4e00\u4e2a\u7edf\u4e00\u7684\u6570\u636e\u5e93LSDB\u8ba1\u7b97\u51fa\u8def\u7531\u57df\u7684\u62d3\u6251\u7ed3\u6784\u56fe,\u8be5\u7ed3\u6784\u5f88\u50cf\u662f\u4e00\u9897\u6811,\u6240\u4ee5\u5c31\u53eb\u505a\u6700\u77ed\u8def\u5f84\u6811.<\/p>\n<p>OSPF\u534f\u8bae\u7684\u4f18\u70b9<\/p>\n<p>1.OSPF\u91c7\u7528\u4e86SPF\u7b97\u6cd5,\u4ece\u800c\u53ef\u4ee5\u5f88\u597d\u7684\u907f\u514d\u8def\u7531\u5668\u73af\u8def\u7684\u4ea7\u751f.<br \/>\n2.OSPF\u534f\u8bae\u867d\u7136\u4e5f\u4f7f\u7528\u8df3\u6570\u4f5c\u4e3a\u8ba1\u91cf\u5355\u4f4d,\u4f46\u4e0d\u53d7\u7269\u7406\u8df3\u6570\u7684\u9650\u5236.<br \/>\n3.\u5f53\u7f51\u7edc\u94fe\u8def\u72b6\u6001\u53d1\u751f\u53d8\u5316\u65f6,OSPF\u80fd\u591f\u8fc5\u901f\u6355\u6349\u5e76\u5e94\u7528,\u6536\u655b\u5feb,\u8def\u7531\u4fe1\u606f\u6d41\u91cf\u5c0f.<br \/>\n4.OSPF\u8def\u7531\u534f\u8bae\u652f\u6301\u8def\u7531\u8ba4\u8bc1\u4f53\u7cfb,\u4e14\u8fd8\u53ef\u4ee5\u5b9a\u4e49\u4e0d\u540c\u7684\u8ba4\u8bc1\u65b9\u5f0f,\u63d0\u9ad8\u4e86\u7f51\u7edc\u5b89\u5168\u6027.<br \/>\n5.OSPF\u534f\u8bae\u63d0\u4f9b\u4e86\u8f83\u597d\u7684\u8d1f\u8f7d\u5747\u8861\u6027,\u5176\u6570\u636e\u66f4\u65b0\u6bd4\u8f83\u667a\u80fd,\u76f8\u5e94\u7684\u51cf\u5c0f\u4e86\u7f51\u7edc\u6d41\u91cf\u7684\u5e26\u5bbd.<\/p>\n<p>\u5728\u914d\u7f6eOSPF\u8def\u7531\u4e4b\u524d\u8fd8\u6709\u4e00\u4e2a\u5c0f\u77e5\u8bc6\u70b9\u9700\u8981\u8865\u5145,\u5728\u4e0b\u9762\u7684\u914d\u7f6e\u8bd5\u9a8c\u4e2d\u4f60\u4f1a\u770b\u5230\u4f8b\u59820.0.0.255\u8fd9\u6837\u7684\u7f51\u7edc\u53f7,\u8fd9\u79cd\u7f51\u7edc\u53f7\u88ab\u79f0\u4f5c\u901a\u914d\u7b26\u63a9\u7801,\u901a\u5e38\u60c5\u51b5\u4e0b\u901a\u914d\u7b26\u63a9\u7801\u53ef\u7531,255.255.255.255(\u5e7f\u64ad\u5730\u5740)\u51cf\u53bb\u5f53\u524d\u7684255.255.255.0(\u5b50\u7f51\u63a9\u7801),\u6765\u83b7\u5f97,\u6b64\u5904\u5c0f\u5b9e\u9a8c\u7684\u901a\u914d\u7b26\u63a9\u7801\u4e3a0.0.0.255 area 0.<\/p>\n<p>\u63a5\u4e0b\u6765\u5f00\u59cb\u6b65\u5165\u6b63\u9898,\u6211\u4eec\u8fd8\u662f\u4f7f\u7528RIP\u8def\u7531\u7684\u62d3\u6251\u7ed3\u6784\u4ee5\u53caIP\u5730\u5740\u7684\u914d\u7f6e\u90fd\u76f8\u540c,\u4f46\u662f\u8fd9\u91cc\u5728\u914d\u7f6e\u52a8\u6001\u8def\u7531\u7684\u65f6\u5019,\u6211\u4eec\u4f7f\u7528OSPF\u7684\u65b9\u5f0f\u6765\u914d\u7f6e,\u8fc7\u7a0b\u5982\u4e0b:<\/p>\n<p><strong>\u914d\u7f6e\u8def\u7531\u5668:<\/strong>\u00a0\u9996\u5148\u66f4\u5177\u4e0a\u8868\u7684\u7ed3\u6784\u914d\u7f6e\u597d\u8def\u7531\u5668\u7684\u5404\u79cd\u53c2\u6570.<\/p>\n<p>Router&gt;enable<\/p>\n<p>Router#configure terminal<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# interface Serial0\/0\/0<\/p>\n<p>Router1(config-if)# ip address 192.168.10.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router2\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router2(config)# interface Serial0\/0\/0<\/p>\n<p>Router2(config-if)# ip address 192.168.10.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router2(config)# interface Serial0\/0\/1<\/p>\n<p>Router2(config-if)# ip address 192.168.20.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router3\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router3(config)# interface Serial0\/0\/0<\/p>\n<p>Router3(config-if)# ip address 192.168.20.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router3(config)# interface Serial0\/0\/1<\/p>\n<p>Router3(config-if)# ip address 192.168.30.1 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>#&#8212;-\u5728Router4\u4e0a\u64cd\u4f5c&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router4(config)# interface Serial0\/0\/0<\/p>\n<p>Router4(config-if)# ip address 192.168.30.2 255.255.255.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p><strong>\u914d\u7f6e\u5e76\u542f\u7528OSPF\u8def\u7531:<\/strong>\u00a0\u5728\u6bcf\u53f0\u8def\u7531\u5668\u4e0a\u542f\u7528\u5e76\u914d\u7f6e\u597dOSPF\u52a8\u6001\u8def\u7531.<\/p>\n<p>Router&gt;enable<\/p>\n<p>Router#configure terminal<\/p>\n<p>#&#8212;-\u5728Router1\u4e0a\u542f\u7528OSPF\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# router ospf 1 \/\/ \u542f\u7528OSPF\u8def\u7531,\u5e76\u8bbe\u7f6e\u8fdb\u7a0b\u53f7\u4e3a1<\/p>\n<p>Router1(config-router)# router-id 1.1.1.1 \/\/ \u4e3aRouter1\u914d\u7f6eRID\u7f16\u53f7<\/p>\n<p>Router1(config-router)# network 192.168.10.0 0.0.0.255 area 0 \/\/ \u914d\u7f6e\u8def\u7531\u8bb0\u5f55<\/p>\n<p>Router1(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router2\u4e0a\u542f\u7528OSPF\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router2(config)# router ospf 1 \/\/ \u542f\u7528OSPF\u8def\u7531,\u5e76\u8bbe\u7f6e\u8fdb\u7a0b\u53f7\u4e3a1<\/p>\n<p>Router2(config-router)# router-id 2.2.2.2 \/\/ \u4e3aRouter2\u914d\u7f6eRID\u7f16\u53f7<\/p>\n<p>Router2(config-router)# network 192.168.10.0 0.0.0.255 area 0 \/\/ \u914d\u7f6e\u8def\u7531\u8bb0\u5f55<\/p>\n<p>Router2(config-router)# network 192.168.20.0 0.0.0.255 area 0<\/p>\n<p>Router2(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router3\u4e0a\u542f\u7528OSPF\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router3(config)# router ospf 1 \/\/ \u542f\u7528OSPF\u8def\u7531,\u5e76\u8bbe\u7f6e\u8fdb\u7a0b\u53f7\u4e3a1<\/p>\n<p>Router3(config-router)# router-id 3.3.3.3 \/\/ \u4e3aRouter3\u914d\u7f6eRID\u7f16\u53f7<\/p>\n<p>Router3(config-router)# network 192.168.20.0 0.0.0.255 area 0<\/p>\n<p>Router3(config-router)# network 192.168.30.0 0.0.0.255 area 0<\/p>\n<p>Router3(config-router)# exit<\/p>\n<p>#&#8212;-\u5728Router4\u4e0a\u542f\u7528OSPF\u8def\u7531\u534f\u8bae\u5e76\u914d\u7f6e&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router3(config)# router ospf 1 \/\/ \u542f\u7528OSPF\u8def\u7531,\u5e76\u8bbe\u7f6e\u8fdb\u7a0b\u53f7\u4e3a1<\/p>\n<p>Router3(config-router)# router-id 4.4.4.4 \/\/ \u4e3aRouter4\u914d\u7f6eRID\u7f16\u53f7<\/p>\n<p>Router3(config-router)# network 192.168.30.0 0.0.0.255 area 0<\/p>\n<p>Router3(config-router)# exit<\/p>\n<p><strong>\u68c0\u67e5\u914d\u7f6e\u4fe1\u606f:<\/strong>\u00a0\u914d\u7f6e\u5b8c\u6210\u540e,\u5728Router1\u4e0a\u6267\u884cshow ip route \u547d\u4ee4\u67e5\u770bOSPF\u914d\u7f6e\u7ed3\u679c,\u5982\u4e0b.<\/p>\n<p>Router#show ip route<\/p>\n<p>Codes: C &#8211; connected, S &#8211; static, I &#8211; IGRP, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<\/p>\n<p>D &#8211; EIGRP, EX &#8211; EIGRP external, O &#8211; OSPF, IA &#8211; OSPF inter area<\/p>\n<p>N1 &#8211; OSPF NSSA external type 1, N2 &#8211; OSPF NSSA external type 2<\/p>\n<p>E1 &#8211; OSPF external type 1, E2 &#8211; OSPF external type 2, E &#8211; EGP<\/p>\n<p>i &#8211; IS-IS, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2, ia &#8211; IS-IS inter area<\/p>\n<p>* &#8211; candidate default, U &#8211; per-user static route, o &#8211; ODR<\/p>\n<p>P &#8211; periodic downloaded static route<\/p>\n<p>Gateway of last resort is not set<\/p>\n<p>C 192.168.10.0\/24 is directly connected, Serial0\/0\/0 \/\/ C\u8868\u793a\u662f\u672c\u673a\u9ed8\u8ba4\u8def\u7531<\/p>\n<p>O 192.168.20.0\/24 [110\/128] via 192.168.10.2, 00:02:25, Serial0\/0\/0 \/\/ O\u8868\u793a\u5f53\u524d\u662fOSPF\u8def\u7531<\/p>\n<p>O 192.168.30.0\/24 [110\/192] via 192.168.10.2, 00:01:55, Serial0\/0\/0 \/\/ \u8def\u7531\u6761\u76ee\u662fOSPF\u81ea\u52a8\u751f\u6210\u7684<\/p>\n<p><strong>\u6d4b\u8bd5\u8fde\u901a\u6027:<\/strong>\u00a0\u6b64\u65f6\u6211\u4eec\u5728Router1\u8def\u7531\u5668\u4e0aPing\u8def\u7531\u5668Router4\u662f\u53ef\u4ee5\u901a\u4fe1\u7684,\u8bf4\u660e\u914d\u7f6e\u6210\u529f\u4e86.<\/p>\n<p>Router1#ping 192.168.30.2<\/p>\n<p>Type escape sequence to abort.<\/p>\n<p>Sending 5, 100-byte ICMP Echos to 192.168.30.2, timeout is 2 seconds:<\/p>\n<p>!!!!!<\/p>\n<p>Success rate is 100 percent (5\/5), round-trip min\/avg\/max = 3\/15\/27 ms<\/p>\n<h3>\u5b9e\u6218:\u914d\u7f6eRIP\u4f01\u4e1a\u73af\u5883<\/h3>\n<p>\u63a5\u4e0b\u6765,\u6211\u4eec\u901a\u8fc7\u4f7f\u7528\u4e09\u5c42\u4ea4\u6362\u673a\u914d\u5408\u8def\u7531\u5668,\u6765\u5b9e\u73b0\u4e00\u4e2a\u8de8\u7f51\u6bb5\u901a\u4fe1\u7684\u6848\u4f8b,\u5176\u914d\u7f6e\u6d41\u7a0b\u662f,\u9996\u5148\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362\u673a\u5e76\u5212\u5206\u597dVLAN\u7684\u5c42\u6b21,\u63a5\u7740\u5728\u914d\u7f6eRouter0\u8fd9\u91cc\u4e0d\u9700\u8981\u914d\u7f6eVLAN,\u539f\u56e0\u662f\u4e09\u5c42\u4ea4\u6362\u673a\u4e0eRouter0\u5171\u4eabVLAN,\u6700\u540e\u5728\u914d\u7f6e\u5916\u7f51\u53e3\u7684Router1\u8def\u7531\u5668,\u5176\u62d3\u6251\u7ed3\u6784\u5982\u4e0b\u56fe\u6240\u793a:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1084\" height=\"530\" class=\"wp-image-2535\" src=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-8.jpeg\" alt=\"Diagram\n\nDescription automatically generated\" srcset=\"https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-8.jpeg 1084w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-8-300x147.jpeg 300w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-8-1024x501.jpeg 1024w, https:\/\/www.xh86.me\/wp-content\/uploads\/2021\/10\/diagram-description-automatically-generated-8-768x375.jpeg 768w\" sizes=\"auto, (max-width: 1084px) 100vw, 1084px\" \/><\/p>\n<p><strong>\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362:<\/strong>\u00a0\u9996\u5148\u5148\u6765\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362\u673a,\u521b\u5efa3\u4e2aVLAN,\u5e76\u5212\u5206\u6210\u4e09\u4e2aVLAN\u865a\u62df\u5c40\u57df\u7f51.<\/p>\n<p>Switch&gt; enable<\/p>\n<p>Switch# configure terminal<\/p>\n<p>#&#8212;-\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362\u7684VLAN10\u5e76\u628a\u7aef\u53e3fa0\/1\u52a0\u5165\u5230VLAN&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# vlan 10 \/\/ \u521b\u5efaVLAN10<\/p>\n<p>Switch(config-vlan)# interface fa0\/1 \/\/ \u5c06Fa1\u4fe9\u7aef\u53e3\u52a0\u5165\u5230VLAN10<\/p>\n<p>Switch(config-if-range)# switchport mode access<\/p>\n<p>Switch(config-if-range)# switchport access vlan 10 \/\/ \u628a\u7aef\u53e3\u52a0\u5165\u5230VLAN10<\/p>\n<p>Switch(config-if-range)# no shutdown \/\/ \u542f\u7528\u7aef\u53e3<\/p>\n<p>Switch(config-if-range)# exit<\/p>\n<p>#&#8212;-\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362\u7684VLAN20\u5e76\u628a\u7aef\u53e3fa0\/2\u52a0\u5165\u5230VLAN&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# vlan 20<\/p>\n<p>Switch(config-vlan)# interface fa0\/2<\/p>\n<p>Switch(config-if-range)# switchport mode access<\/p>\n<p>Switch(config-if-range)# switchport access vlan 20<\/p>\n<p>Switch(config-if-range)# no shutdown<\/p>\n<p>Switch(config-if-range)# exit<\/p>\n<p>#&#8212;-\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362\u7684VLAN30\u5e76\u628a\u7aef\u53e3fa0\/3\u52a0\u5165\u5230VLAN&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# vlan 30<\/p>\n<p>Switch(config-vlan)# interface fa0\/3<\/p>\n<p>Switch(config-if)# switchport mode access<\/p>\n<p>Switch(config-if)# switchport access vlan 30<\/p>\n<p>Switch(config-if)# no shutdown<\/p>\n<p>Switch(config-if)# exit<\/p>\n<p><strong>\u914d\u7f6e\u4e09\u5c42\u4ea4\u6362IP\u5730\u5740:<\/strong>\u00a0\u7ed9\u4e0a\u9762\u5206\u914d\u597d\u7684\u4e09\u4e2aVLAN\u865a\u62df\u5c40\u57df\u7f51\u4e00\u4e2aIP\u5730\u5740,\u8fd9\u91cc\u6307\u5b9a\u4e3a\u5404\u81ea\u7684\u7f51\u5173\u5730\u5740\u5c31\u597d.<\/p>\n<p>Switch&gt; enable<\/p>\n<p>Switch# configure terminal<\/p>\n<p>#&#8212;-\u7ed9\u4e09\u5c42\u4ea4\u6362\u7684VLAN10\u5185\u7684\u4e3b\u673a\u6dfb\u52a0\u7f51\u5173&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# interface vlan 10 \/\/ \u9009\u62e9vlan10\u63a5\u53e3<\/p>\n<p>Switch(config-if)# ip address 192.168.1.1 255.255.255.0 \/\/ \u914d\u7f6e\u7f51\u5173\u5730\u5740<\/p>\n<p>Switch(config-if)# no shutdown \/\/ \u5f00\u542f\u7aef\u53e3<\/p>\n<p>Switch(config-if)# exit<\/p>\n<p>#&#8212;-\u7ed9\u4e09\u5c42\u4ea4\u6362\u7684VLAN20\u5185\u7684\u4e3b\u673a\u6dfb\u52a0\u7f51\u5173&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# interface vlan 20 \/\/ \u9009\u62e9vlan20\u63a5\u53e3<\/p>\n<p>Switch(config-if)# ip address 192.168.2.1 255.255.255.0 \/\/ \u914d\u7f6e\u7f51\u5173\u5730\u5740<\/p>\n<p>Switch(config-if)# no shutdown \/\/ \u5f00\u542f\u7aef\u53e3<\/p>\n<p>Switch(config-if)# exit<\/p>\n<p>#&#8212;-\u7ed9\u4e09\u5c42\u4ea4\u6362\u7684VLAN30\u5185\u7684\u4e3b\u673a\u6dfb\u52a0\u7f51\u5173&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Switch(config)# interface vlan 30 \/\/ \u9009\u62e9vlan30\u63a5\u53e3<\/p>\n<p>Switch(config-if)# ip address 192.168.3.1 255.255.255.0 \/\/ \u914d\u7f6e\u7f51\u5173\u5730\u5740<\/p>\n<p>Switch(config-if)# no shutdown \/\/ \u5f00\u542f\u7aef\u53e3<\/p>\n<p>Switch(config-if)# exit<\/p>\n<p><strong>\u914d\u7f6e\u8def\u7531\u5668Router0:<\/strong>\u00a0\u914d\u7f6e\u597d\u7f51\u5173\u540e,\u63a5\u7740\u914d\u7f6e\u8def\u7531\u5668Router0,\u914d\u7f6e\u63a5\u53e3IP\u5730\u5740,\u6ce8\u610f\u5728DCE\u63a5\u53e3\u9700\u8981\u914d\u7f6e\u65f6\u949f.<\/p>\n<p>Router&gt; enable<\/p>\n<p>Router# configure terminal<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531fa0\/0\u7aef\u53e3\u7684IP\u5730\u5740&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0(config)# interface fa0\/0<\/p>\n<p>Router0(config-if)# ip address 192.168.3.2 255.255.255.0<\/p>\n<p>Router0(config-if)# no shutdown<\/p>\n<p>Router0(config-if)# exit<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531fa0\/1\u7aef\u53e3\u7684IP\u5730\u5740&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0(config)# interface fa0\/1<\/p>\n<p>Router0(config-if)# ip address 192.168.4.1 255.255.255.0<\/p>\n<p>Router0(config-if)# no shutdown<\/p>\n<p>Router0(config-if)# exit<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531se0\/0\/0\u8fde\u63a5\u5916\u7f51\u7aef\u53e3IP&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0(config)# interface se0\/0\/0<\/p>\n<p>Router0(config-if)# ip address 1.1.1.1 255.0.0.0<\/p>\n<p>Router0(config-if)# no shutdown<\/p>\n<p>Router0(config-if)# exit<\/p>\n<p><strong>\u914d\u7f6e\u8def\u7531\u5668Router1:<\/strong>\u00a0\u6700\u540e\u914d\u7f6e\u5916\u7f51\u4e0e\u5185\u7f51\u7684\u8854\u63a5\u8def\u7531\u5668Router1,\u914d\u7f6e\u597d\u5916\u7f51\u53e3IP\u5730\u5740\u4ee5\u53ca\u5185\u7f51\u53e3\u5730\u5740.<\/p>\n<p>Router&gt; enable<\/p>\n<p>Router# configure terminal<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531\u56681\u7684\u5185\u7f51\u53e3\u5730\u5740&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# interface se0\/0\/0<\/p>\n<p>Router1(config-if)# ip address 1.1.1.2 255.0.0.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p>Router1(config-if)# exit<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531\u56681\u7684\u5916\u7f51\u53e3\u5730\u5740&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# interface fa0\/0<\/p>\n<p>Router1(config-if)# ip address 10.10.10.10 255.0.0.0<\/p>\n<p>Router1(config-if)# no shutdown<\/p>\n<p><strong>\u5f00\u542f\u4e09\u5c42\u4ea4\u6362\u673a\u8def\u7531:<\/strong>\u00a0\u5f00\u542f\u4e09\u5c42\u4ea4\u6362\u673a\u8def\u7531\u529f\u80fd,\u5e76\u914d\u7f6eRIP\u52a8\u6001\u8def\u7531,\u6307\u660e\u6bcf\u4e2a\u8def\u7531\u5668\u7684\u7f51\u6bb5\u5730\u5740.<\/p>\n<p>Switch(config)# ip routing<\/p>\n<p>Switch(config)# router rip<\/p>\n<p>Switch(config-router)# network 192.168.1.0<\/p>\n<p>Switch(config-router)# network 192.168.2.0<\/p>\n<p>Switch(config-router)# network 192.168.3.0<\/p>\n<p>Switch(config-router)# network 192.168.4.0<\/p>\n<p><strong>\u914d\u7f6e\u4e8c\u5c42\u8def\u7531\u5668RIP:<\/strong>\u00a0\u6700\u540e\u8fd8\u9700\u8981\u5206\u522b\u914d\u7f6e\u4e24\u4e2a\u8def\u7531\u5668\u5e76\u5f00\u542f\u5176\u8def\u7531\u529f\u80fd.<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531\u5668Router0&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router0(config)# router rip<\/p>\n<p>Router0(config-router)# network 192.168.3.0<\/p>\n<p>Router0(config-router)# network 192.168.4.0<\/p>\n<p>#&#8212;-\u914d\u7f6e\u8def\u7531\u5668Router1&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Router1(config)# route rip<\/p>\n<p>Router1(config-router)# network 192.168.3.0<\/p>\n<p>Router1(config-router)# network 192.168.4.0<\/p>\n<p>Router1(config-router)# network 192.168.4.0<\/p>\n<p>Router1(config-router)# network 1.1.1.1<\/p>\n<p>\u4ee5\u4e0a\u914d\u7f6e\u6d41\u7a0b\u5c31\u662f\u5168\u90e8\u7684\u5b9e\u9a8c\u914d\u7f6e\u8fc7\u7a0b,\u5728\u914d\u7f6e\u5b8c\u6210\u529f\u80fd\u540e,\u6211\u4eec\u9996\u5148\u901a\u8fc7\u4f7f\u7528ping\u547d\u4ee4\u6765\u6d4b\u8bd5\u5185\u90e8\u4e3b\u673a\u662f\u5426\u80fd\u591fPing\u901a,\u6700\u540e\u7684\u5b9e\u9a8c\u7ed3\u679c\u662f,\u5185\u7f51\u4e3b\u673a\u5747\u53ef\u4ee5\u5b9e\u73b0\u901a\u4fe1,\u5916\u7f51\u4e3b\u673a\u65e0\u6cd5\u548c\u5185\u7f51\u4e3b\u673a\u901a\u4fe1.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8def\u7531\u5668,\u5176\u6700\u91cd\u8981\u7684\u529f\u80fd\u5c31\u662f\u8def\u7531,\u8def\u7531\u662f\u6307\u8def\u7531\u5668\u63a5\u6536\u5230\u6570\u636e\u65f6\u9009\u62e9\u6700\u4f73\u8def\u5f84\u5c06\u6570\u636e\u7a7f\u8fc7\u7f51\u7edc\u4f20\u8f93\u5230\u76ee\u6807\u5730\u5740\u7684\u884c\u4e3a,\u6bcf\u4e2a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2530","post","type-post","status-publish","format-standard","hentry","category-cisco"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/2530","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2530"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/2530\/revisions"}],"predecessor-version":[{"id":2536,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/2530\/revisions\/2536"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}