{"id":922,"date":"2008-10-07T22:20:00","date_gmt":"2008-10-07T14:20:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=922"},"modified":"2023-11-07T22:30:43","modified_gmt":"2023-11-07T14:30:43","slug":"cisco-ospf-route","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/922","title":{"rendered":"Cisco OSPF Route"},"content":{"rendered":"\n<p><strong>\u555f\u7528ospf<\/strong><br><strong>(config)#router ospf &lt; process-id&gt; \/\/process-id\u53ef\u81ea\u8a02<br>(config-router)#network &lt; ip&gt; &lt; wild card&gt; area &lt; area-id&gt;<\/strong><br>ps:process-id\u503c\u70ba1-65535\u4e4b\u9593,\u5404\u8def\u7531\u5668\u4e0d\u4e00\u5b9a\u8981\u76f8\u540c,\u56e0\u9019\u53ea\u5c0d\u672c\u6a5f\u6709\u610f\u7fa9,\u7528\u5728\u8b58\u5225\u8cc7\u6599\u5eab<br>ps:area-id\u503c\u53ef\u5f9e0\u523042\u5104\u500b<br>ex:<br>\u8b93\u4ecb\u9762192.168.1.0\u8207192.168.100.0\u4f7f\u7528ospf,\u4e26\u8a2dprocess-id\u70ba1,area-id\u70ba0<br>(config)#router ospf 1<br>(config-router)#network 192.168.1.0 0.0.0.255 area 0<br>(config-router)#network 192.168.100.0 0.0.0.255 area 0<br>ex:<br>\u4e0d\u8981\u8f38\u5165\u6bcf\u500b\u4ecb\u9762\u8b93192.168.20.0\u548c192.168.30.0\u548c192.168.40.0\u5404\u754c\u9762\u4f7f\u7528ospf,\u4e26\u8a2dprocess-id\u70ba1,area\u70ba0<br>(config)#router ospf 1<br>(config-router)#network 192.168.0.0 0.0.255.255 area 0<br>ps:<br>\u5169\u500bnetwork\u7684\u512a\u5148\u9806\u5e8f\u4ee52\u9032\u4f4d0\u6700\u591a\u7684wildcard-mask\u70ba\u512a\u5148<br>ex:<br>(config-router)#network 192.168.1.0 0.0.0.0 area 1<br>(config-router)#network 192.168.0.0 0.0.255.255 area 0<br>\u5247\u6703\u53e6192.168.1.0\u6b78\u985e\u70baarea 1, \u800c192.168.0.0\u5247\u6b78\u985e\u70baarea 0<br>ps:<br>\u82e5\u6c92\u6709\u6307\u5b9arid\u6216\u7121\u4efb\u4f55up\u4ecb\u9762\u7528\u4ee5\u7522\u751frid\uff0c\u5247\u6703\u56e0\u6c92\u6709rid\u4f7fospf\u7121\u6cd5\u555f\u52d5\uff0c\u4e26\u51fa\u73fe\u985e\u4f3c\u4ee5\u4e0b\u8a0a\u606f<br>ospf process 1 cannot start<\/p>\n\n\n\n<p>area\u4e92\u9023<br>(config-router)#network &lt; ip&gt; &lt; wild card&gt; area &lt; area x&gt;<br>(config-router)#network &lt; ip&gt; &lt; wild card&gt; area &lt; area y&gt;<br>ex:<br>\u8a2d\u672c\u5730\u4ecb\u976210.1.2.254\u9023\u63a5area 0,\u672c\u5730\u4ecb\u976210.1.3.1\u9023\u63a5area 1<br>(config-if)#router ospf 1<br>(config-router)#network 10.1.2.254 0.0.0.0 area 0<br>(config-router)#network 10.1.3.1 0.0.0.0 area 1&nbsp;<\/p>\n\n\n\n<p>\u50c5\u5ba3\u544a\u6307\u5b9a\u4ecb\u9762\u4f7f\u7528OSPF<br><strong>(config-if)#ip ospf &lt; process-id&gt; area &lt; area-id&gt;&nbsp;<\/strong><\/p>\n\n\n\n<p>\u5b9a\u7fa9OSPF rid<br><strong>(config-router)# router-id &lt; net&gt;<\/strong><br>\u6bcf\u500brouter\u7684rid\u9700\u552f\u4e00&nbsp;<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u4ecb\u9762\u512a\u5148\u6b0a<br><strong>(config-if)#ip ospf priority &lt; value&gt;<\/strong><br>value\u7bc4\u570d\u70ba0-255,\u9810\u8a2d\u70ba1,0\u8868\u793a\u4e0d\u53c3\u8207DR\u9078\u8209&nbsp;<br>ps:\u5e38\u7528\u65bc\u6307\u5b9aDR\u53caBDR&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.&nbsp;<\/p>\n\n\n\n<p><strong>\u8abf\u6574\u9130\u5c45\u95dc\u4fc2&nbsp;<\/strong><\/p>\n\n\n\n<p>\u6307\u5b9a\u8a72\u4ecb\u9762\u53ef\u4ee5\u6210\u70ba\u9130\u5c45<br><strong>(config-router)#neighbor &lt; network&gt;&nbsp;<\/strong><br>ps:\u7531\u65bcNBMA\u7db2\u8def\u4e0d\u6703\u81ea\u52d5\u63a2\u7d22\u9130\u5c45\uff0c\u56e0\u6b64\u9700\u900f\u904e\u8a72\u6307\u4ee4\u624b\u52d5\u6307\u5b9a\u9130\u5c45<\/p>\n\n\n\n<p>\u6307\u5b9apassive interface<br><strong>(config-router)# passive-interface &lt; int&gt;&nbsp;<\/strong><br>\u6307\u5b9a\u4ecb\u9762\u505c\u6b62\u50b3\u9001hello\u5c01\u5305\u4ee5\u95dc\u9589\u63a2\u7d22\u9130\u5c45\u7684\u529f\u80fd\u8a2d\u5b9a<\/p>\n\n\n\n<p>hello interval<br><strong>(config-if)#ip ospf hello-interval &lt; seconds&gt;<\/strong><br>\u5728\u5ee3\u64ad\u7db2\u8def\u9810\u8a2d\u662f10\u79d2,\u5728\u975e\u5ee3\u64ad\u7db2\u8def\u9810\u8a2d\u662f30\u79d2<br>ps:\u6b64\u503crouter\u9593\u8981\u76f8\u540c\u662f\u6210\u70ba\u9130\u5c45\u689d\u4ef6\u4e4b\u4e00<\/p>\n\n\n\n<p>\u8a2d\u5b9adead interval<br><strong>(config-if)#ip ospf dead-interval &lt; seconds&gt;<br><\/strong>\u9810\u8a2d\u662fhello\u76844\u500d<br>ps:\u6b64\u503crouter\u9593\u8981\u76f8\u540c\u662f\u6210\u70ba\u9130\u5c45\u689d\u4ef6\u4e4b\u4e00<br><br>\u8a2d\u5b9ahello\u9593\u9694\u70ba\u79d2\u7684\u5206\u6578&nbsp;<br><strong>(config-if)#ip ospf dead-interval minimal hello-multiplier &lt; number&gt;<\/strong><br>number=\u5206\u6578\u76841\/sec<\/p>\n\n\n\n<p>ps:<br>ospf\u652f\u63f4BFD(bidirectional forwarding detection,\u96d9\u5411\u8f49\u9001\u5075\u6e2c)&nbsp;<\/p>\n\n\n\n<p>&#8230;&nbsp;<\/p>\n\n\n\n<p><strong>OSPF\u9130\u5c45\u9a57\u8b49<\/strong><br>\u4e3b\u8981\u652f\u63f4\u660e\u6587\u8a8d\u8b49\u53caMD5\u8a8d\u8b49<br>\u540c\u4e00\u4ecb\u9762\u4e0a\u53ef\u8a2d\u5b9a\u591a\u500b\u91d1\u9470<\/p>\n\n\n\n<p>type1,\u8a2d\u5b9aospf\u660e\u6587\u8a8d\u8b49<br>1\u8a2d\u5b9a\u8a8d\u8b49\u5bc6\u78bc<br>(config-if)#ip ospf authentication-key &lt; password&gt;<br>password\u6700\u9577\u53ef\u90548\u5b57\u5143<br>2\u555f\u7528\u8a8d\u8b49,\u4e3b\u8981\u6709\u5169\u65b9\u6cd5<br>\u555f\u7528\u6240\u6709\u4ecb\u9762<br>(config-router)#area &lt; area&gt; authentication<br>\u555f\u7528\u55ae\u4e00\u4ecb\u9762\u3000<br>(config-if)#ip ospf authentication<br>ps:(\u540c\u6642\u555f\u7528\u6642\u4ee5\u55ae\u4e00\u4ecb\u9762\u7684\u6307\u4ee4\u512a\u5148)<br>ps:\u82e5\u4ecb\u9762\u8981\u4e92\u76f8\u8a8d\u8b49,\u5fc5\u9808\u8a2d\u5b9a\u76f8\u540c\u7684\u503c<br>ex:\u8a2drouter a,b\u7684ospf 1\u7d44\u614b\u5df1\u8a2d\u597d\u4e14\u6b63\u5e38\u904b\u4f5c\u5728area 0,\u4e26\u5404\u900f\u904efa0\/0\u754c\u9762\u4e92\u9023,\u4f7f\u7528\u660e\u78bccisco\u505a\u70ba\u8a8d\u8b49<br>a_router(config)#int fa0\/0<br>a_router(config-if)#ip ospf authentication-key cisco<br>a_router(config-if)#router ospf 1<br>a_router(config-router)#area 0 authentication<br>b_router(config)#int fa0\/0<br>b_router(config-if)#ip ospf authentication-key cisco<br>b_router(config-if)#router ospf 1<br>b_router(config-router)#area 0 authentication<\/p>\n\n\n\n<p>type2,\u8a2d\u5b9aospf\u52a0\u5bc6\u8a8d\u8b49(MD5)<br>1\u8a2d\u5b9a\u8a8d\u8b49\u5bc6\u78bc<br>(config-if)#ip ospf message-digest-key &lt; key-id&gt; [encryption-type] md5 &lt; key&gt;<br>&lt; key-id&gt;\u662f\u4e00\u8b58\u5225\u5b50,\u5176\u503c\u57281-255\u9593<br>[encryption-type]0\u8868\u793a\u672a\u8a2d\u548c7\u8868\u793a\u5c08\u5c6c<br>&lt; key&gt;\u662f\u53ef\u905416\u5b57\u5143\u7684\u5bc6\u78bc<br>2\u555f\u7528\u8a8d\u8b49,\u4e3b\u8981\u67092\u65b9\u6cd5\u53ef\u7528&nbsp;<br>\u555f\u7528\u5168\u90e8\u4ecb\u9762,(config-router)#area &lt; area&gt; authentication message-digest<br>\u555f\u7528\u55ae\u4e00\u4ecb\u9762,(config-if)#ip ospf authentication message-digest<br>ps:\u82e5\u4ecb\u9762\u8981\u4e92\u76f8\u8a8d\u8b49,\u5fc5\u9808\u8a2d\u5b9a\u76f8\u540c\u7684\u503c<br>ex:\u8a2drouter b,c\u7684ospf 1\u7d44\u614b\u5df1\u8a2d\u597d\u4e14\u6b63\u5e38\u904b\u4f5c\u5728area 1,\u4e26\u5404\u900f\u904efa0\/1\u754c\u9762\u4e92\u9023,\u7528\u52a0\u5bc6\u5bc6\u78bccisco\u505a\u70ba\u8a8d\u8b49,key-id\u70ba1<br>b_router(config)#int fa0\/1<br>b_router(config-if)#ip ospf message-digest-key 1 md5 cisco<br>b_router(config-if)#router ospf 1<br>b_router(config-router)#area 1 authentication message-digest<br>c_router(config)#int fa0\/1<br>c_router(config-if)#ip ospf message-digest-key 1 md5 cisco<br>c_router(config-if)#router ospf 1<br>c_router(config-router)#area 1 authentication message-digest<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.&nbsp;<\/p>\n\n\n\n<p>\u8a2d\u5b9aospf\u7db2\u8def\u985e\u578b<br><strong>(config-if)#ip ospf network &lt; type1 &lt; type2&#8230;&gt;&gt;<\/strong><br>type\u9810\u8a2d\u70babroadcast,\u4e0d\u540ctype\u6703\u6709\u4e0d\u540c\u7684\u63a2\u7d22\u9130\u5c45\u653f\u7b56<br>\u53ef\u9078\u7684type\u5982\u4e0b<br>broadcast: Specify OSPF broadcast multi-access network<br>non-broadcast: Specify OSPF NBMA network<br>point-to-multipoint: Specify OSPF point-to-multipoint network<br>point-to-point: Specify OSPF point-to-point network<br>&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.&nbsp;<\/p>\n\n\n\n<p><strong>\u8def\u5f91\u63a7\u5236&nbsp;<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9a\u4ecb\u9762\u6210\u672c\u4ee5\u8abf\u6574SPF\u7684\u7d50\u679c<br>\u4ecb\u9762\u6210\u672c\u8d8a\u4f4e,\u6210\u70ba\u8def\u5f91\u7684\u6a5f\u7387\u8d8a\u9ad8<\/p>\n\n\n\n<p>\u4fee\u6539\u53c3\u7167\u983b\u5bec<br><strong>(config-router)# auto-cost reference-bandwidth &lt; mbps&gt;<\/strong><br>\u4f7f\u7528\u539f\u56e0:\u70ba\u4e86\u8b93fastethernet\u548cgigabit\u4ecb\u9762\u6210\u672c\u6709\u5dee\u7570&nbsp;<br>\u4ecb\u9762\u7684\u6210\u672c= ceil(\u53c3\u7167\u983b\u5bec\/\u4ecb\u9762\u5be6\u969b\u983b\u5bec)&nbsp;<br>ex:<br>reference-bandwidth=100(mbps)&nbsp;<br>\u5247serial\u4ecb\u9762\u6210\u672c=ceil(100000\/1544)=64<br>fastethernet\u4ecb\u9762\u6210\u672c=ceil(100000\/100000)=1<br>gigabit\u4ecb\u9762\u6210\u672c=ceil(100000\/1000000)=ceil(0.1)=1<br>10gigabit\u4ecb\u9762\u6210\u672c=ceil(100000\/10000000)=ceil(0.01)=1<\/p>\n\n\n\n<p>\u4fee\u6539\u4ecb\u9762\u5be6\u969b\u983b\u5bec<br><strong>(config-if)#bandwidth &lt; mbps&gt;<\/strong><\/p>\n\n\n\n<p>\u76f4\u63a5\u6307\u5b9a\u4ecb\u9762\u6210\u672c<br><strong>(config-if)#ip ospf cost &lt; value&gt;<\/strong><br><br>\u6307\u5b9a\u6240\u6709\u8def\u5f91\u9023\u4f86\u8a72\u8a2d\u5099\u7684default metric&nbsp;<br><strong>(config-router)#area &lt; area&gt; default-cost &lt; metric&gt;<\/strong><\/p>\n\n\n\n<p>\u6307\u5b9a\u6700\u5927\u7684\u76f8\u540c\u8def\u7531<br><strong>(config)#maximum-path &lt; number&gt;<\/strong><br>number\u9810\u8a2d\u70ba4<br>OSPF\u50c5\u652f\u63f4equal-cost(\u6210\u672c\u76f8\u7b49)\u7684load balance&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.&nbsp;<\/p>\n\n\n\n<p>\u904e\u6ffeABR\u7684Type3 lsa&nbsp;<br><strong>(config)#ip prefix-list &lt; p-name&gt; [seq &lt; id&gt;] &lt; deny|permit&gt; &lt; prefix\/p-length&gt;<br>(config-router)# area &lt; area-id&gt; filter-list prefix &lt; p-name&gt; &lt; in|out&gt;<\/strong><br>\u53ea\u6709\u7b26\u5408deny\u624d\u6703\u5c07\u8a72\u901a\u544a\u522a\u9664<br>in:\u4ee3\u8868\u9032\u5165area-id\u7684type3 lsa\u8981\u88ab\u522a\u9664,<br>out:\u4ee3\u8868\u96e2\u958b\u8a72area-id\u7684type3 lsa\u8981\u88ab\u522a\u9664<br>ex:<br>\u522a\u9664\u9032\u5165area 3\u7684\u4e14\u5305\u542b\u5b50\u7db2\u8def10.1.3.0\/24\u7684\u901a\u544a&nbsp;<br>(config)# ip prefix-list fpolicy seq 5 deny 10.1.3.0\/24<br>(config)# ip prefix-list fpolicy seq 10 permit 0.0.0.0\/0 le 32<br>(config)# router ospf 1<br>(config-router)# area 3 filter-list prefix fpolicy in<\/p>\n\n\n\n<p>\u9650\u5236OSPF\u7684LSA\u6578\u91cf<br><strong>(config-router)# max-lsa &lt; number&gt;<\/strong><br>\u7576LSA\u8d85\u904e\u6307\u5b9a\u7684\u6578\u91cf\u6642\uff0c\u7cfb\u7d71\u6703\u5efa\u7acblog&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>\u901a\u544a\u532f\u6574\u8def\u5f91&nbsp;<\/strong><\/p>\n\n\n\n<p>\u5728ABR\u4e0a\u624b\u52d5\u901a\u544a\u6307\u5b9a\u7684\u532f\u6574\u8def\u5f91\u7d66\u5176\u4ed6OSPF area&nbsp;<br><strong>(config-router)#network &lt; ip&gt; &lt; mask&gt; area &lt; area-id&gt;<\/strong><br><strong>(config-router)#area &lt; area-id&gt; range &lt; ip&gt; &lt; mask&gt; [advertise|not-advertise][cost &lt; cost&gt;]<\/strong><br>[cost] \u624b\u52d5\u6307\u5b9ametric,\u503c\u8d8a\u5c0f\u512a\u5148\u6b0a\u8d8a\u9ad8,\u9810\u8a2d\u4f7f\u7528\u6240\u6709subordinate route(\u6b21\u7d1a\u8def\u5f91)\u4e2d\u6700\u4f4e\u7684\u503c,\u540ceigrp<br>\u4e0d\u6703\u901a\u544asubordinate route,\u56e0\u70ba\u5df2\u7d93\u5305\u542b\u5728\u532f\u6574route\u5167,\u540ceigrp<br>\u5efa\u7acbtype 3 lsa\u532f\u6574\u5916\u90e8\u8def\u5f91<\/p>\n\n\n\n<p>\u5728ASBR\u4e0a\u624b\u52d5\u901a\u544a\u6307\u5b9a\u7684\u532f\u6574\u8def\u5f91\u7d66\u5176\u4ed6OSPF area<br><strong>(config-router)#summary-address &lt; ip&gt; &lt; mask&gt; [not-advertise]<\/strong><br>\u5efa\u7acbtype 5 lsa\u532f\u6574\u5916\u90e8\u8def\u5f91<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..&nbsp;<\/p>\n\n\n\n<p><strong>\u8a2d\u5b9a\u9810\u8a2d\u8def\u5f91<\/strong><br>\u4e3b\u8981\u6709\u5169\u65b9\u6cd5<br>\u4f7f\u7528default-information originate:\u5c07default route\u50b3\u9032\u6574\u500bospf domain&nbsp;<br>\u4f7f\u7528stub area:\u5c07stub area\u5167\u7684\u8cc7\u6599\u6d41\u5c0e\u5411\u5230\u5176\u4ed6area\u88e1\u7684\u5176\u4e2d\u4e00\u500babr<\/p>\n\n\n\n<p><strong>\u8981\u6c42asbr\u5c07default route\u50b3\u9032\u6574\u500bOSPF domain&nbsp;<\/strong><br><strong>ASBR(config-router)#default-information originate [always] [metric &lt; value&gt;] [metric-type &lt; type&gt;] [route-map &lt; map-name&gt;]<br><\/strong>\u5047\u5982asbr\u7684route table\u67090.0.0.0\/0(default route),\u5247\u5c07\u8a72route\u50b3\u64ad\u7d66\u6574\u500bospf domain<br>always:\u8868\u793a\u82e5router\u7684route table\u4e0d\u5b58\u5728default-route\u6642,\u4ecd\u6703\u901a\u544a\u8a72route<br>metric:\u5b9a\u7fa9\u6b0a\u503c,\u9810\u8a2d\u70ba1&nbsp;<br>metric-type:\u5b9a\u7fa9LSA\u70baexternal type1\u6216external type2,\u9810\u8a2d\u70baexternal type2(metric=1\u7684type 5 lsa)<br>route-map:\u652f\u63f4route-map\u4ee5\u6c7a\u5b9a\u5982\u4f55\u901a\u544adefault-route&nbsp;<br>ps:\u53ea\u8981border router\u5230default gateway\u7684\u4ecb\u9762\u9084\u6709\u4f5c\u7528,\u5728OSPF area\u7684\u6240\u6709router\u5c07\u5b78\u7fd2\u9810\u8a2d\u8def\u5f91<\/p>\n\n\n\n<p><strong>\u4f7f\u7528stub area\u8a2d\u5b9a\u9810\u8a2d\u8def\u5f91&nbsp;<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9astub<br><strong>(config-router)# area &lt; area-id&gt; stub<br><\/strong>\u6307\u5b9aarea-id\u70bastub area<br>area\u4e2d\u6bcf\u4e00\u53f0router\u90fd\u8981\u8a2d\u5b9astub\u6307\u4ee4&nbsp;<\/p>\n\n\n\n<p>\u8a2d\u5b9aNSSA<br><strong>(config-router)# area &lt; area-id&gt; nssa<br><\/strong>\u6307\u5b9aarea-id\u70bastub area<br>area\u4e2d\u6bcf\u4e00\u53f0router\u90fd\u8981\u8a2d\u5b9anssa\u6307\u4ee4&nbsp;<br><br>\u555f\u7528totally\u529f\u80fd<br><strong>(config-router)# area &lt; area-id&gt; &lt; stub | nssa&gt; no-summary<\/strong><br>stub:\u8a2d\u5b9a\u70batotally stubby&nbsp;<br>nssa:\u8a2d\u5b9a\u70batotally NSSA&nbsp;<br>area\u4e2d\u6bcf\u4e00\u53f0router\u90fd\u8981\u8a2d\u5b9astub\u6216nssa\u6307\u4ee4,\u4e14ABR\u8981\u591a\u8a2d\u5b9ano-summary\u6307\u4ee4&nbsp;<br>ps:\u6b64\u70bacisco\u5c08\u5c6c\u5340\u57df\u985e\u578b<\/p>\n\n\n\n<p>\u4ee5stub\u8a2d\u5b9a\u9810\u8a2d\u8def\u5f91\u7684\u6b0a\u503c<br><strong>(config-router)# area &lt; area-id&gt; default-metric &lt; metric&gt;<\/strong><br>\u9810\u8a2d\u70ba1,\u6bcf\u500babr\u53ef\u4ee5\u4e0d\u540c<\/p>\n\n\n\n<p>ps:<br>(config-router)#?<br>exit\u3000\u3000 Exit from routing protocol configuration mode<br>network\u3000\u3000 Enable routing on an IP network<br>area\u3000\u3000 OSPF area parameters<br>summary-address\u3000\u3000 Configure IP address summaries<br>redistribute\u3000\u3000 Redistribute information from another routing protocol<br>default-metric\u3000\u3000 Set metric of redistributed routes<br>distribute-list\u3000\u3000 Filter networks in routing updates<br>default-information\u3000\u3000 Control distribution of default information<br>distance\u3000\u3000 Control distribution of default information<br>passive-interface\u3000\u3000 Suppress routing updates on an interface<br>neighbor\u3000\u3000 Specify a neighbor router<br><br>&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p>\u986f\u793aospf\u76f8\u95dc\u8cc7\u8a0a<br><strong>#show ip ospf [process-id]<\/strong><br>\u986f\u793a\u5167\u5bb9\u5305\u62ec\u7d71\u8a08\u8cc7\u8a0a,&#8230;\u7b49<br>\u4ee5show ip ospf\u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Routing Process &#8220;ospf 10&#8221;&nbsp;with ID 24.17.2.2&nbsp;\/\/process-id\u70ba10<br>Supports only single TOS(TOS0) routes<br>It is an area brode router &nbsp;\/\/\u6b64\u70baabr,\u56e0\u9023\u63a5\u4e86area0\u548carea3<br>SPF schedule delay 5 secs, Hold time between two SPFs 10 secs \/\/timer<br>Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs \/\/timer<br>Number of external LSA 0. Checksum Sum 0x0<br>Number of DCbitless external LSA 0<br>Number of DoNotAge external LSA 0<br>Number of areas in this router is 1. 1 normal 0 stub 0 nssa<br>\u3000Area BACKBONE(0)<br>\u3000\u3000Number of interfaces in this area is 1<br>\u3000\u3000Area has no authentication<br>\u3000\u3000SPF algorithm executed 4 times &nbsp;\/\/spf\u57f7\u884c\u7b2c4\u6b21&nbsp;<br>\u3000\u3000Area ranges are<br>\u3000\u3000Number of LSA 3. Checksum Sum 0x2212D<br>\u3000\u3000Number of DCbitless LSA 0<br>\u3000\u3000Number of indication LSA 0<br>\u3000\u3000Number of DoNotAge LSA 0<br>\u3000Area 3&nbsp;<br>\u3000\u3000Number of interfaces in this area is 1<br>\u3000\u3000It is a stub Area, no summary&nbsp;LSA in this area&nbsp;\/\/stub area,\u800c\u4e14no summay\u8868\u793atotally stub area&nbsp;<br>&nbsp;[omit&#8230;]&nbsp;<\/p>\n\n\n\n<p>\u986f\u793aospf\u9023\u7d50\u72c0\u614b\u8cc7\u6599\u5eab\u3000<br><strong>#show ip ospf database [ LSA type] [database-summary]\u3000<\/strong><br>\u986f\u793a\u5167\u5bb9\u5305\u542b\u93c8\u8def\u6578\u76ee,\u8def\u5f91\u985e\u578b,\u62d3\u6a38\u8cc7\u6599\u5eab,&#8230;\u7b49<br>LSA type\u53ef\u9078\u7684\u503c\u6709<br>\u3000router &nbsp;:type1 lsa&nbsp;<br>\u3000network :type2 lsa<br>\u3000summary :type3 lsa &nbsp;<br>\u3000asbr-summary :type4 lsa<br>\u3000external: type5 lsa\u3000&nbsp;<br>\u4e0d\u4f7f\u7528\u53c3\u6578LSA type<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>#show ip ospf database<br>&nbsp;\u3000OSPF Router with ID (9.9.9.9)&nbsp;(Process ID 10)&nbsp;&nbsp; &nbsp; \/\/LSID=9.9.9.9&nbsp;<br>&nbsp;\u3000Router Link States (Area 0)<br>Link ID&nbsp;ADV Router Age Seq# Checksum Link count &nbsp; &nbsp;<br>8.8.8.8&nbsp;8.8.8.8&nbsp;0 0x80000009 0x5461\u3000\u3000\u3000&nbsp;\/\/type1 LSA ID\u70barid8.8.8.8\u7684router,\u8a72area\u4e2d\u5176\u4e2d\u4e00\u53f0router &nbsp;<br>9.9.9.9&nbsp;9.9.9.9 0 0x80000002 0x2007 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/type 1LSA ID\u70barid9.9.9.9\u7684router,\u8a72area\u4e2d\u5176\u4e2d\u4e00\u53f0router&nbsp;<br>\u3000Net Link States (Area 0)\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u5217\u51faarea 0\u5167\u6240\u6709type2 lsa\u7684LSID\u3000\u3000\u3000\u3000<br>Link ID ADV Router Age Seq# Checksum<br>10.10.3.4 7.7.7.7 1104 0x80000001 0x00AB28 \/\/type2 lsa id=10.10.34.4(DR\u7684IP),\u76ee\u524d\u5efa\u7acb\u5728RID7.7.7.7\u7684router &nbsp;<br>\u3000Summary Net Link States (Area 0)\u3000\u3000\u3000\u3000\/\/\u5217\u51faarea 0\u5167\u6240\u6709type3 lsa\u7684LSID&nbsp;<br>Link ID&nbsp;ADV Router Age Seq# Checksum<br>24.17.2.2&nbsp;8.8.8.8 0 0x80000008 0x3562 &nbsp; &nbsp; \/\/\u8a72\u5b50\u7db2\u8def\u7684type3 lsa\u7684LSID=23.17.2.2,\u63db\u53e5\u8a71\u8aaa,\u8981\u5230\u7db2\u8def24.17.2.2\u53ef\u5230RID8.8.8.8\u7684router\u3000<br><strong>[router]<\/strong><br>\u53c3\u6578LSA type\u6307\u5b9arouter,\u50c5\u5217\u51fatype1 lsa\u8cc7\u8a0a<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>#show ip ospf database router 9.9.9.9<br>\u3000OSPF Router with ID (9.9.9.9) (Process ID 5)<br>\u3000\u3000Router Link States (Area 0)<br>LS age: 796<br>Options: (No TOS-capability, DC)<br>LS Type: Router Links<br>Link State ID: 9.9.9.9&nbsp;<br>Advertising Router: 9.9.9.9&nbsp;<br>LS Seq Number: 80000004<br>Checksum: 0x63C3<br>Length: 84<br>Number of Links: 2<br>Link connected to: another Router (point-to-point)\u3000\/\/\u9023\u63a5\u4e00\u500b\u9130\u5c45&nbsp;<br>\u3000(Link ID) Neighboring Router ID: 8.8.8.8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/\u8a72\u9130\u5c45RID\u70ba8.8.8.8<br>\u3000(Link Data) Router Interface address: 10.10.2.5 &nbsp; \/\/router\u4ecb\u9762\u4e0a\u7684IP10.10.2.5\u53ef\u4ee5\u5230RID8.8.8.8&nbsp;<br>\u3000Number of TOS metrics: 0<br>\u3000TOS 0 Metrics: 64<br>Link connected to: a Stub Network\u3000\u3000\u3000\/\/\u9023\u63a5\u4e00\u500bstub network\uff0c\u4e5f\u5c31\u662f\u6c92\u6709\u9078\u51faDR\u7684\u4ecb\u9762&nbsp;<br>\u3000(Link ID) Network\/subnet number: 10.10.2.0<br>\u3000(Link Data) Network Mask: 255.255.255.248\u3000<br>\u3000Number of TOS metrics: 0<br>\u3000TOS 0 Metrics: 64\u3000\u3000<br>Link connected to: a Transit Network \u3000\u3000\/\/\u9023\u63a5\u5230type 2 lsa&nbsp;<br>\u3000(Link ID) Designated Router address: 10.10.3.4 &nbsp;\/\/type2 lsa\u7684LSID\u70ba10.10.3.4<br>\u3000(Link Data) Router Interface address: 10.10.3.4<br>\u3000Number of TOS metrics: 0<br>\u3000TOS 0 Metrics: 1<br><strong>[network]<\/strong><br>\u53c3\u6578LSA type\u6307\u5b9anetwork,\u50c5\u5217\u51fatype2 lsa\u8cc7\u8a0a<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>#show ip ospf database network 10.10.3.4<br>\u3000OSPF Router with ID (9.9.9.9) (Process ID 3)<br>\u3000\u3000Net Link States (Area 34)<br>Routing Bit Set on this LSA<br>LS age: 1161<br>Options: (No TOS-capability, DC)<br>LS Type: Network Links<br>Link State ID: 10.10.3.4 (address of Designated Router)<br>Advertising Router: 7.7.7.7&nbsp;<br>LS Seq Number: 80000001<br>Checksum: 0xAB28<br>Length: 32<br>Network Mask: \/24<br>\u3000Attached Router: 8.8.8.8 &nbsp; &nbsp; \/\/\u76ee\u524d\u9023\u63a5\u7684RID\u70ba8.8.8.8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>\u3000Attached Router: 9.9.9.9\u3000<br><strong>[summary]<\/strong><br>\u53c3\u6578LSA type\u6307\u5b9asummary,\u50c5\u5217\u51fatype 3 lsa\u8cc7\u8a0a&nbsp;<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br># show ip ospf database summary 24.17.2.0<br>\u3000OSPF Router with ID (9.9.9.9) (Process ID 3)<br>\u3000\u3000Summary Net Link States (Area 34)<br>Routing Bit Set on this LSA<br>LS age: 1062<br>Options: (No TOS-capability, DC, Upward)<br>LS Type: Summary Links(Network)<br>Link State ID: 24.17.2.0 (summary Network Number) \/\/\u76ee\u5730\u7db2\u8def\u70ba24.17.2.0,type3 lsa\u7684LSID=24.17.2.0\u3000\u3000<br>Advertising Router: 7.7.7.7&nbsp;&nbsp; \/\/\u5ba3\u544atyp3 lsa\u7684ABR\u7684RID\u70ba7.7.7.7 &nbsp;<br>LS Seq Number: 80000002<br>Checksum: 0x3D81<br>Length: 28<br>Network Mask: \/24 \u3000\u3000\u3000\u3000\/\/\u76ee\u5730\u7db2\u8defmask\u70ba24&nbsp;<br>\u3000TOS: 0 Metric: 2<br><strong>[asbr-summary]<\/strong><br>\u53c3\u6578LSA type\u6307\u5b9aasbr-summary,\u50c5\u5217\u51fatype 4 lsa\u8cc7\u8a0a<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br># show ip ospf database asbr-summary<br>\u3000\u3000OSPF Router with ID (5.5.5.5) (Process ID 5)<br>\u3000\u3000\u3000Summary ASB Link States (Area 1)<br>\u3000Routing Bit Set on this LSA<br>LS age: 984<br>Options: (No TOS-capability, DC, Upward)<br>LS Type: Summary Links(AS Boundary Router)<br>Link State ID: 1.1.1.1 (AS Boundary Router address) &nbsp;\/\/type4 lsa\u7684LSID=ASBR\u7684rid<br>Advertising Router: 3.3.3.3 &nbsp; \/\/\u7531abr(rid=3.3.3.3)\u767c\u51fatype4 lsa<br>LS Seq Number: 8000000D<br>Checksum: 0xE43A<br>Length: 28<br>Network Mask: \/0<br>\u3000\u3000TOS: 0 Metric: 1\u3000\u3000\/\/\u8a72\u5340\u57df\u7684abr\u5230asbr\u7684\u6210\u672c\u70ba1&nbsp;<br>LS age: 1072<br>Options: (No TOS-capability, DC, Upward)<br>LS Type: Summary Links(AS Boundary Router)<br>Link State ID: 1.1.1.1 (AS Boundary Router address)<br>Advertising Router: 4.4.4.4<br>LS Seq Number: 8000000B<br>Checksum: 0x439A<br>Length: 28<br>Network Mask: \/0<br>\u3000\u3000TOS: 0 Metric: 64 &nbsp;\/\/\u8a72\u5340\u57df\u7684abr\u5230asbr\u7684\u6210\u672c\u70ba64&nbsp;<br><strong>[database-summary]<\/strong><br>\u53c3\u6578\u4f7f\u7528database-summary<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b\u3000<br># show ip ospf database database-summary<br>\u3000OSPF Router with ID (1.1.1.1) (Process ID 2)<br>Area 3 database summary<br>\u3000LSA Type Count Delete Maxage<br>\u3000Router 4 0 0<br>\u3000Network 1 0 0<br>\u3000Summary Net 24 0 0<br>\u3000Summary ASBR 0 0 0<br>\u3000Type-7 Ext 0 0 0<br>\u3000\u3000Prefixes redistributed in Type-7 0<br>\u3000Opaque Link 0 0 0<br>\u3000Opaque Area 0 0 0<br>\u3000Subtotal 29 0 0<br>Process 2 database summary<br>\u3000LSA Type Count Delete Maxage<br>\u3000Router 4 0 0<br>\u3000Network 1 0 0<br>\u3000Summary Net 24 0 0<br>\u3000Summary ASBR 0 0 0<br>\u3000Type-7 Ext 0 0 0<br>\u3000Opaque Link 0 0 0<br>\u3000Opaque Area 0 0 0<br>\u3000Type-5 Ext 0 0 0<br>\u3000\u3000Prefixes redistributed in Type-5 0<br>\u3000Opaque AS 0 0 0<br>\u3000Non-self 28<br>\u3000Total 29 0 0\u3000<\/p>\n\n\n\n<p>\u986f\u793aospf\u4ecb\u9762\u8cc7\u8a0a<br><strong>#show ip ospf interface<\/strong><strong>&nbsp;[interface] [brief]\u3000<\/strong><br>\u4ee5eth0\u4ecb\u9762\u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Ethernet0 is up, line protocol is up<br>Internet Address 24.17.2.2\/28 , Area 0 \/\/\u8a72\u4ecb\u9762\u5728area 0<br>Process ID 10,&nbsp;Router ID 24.17.2.2, Network Type DR, Cost: 10&nbsp;\/\/\u81ea\u5df1\u7684rid\u662f24.17.2.2<br>Transmit Delay is 1 sec, State DR,&nbsp;Priority 1 \/\/\u512a\u5148\u6b0a\u70ba1\u8868\u793a\u6703\u53c3\u8207dr\u9078\u64c7.\u76ee\u524d\u72c0\u614b\u662fDR<br>Designated Router (ID) 24.17.2.2, Interface address 24.17.2.2 \/\/dr\u8cc7\u8a0a<br>Backup Designated router (ID) 24.17.2.1, Interface address 24.17.2.1 \/\/bdr\u8cc7\u8a0a<br>Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 \/\/\u5169\u8def\u7531\u5668\u7684\u6642\u9593\u53c3\u6578\u9700\u76f8\u540c\u624d\u53ef\u4e92\u901a<br>Hello due in 00:00:02<br>Neighbor Count is 1, Adjacent neighbor count is 1<br>Adjacent with neighbor 24.17.2.1(Backup Designated Router)<br>Suppress hello for 0 neighbor(s)<br>Message digest authentication enabled \u3000\/\/\u8a72\u4ecb\u9762\u4f7f\u7528MD5\u505a\u9130\u5c45\u9a57\u8b49\u3000<br>\u3000Youngest key id is 1<br>[brief]<br>\u4f7f\u7528\u53c3\u6578brief<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br># show ip ospf interface brief<br>Interface PID Area IP Address\/Mask Cost&nbsp;State&nbsp;Nbrs F\/C&nbsp;\/\/\u6240\u5217\u51fa\u7684\u4ecb\u9762\u90fd\u4e0d\u662fpassive interface&nbsp;<br>Fe0\/0 2 0 10.1.2.2\/30 64 P2P 1\/1<br>Fa0\/1 2 0 10.1.1.2\/25 1 DR 0\/0<br>Fe0\/2 2 1 10.1.1.1\/30 64 P2P 1\/1 &nbsp;\/\/\u8a72\u4ecb\u9762\u5728area 1&nbsp;<\/p>\n\n\n\n<p>\u986f\u793aospf\u9130\u5c45\u8cc7\u8a0a<br><strong>#show ip ospf neighbor [detail]<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Neighbor ID Pri&nbsp;State&nbsp;Dead Time&nbsp;Address Interface&nbsp;\/\/state\u6703\u986f\u793aospf link state<br>24.17.2.17 3&nbsp;FULL\/DR&nbsp;05:12:40 24.17.2.17 Serial0 &nbsp; \/\/\u672c\u5730serial0\u4ecb\u9762\u9023\u5230\u9130\u5c45ip24.17.2.17<br>24.17.2.18 1 2WAY\/DROTHER 05:12:40 24.17.2.18 Ethernet0\u3000 \/\/2way\u9130\u5c45\u95dc\u4fc2,\u4e0d\u6703\u4ea4\u63dbtopology\u8cc7\u6599&nbsp;<br>24.17.1.17 2&nbsp;FULL\/BDR&nbsp;05:12:40 24.17.1.17 Serial1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>24.17.1.18 3&nbsp;FULL\/DR&nbsp;05:12:40 24.17.1.18 Ethernet1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/full\u9130\u5c45\u95dc\u4fc2,\u6703\u4ea4\u63dbtopology\u8cc7\u6599&nbsp;<br>ps:\u51fa\u73fe\u591a\u500bdr\u53ef\u80fd\u662f\u9023\u7d50\u591a\u500bas<br>ps:FULL\/DOTHER \u8868\u793a\u5728\u7121DR\u7684\u74b0\u5883\u4e0b,\u548cDOTHER\u4ea4\u63dbLSDB\u800c\u9054\u5230FULL\u72c0\u614b<br>ps:FULL\/DR \u8868\u793a\u5728DR\u74b0\u5883\u4e0b,\u548cDR\u4ea4\u63dbLSDB\u800c\u9054\u5230FULL\u72c0\u614b<br>[detail]<br>\u52a0detail\u5f8c\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Neighbor 24.17.2.17, interface address 24.17.2.17<br>\u3000In the area 10 via interface Serial0<br>\u3000Neighbor priority is 1, State is FULL, 6 state changes<br>\u3000DR is 0.0.0.0 BDR is 0.0.0.0 \/\/dr\u548cbdr\u8cc7\u8a0a<br>\u3000Options 2<br>\u3000Dead timer due in<\/p>\n\n\n\n<p>\u986f\u793aospf\u8def\u7531\u8868\u9032\u5165abr\u7684\u8cc7\u8a0a\uff0c\u6216\u986f\u793aabr\u8cc7\u8a0a<br><strong>#show ip ospf border-routers<br><\/strong>\u5728internal router,\u986f\u793arouter\u62b5\u9054ASBR\u7684best cost<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>OSPF Process 4 internal Routing Table<br>Codes: i &#8211; Intra-area route, I &#8211; Inter-area route &nbsp;&nbsp;\/\/\u4ee5\u4e0b\u5217\u51farouter\u77e5\u9053\u7684abr\u548casbr&nbsp;<br>I 1.1.1.1 [64] via 172.16.14.1, Serial0\/0\/0, ASBR, Area 0, SPF 16 \/\/\u7531rid1.1.1.1(ASBR)\u516c\u544a\u5230\u9054\u8a72ASBR\u6703\u7d93\u904e172.16.14.1 &nbsp;&nbsp;<br>i 3.3.3.3 [65] via 172.16.14.1, Serial0\/0\/0, ABR, Area 0, SPF 16 &nbsp;\/\/\u7531rid3.3.3.3(abr)\u516c\u544a\u5230\u9054\u8a72ABR\u6703\u7d93\u904e172.16.14.1&nbsp;<br>i 3.3.3.3 [128] via 172.16.45.5, Serial0\/0\/1, ABR, Area 1, SPF 8 &nbsp; \/\/\u8a72\u4ecb\u9762\u70baarea 1<\/p>\n\n\n\n<p>\u986f\u793aospf\u76f8\u95dc\u8cc7\u8a0a<br><strong>#show ip protocols<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Routing Protocol is &#8220;ospf 10&#8221; \/\/\u4f7f\u7528process-id\u70ba10<br>Sending updates every 90 seconds, next due in 10 seconds<br>Invalid after 30 seconds, hold down 0, flushed after 60<br>Outgoing update filter list for all interfaces is not set \/\/filter\u672a\u8a2d\u5b9a<br>Incoming update filter list for all interfaces is not set<br>Redistributing: ospf 10<br>Routing for Networks:<br>\u300024.0.0.0 0.255.255.255 area 0 &nbsp; &nbsp;\/\/\u6b63\u5728\u4ea4\u63db24.0.0.0\/8\u7684\u7db2\u8def,\u5177area\u70ba0&nbsp;<br>Routing on Interfaces Configured Explicitly (Area 0):<br>\u3000Serial0\/1 \u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u6307\u5b9a\u4ecb\u9762s0\/1\u4ea4\u63dbOSPF\u8cc7\u8a0a&nbsp;<br>Reference bandwidth unit is 100 mbps<br>Passive Interface(s):<br>\u3000FastEthernet0\/0 \u3000\u3000\u3000\u3000\u3000\u3000\u3000\/\/fa0\/0\u70ba\u88ab\u52d5\u4ecb\u9762\u3000<br>\u3000FastEthernet0\/1<br>Routing Information Sources:<br>\u3000Gateway Distance Last Update<br>\u300024.17.2.18 110 00:00:06 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/\u63a5\u6536RID\u70ba24.17.2.18\u7684router\u7684\u8cc7\u8a0a&nbsp;<br>\u300024.17.2.18 110 00:00:06<br>Distance: (default is 110)<\/p>\n\n\n\n<p>\u986f\u793aospf\u8def\u7531\u8868<br><strong>#show ip route<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Codes: C &#8211; connected, S &#8211; static, I &#8211; IGRP, R &#8211; RIP, M &#8211; mobile, B &#8211; BGP<br>\u3000D &#8211; EIGRP, EX &#8211; EIGRP external,&nbsp;O &#8211; OSPF,&nbsp;IA &#8211; OSPF inter area<br>\u3000E1 &#8211; OSPF external type 1,&nbsp;E2 &#8211; OSPF external type 2, E &#8211; EGP<br>\u3000i &#8211; IS-IS, L1 &#8211; IS-IS level-1, L2 &#8211; IS-IS level-2, * &#8211; candidate default<br>\u3000U &#8211; per-user static route<br>C 24.17.2.16 is directly connected, Serial0<br>O 24.17.2.0 [110\/64] via 24.17.2.1, 00:00:50, Serial0<br>O IA 24.17.3.0 [110\/64] via 24.17.3.1, 00:00:50, Serial1 &nbsp;\/\/OSPF interarea\u8def\u5f91<\/p>\n\n\n\n<p><strong>#debug ip ospf &lt; act&gt;<\/strong><br>act\u6709\u4ee5\u4e0b<br>adj&nbsp;\u770bospf\u7684dr\u548cbdr\u9078\u53d6\uff0c\u4e5f\u53ef\u770bospf\u9130\u5c45\u9a57\u8b49\u7684\u904e\u7a0b<br>events \u986f\u793a\u76f8\u9130\u95dc\u4fc2,flooding\u8cc7\u8a0a,dr\u9078\u8209,spf\u8a08\u7b97<br>packet \u986f\u793a\u6bcf\u500b\u6536\u5230\u7684ospf\u5c01\u5305<\/p>\n\n\n\n<p><strong>timer\u4e0d\u4e00\u81f4\u6703\u7522\u751f\u5982\u4e0b\u8a0a\u606f<\/strong><br>*Apr 11 00:07:51.511: %OSPF-5-ADJCHG: Process 4, Nbr 1.1.1.1 on FastEthernet0\/0<br>from 2WAY to DOWN, Neighbor Down: Dead timer expired<br>*Apr 11 00:07:57.624: %OSPF-5-ADJCHG: Process 4, Nbr 3.3.3.3 on FastEthernet0\/0<br>from FULL to DOWN, Neighbor Down: Dead timer expired<br>*Apr 11 00:07:58.395: %OSPF-5-ADJCHG: Process 4, Nbr 2.2.2.2 on FastEthernet0\/0<br>from FULL to DOWN, Neighbor Down: Dead timer expired<\/p>\n\n\n\n<p><strong>IP MTU\u4e0d\u4e00\u81f4\u6703\u7522\u751f\u5982\u4e0b\u8a0a\u606f<\/strong><br>*Apr 11 13:36:00.252: %OSPF-5-ADJCHG: Process 4, Nbr 2.2.2.2 on FastEthernet0\/0<br>from EXSTART to DOWN, Neighbor Down: Too many retransmissions&nbsp;<\/p>\n\n\n\n<p><strong>\u7576\u5169\u908a\u4e4b\u9593\u53ea\u6709\u4e00\u908a\u4ecb\u9762\u555f\u7528type1\u660e\u6587\u8a8d\u8b49(\u57f7\u884cip ospf authentication) &nbsp;<\/strong><br>*Apr 11 00:30:35: OSPF: Rcv pkt from 10.1.1.2, Serial1\/1 : Mismatch Authentication type. Input packet specified type 0, we use type 1<br>*Apr 11 00:54:45: OSPF: Rcv pkt from 10.1.1.2, Serial1\/1 : Mismatch Authentication Key &#8211; Clear Text<\/p>\n\n\n\n<p><strong>hello timer\u548cdead timer\u4e0d\u4e00\u81f4&nbsp;<\/strong><br>r1#<br>2w5d: OSPF: Rcv hello from 10.8.7.1 area 0.0.0.0 from Ethernet0\/0 10.8.1.2<br>2w5d: OSPF: Mismatched hello parameters from 10.8.1.2<br>2w5d: Dead R 40 C 120, Hello R 10 C 30 Mask R 255.255.255.0 C 255.255.255.0&nbsp;<br>r1\u7684dead timer\u662f120sec,hello timer\u662f30sec<br>\u53e6\u4e00\u908a\u662fdead timer\u662f40sec,hello timer\u662f10sec<br><br><strong>area\u4e0d\u4e00\u81f4<\/strong><br>05:13:16: OSPF: Rev pkt from 10.1.1.2, Ethernet0\/1, area 0.0.0.1 mismatch area 0.0.0.2 in the header<br>05:13:19: OSPF: Rev hello from 10.10.10.3 area 0 from Ethernet0\/0 10.2.0.2<br>05:13:19: OSPF: End of hello processing<br>\u4ecb\u9762ethernet0\/1\u8a2d\u5b9aarea 1,\u4f46\u53e6\u4e00\u908a\u8a2d\u5b9aarea2,\u9020\u6210area\u4e0d\u4e00\u81f4<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>\u5728abr\u4e0a\u8a2d\u5b9avirtual-link(\u865b\u64ec\u93c8\u8def)<\/strong><br>r1(config)# router ospf &lt; transit area&gt;<br>r1(config-router)# area &lt; transit area&gt; virtual-link &lt; r2-rid&gt;<br>r2(config)# router ospf &lt; transit area&gt;<br>r2(config-router)# area &lt; transit area&gt; virtual-link &lt; r1-rid&gt;<br>ps:<br>r1 ping virtual-link\u547d\u4ee4\u4e2d\u7684r2-rid\u6703\u5931\u6557,\u4f46virtual-link\u662f\u6b63\u5e38\u7684<br>ex:<br>\u5728area2\u7684r1(5.5.5.5)\u53car2(3.3.3.3)\u4e4b\u9593\u5efa\u7acbvirtual-link<br>r1(config)# router ospf 2<br>r1(config-router)# area 2 virtual-link 3.3.3.3<br>r2(config)# router ospf 2<br>r2(config-router)# area 2 virtual-link 5.5.5.5&nbsp;<\/p>\n\n\n\n<p>\u986f\u793a\u5728ospf\u865b\u64ec\u9023\u7d50\u7684\u53c3\u6578<br><strong>#show ip ospf virtual-links<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b\u3000<br>Virtual Link OSPF_VL0 to router 3.3.3.3 is up&nbsp;\/\/\u6307\u6d3e\u7684\u93c8\u8def\u53e6\u4e00\u908aABR\u7684rid\u70ba3.3.3.3,\u4e00\u6a23\u4f7f\u7528type 1 lsa<br>\u3000Run as demand circuit<br>\u3000DoNotAge LSA allowed. \/\/\u5169\u908a\u90fd\u652f\u63f4DNA<br>\u3000Transit area 2, via interface FastEthernet0\/1,&nbsp;Cost of using 4 \/\/\u4ecb\u9762\u6210\u672c\u4e0d\u662f4,\u800c\u662f\u6703\u7d93\u904e4\u500b\u4ecb\u9762\u624d\u6703\u5230\u53e6\u4e00\u908aABR<br>\u3000Transmit Delay is 1 sec, State POINT_TO_POINT,<br>\u3000Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5<br>\u3000\u3000Hello due in 00:00:02<br>\u3000\u3000Adjacency State FULL (Hello suppressed) \/\/\u76ee\u524d\u70ba\u5b8c\u5168\u76f8\u9130\u72c0\u614b,\u4e26\u505c\u6b62\u767c\u9001HELLO\u5c01\u5305<br>\u3000\u3000Index 1\/2, retransmission queue length 0, number of retransmission 0<br>\u3000\u3000First 0x0(0)\/0x0(0) Next 0x0(0)\/0x0(0)<br>\u3000\u3000Last retransmission scan length is 0, maximum is 0<br>\u3000\u3000Last retransmission scan time is 0 msec, maximum is 0 msec&nbsp;<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>OSPF IPv6&nbsp;<\/strong><\/p>\n\n\n\n<p>\u555f\u7528OSPFv3<br><strong>(config)# ipv6 router ospf &lt; process-id&gt;<\/strong><br>ps:\u904b\u4f5cospfv3\u524d,ipv6 unicast-routing\u6307\u4ee4\u9700\u8981\u88ab\u57f7\u884c<br><strong>(config-if)# ipv6 ospf &lt; process-id&gt; area &lt; as&gt;<\/strong><br>ps:\u4ecb\u9762\u555f\u7528ipv6 ospf\u524d,\u4ecb\u9762\u9700\u5148\u555f\u7528ipv6<br>ps:<br>\u904b\u4f5c\u6642\u8981\u6709ospf rid,\u9810\u8a2d\u5728\u6709ipv4\u4f4d\u5740\u7684\u60c5\u6cc1\u4e0b\u6703\u81ea\u52d5\u9078\u51fa, &nbsp;<br>\u82e5\u7121ipv4\u4f4d\u5740,\u5247\u4e0d\u6703\u81ea\u52d5\u9078\u51fa,\u9700\u4ee5\u6307\u4ee4router-id\u624b\u52d5\u6307\u6d3erid<br>ps:<br>\u8a72\u4ecb\u9762\u6240\u6709IPv6\u4f4d\u5740\u90fd\u6703\u53c3\u8207ospf,\u800c\u4e14\u4e0d\u80fd\u9078\u64c7\u90a3\u4e9b\u4f4d\u5740\u4e0d\u53c3\u8207<\/p>\n\n\n\n<p>ps:<br>#clear ipv6 ospf process<br>ospf database\u91cd\u5efa\uff0c\u4e26\u57f7\u884cSPF\u6f14\u7b97\u6cd5<\/p>\n\n\n\n<p><br>\u6aa2\u9a57\u72c0\u614b\u76f8\u95dc\u6307\u4ee4<br>#show ipv6 router ospf<\/p>\n\n\n\n<p><strong>#show ipv6 ospf<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Routing Process&nbsp;&#8220;ospfv3 1&#8221;&nbsp;with ID 10.10.10.1\u3000\/\/ospfv3\u8868\u793a\u652f\u63f4ipv6\u7684\u7248\u672c &nbsp;<br>SPF schedule delay 5 secs, Hold time between two SPFs 10 secs<br>Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs<br>LSA group pacing timer 240 secs<br>Interface flood pacing timer 33 msecs<br>Retransmission pacing timer 66 msecs<br>Number of external LSA 0. Checksum Sum 0x000000<br>Number of areas in this router is 1. 1 normal 0 stub 0 nssa<br>\u3000Area BACKBONE(0)<br>\u3000\u3000Number of interfaces in this area is 1<br>\u3000\u3000MD5 Authentication, SPI 1000<br>\u3000\u3000SPF algorithm executed 2 times<br>\u3000\u3000Number of LSA 5. Checksum Sum 0x02A005<br>\u3000\u3000Number of DCbitless LSA 0<br>\u3000\u3000Number of indication LSA 0<br>\u3000\u3000Number of DoNotAge LSA 0<br>\u3000\u3000Flood list length 0<\/p>\n\n\n\n<p><strong># show ipv6 ospf neighbor<\/strong><br>Neighbor ID Pri State Dead Time Interface ID Interface<br>2.2.2.2 1 FULL\/ &#8211; 00:00:36 19 Serial0\/0\/0.2<br>1.1.1.1 1 FULL\/ &#8211; 00:00:35 19 Serial0\/0\/0.1<br>4.4.4.4 1 FULL\/DR 00:00:34 3<br>ps:<br>\u8207show ip ospf neighbor\u4e0d\u540c\u7684\u662f\uff0c\u9130\u5c45\u5f9eaddress\u8b8a\u70bainterface id<br># show ip ospf neighbor<br>Neighbor ID Pri State Dead Time Address Interface<br>2.2.2.2 0 FULL\/ &#8211; 00:00:31 10.10.23.2 Serial0\/0\/0.2<br>1.1.1.1 0 FULL\/ &#8211; 00:00:31 10.10.13.1 Serial0\/0\/0.1<br>4.4.4.4 1 FULL\/DR 00:00:39 10.10.34.4<\/p>\n\n\n\n<p><strong># show ipv6 ospf database router adv-router 3.3.3.3<\/strong><br>\u3000OSPFv3 Router with ID (3.3.3.3) (Process ID 5)<br>\u3000\u3000Router Link States (Area 34)<br>LS age: 996<br>Options: (V6-Bit, E-Bit, R-bit, DC-Bit)<br>LS Type: Router Links<br>Link State ID: 0<br>Advertising Router: 3.3.3.3<br>LS Seq Number: 80000007<br>Checksum: 0xDC04<br>Length: 72<br>Number of Links: 3<br>\u3000Link connected to: another Router (point-to-point)<br>\u3000\u3000Link Metric: 64<br>\u3000\u3000Local Interface ID: 17 \/\/\u4f7f\u7528\u4ecb\u9762id,\u800c\u975e\u4f7f\u7528\u9130\u5c45ip<br>\u3000\u3000Neighbor Interface ID: 19<br>\u3000\u3000Neighbor Router ID: 2.2.2.2<br>\u3000Link connected to: another Router (point-to-point)<br>\u3000\u3000Link Metric: 64<br>\u3000\u3000Local Interface ID: 16<br>\u3000\u3000Neighbor Interface ID: 19<br>\u3000\u3000Neighbor Router ID: 1.1.1.1<br>\u3000Link connected to: a Transit Network<br>\u3000\u3000Link Metric: 1<br>\u3000\u3000Local Interface ID: 3<br>\u3000\u3000Neighbor (DR) Interface ID: 3<br>\u3000\u3000Neighbor (DR) Router ID: 4.4.4.4<\/p>\n\n\n\n<p><strong># show ipv6 ospf interface brief<\/strong><br>Interface PID Area Intf ID Cost State Nbrs F\/C\u3000\u3000\u3000\/\/\u539fospfv2\u7684\u9130\u5c45ip,\u5728ospfv3\u90fd\u4ee5interface id(Intf ID)\u4ee3\u66ff<br>Se0\/0\/0.1 1 34 19 64 P2P 1\/1<br>Se0\/0\/0.2 1 34 19 64 P2P 1\/1<br>Fa0\/0 1 34 3 1 BDR 1\/1<br>ps:\u8a72\u6307\u4ee4\u6bd4show ip protocol\u8f38\u51fa\u7684\u8cc7\u8a0a\u5c11<\/p>\n\n\n\n<p><strong># show ipv6 ospf interface<\/strong><br>FastEthernet0\/0 is up, line protocol is up<br>\u3000Link Local Address 2001:0DB1:205:5FFF:FED3:5808, Interface ID 3\u3000<br>\u3000Area 1, Process ID 1, Instance ID 0, Router ID 172.16.3.3\u3000\u3000\/\/\u8a72\u4ecb\u9762\u88ab\u57f7\u884cipv6 ospf 1 area 1<br>\u3000Network Type BROADCAST, Cost: 1<br>\u3000Transmit Delay is 1 sec, State BDR, Priority 1&nbsp;\/\/\u8a72\u4ecb\u9762\u5c6c\u65bcbdr \u3000<br>\u3000Designated Router (ID) 172.16.6.6, local address 2001:0DB1:205:5FFF:FED3:6408\u3000\/\/dr\u4f4d\u7f6e\u3000<br>\u3000Backup Designated router (ID) 172.16.3.3, local address 2001:0DB1:205:5FFF:FED3:5808\u3000\/\/bdr\u7684\u4f4d\u7f6e\u3000<br>\u3000Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5<br>\u3000\u3000Hello due in 00:00:05<br>\u3000Index 1\/1\/1, flood queue length 0<br>\u3000Next 0x0(0)\/0x0(0)\/0x0(0)<br>\u3000Last flood scan length is 12, maximum is 12<br>\u3000Last flood scan time is 0 msec, maximum is 0 msec<br>\u3000Neighbor Count is 1, Adjacent neighbor count is 1<br>\u3000\u3000Adjacent with neighbor 172.16.6.6 (Designated Router)<br>\u3000Suppress hello for 0 neighbor(s)&nbsp;<strong># show ipv6 protocols<\/strong><br>IPv6 Routing Protocol is &#8220;connected&#8221;\u3000<br>IPv6 Routing Protocol is &#8220;ospf 1&#8243;\u3000\u3000\u3000\/\/\u4f7f\u7528ospfv3,process id=1<br>\u3000Interfaces (Area 34):&nbsp;<br>\u3000\u3000Serial0\/0\/0.1<br>\u3000\u3000Serial0\/0\/0.2<br>\u3000\u3000FastEthernet0\/0<br>\u3000Redistribution:<br>\u3000\u3000None<\/p>\n\n\n\n<p>ps:\u8a72\u6307\u4ee4\u6bd4show ip protocol\u8f38\u51fa\u7684\u8cc7\u8a0a\u5c11\u3000<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u555f\u7528ospf(config)#router ospf &#038;lt &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[33],"tags":[],"class_list":["post-922","post","type-post","status-publish","format-standard","hentry","category-cisco-layer3"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=922"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/922\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}