{"id":547,"date":"2025-12-10T10:20:36","date_gmt":"2025-12-10T02:20:36","guid":{"rendered":"https:\/\/www.axeuh.com\/?p=547"},"modified":"2025-12-10T11:15:56","modified_gmt":"2025-12-10T03:15:56","slug":"ospf%e5%a4%9a%e5%8c%ba%e5%9f%9f","status":"publish","type":"post","link":"https:\/\/www.axeuh.com\/index.php\/2025\/12\/10\/ospf%e5%a4%9a%e5%8c%ba%e5%9f%9f\/","title":{"rendered":"OSPF\u591a\u533a\u57df"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/f35032f3f990d7fb519441b33857a054.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"286\" data-original=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/f35032f3f990d7fb519441b33857a054.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-548\" style=\"aspect-ratio:2.4371005031959743;width:840px;height:auto\"  sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/div><\/figure>\n<\/div>\n\n\n<p>\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u914d\u7f6e\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7f51\u7edc\u62d3\u6251\u603b\u7ed3\uff1a<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>RA<\/strong> (Area 0): f0\/0(192.35.1.1) \u2194 <strong>RB<\/strong> f0\/0(192.35.1.2) (Area 0)<\/li>\n\n\n\n<li><strong>RB<\/strong> (Area 0 \u548c Area 2): f0\/1(192.35.2.1) \u2194 <strong>RC<\/strong> f0\/1(192.35.2.2) (Area 2)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">OSPF\u914d\u7f6e\uff1a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">RA \u914d\u7f6e\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>RA(config)# router ospf 1\nRA(config-router)# router-id 1.1.1.1\nRA(config-router)# network 172.16.1.1 0.0.0.0 area 1\nRA(config-router)# network 172.16.2.1 0.0.0.0 area 1\nRA(config-router)# network 192.35.1.1 0.0.0.0 area 0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">RB \u914d\u7f6e\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>RB(config)# router ospf 1\nRB(config-router)# router-id 2.2.2.2\nRB(config-router)# network 172.17.1.1 0.0.0.0 area 1\nRB(config-router)# network 172.17.2.1 0.0.0.0 area 1\nRB(config-router)# network 192.35.1.2 0.0.0.0 area 0\nRB(config-router)# network 192.35.2.1 0.0.0.0 area 2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">RC \u914d\u7f6e\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>RC(config)# router ospf 1\nRC(config-router)# router-id 3.3.3.3\nRC(config-router)# network 172.18.1.1 0.0.0.0 area 2\nRC(config-router)# network 172.18.2.1 0.0.0.0 area 2\nRC(config-router)# network 192.35.2.2 0.0.0.0 area 2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5b8c\u6574\u914d\u7f6e\u793a\u4f8b\uff1a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">RA\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>en\nconf t\n\nh RA\n\ninterface Loopback0\n ip address 172.16.1.1 255.255.255.255\n\ninterface Loopback1\n ip address 172.16.2.1 255.255.255.255\n\ninterface FastEthernet0\/0\n ip address 192.35.1.1 255.255.255.0\n no shutdown\n\nrouter ospf 1\n router-id 1.1.1.1\n network 172.16.1.1 0.0.0.0 area 1\n network 172.16.2.1 0.0.0.0 area 1\n network 192.35.1.1 0.0.0.0 area 0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">RB\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>en\nconf  t\n\nh RB\n\ninterface Loopback0\n ip address 172.17.1.1 255.255.255.255\n\ninterface Loopback1\n ip address 172.17.2.1 255.255.255.255\n\ninterface FastEthernet0\/0\n ip address 192.35.1.2 255.255.255.0\n no shutdown\n\ninterface FastEthernet0\/1\n ip address 192.35.2.1 255.255.255.0\n no shutdown\n\nrouter ospf 1\n router-id 2.2.2.2\n network 172.17.1.1 0.0.0.0 area 1\n network 172.17.2.1 0.0.0.0 area 1\n network 192.35.1.2 0.0.0.0 area 0\n network 192.35.2.1 0.0.0.0 area 2<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">RC\uff1a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>en\nconf  t\n\nh RC\n\ninterface Loopback0\n ip address 172.18.1.1 255.255.255.255\n\ninterface Loopback1\n ip address 172.18.2.1 255.255.255.255\n\ninterface FastEthernet0\/1\n ip address 192.35.2.2 255.255.255.0\n no shutdown\n\nrouter ospf 1\n router-id 3.3.3.3\n network 172.18.1.1 0.0.0.0 area 2\n network 172.18.2.1 0.0.0.0 area 2\n network 192.35.2.2 0.0.0.0 area 2<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u9a8c\u8bc1\u547d\u4ee4\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5728\u6bcf\u53f0\u8def\u7531\u5668\u4e0a\u6267\u884c\uff1a\nshow ip ospf neighbor      # \u67e5\u770bOSPF\u90bb\u5c45\u72b6\u6001\nshow ip route              # \u67e5\u770b\u8def\u7531\u8868\nshow ip ospf interface     # \u67e5\u770bOSPF\u63a5\u53e3\u4fe1\u606f\nshow ip ospf database      # \u67e5\u770bOSPF\u6570\u636e\u5e93\n\n# \u5728RB\u4e0a\u6267\u884c\uff08\u4f5c\u4e3aABR\uff09\uff1a\nshow ip ospf border-routers  # \u67e5\u770bABR\u4fe1\u606f<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6ce8\u610f\u4e8b\u9879\uff1a<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>RB\u662fABR\uff08\u533a\u57df\u8fb9\u754c\u8def\u7531\u5668\uff09<\/strong>\uff0c\u8fde\u63a5Area 0\u548cArea 2<\/li>\n\n\n\n<li><strong>\u6240\u6709Loopback\u63a5\u53e3\u90fd\u914d\u7f6e\u4e3a\/32\u63a9\u7801<\/strong>\uff0c\u8fd9\u662f\u6700\u4f73\u5b9e\u8df5<\/li>\n\n\n\n<li><strong>Area 0\u662f\u9aa8\u5e72\u533a\u57df<\/strong>\uff0c\u6240\u6709\u5176\u4ed6\u533a\u57df\u5fc5\u987b\u76f4\u63a5\u8fde\u63a5\u5230Area 0<\/li>\n\n\n\n<li>\u4f7f\u7528<code>network<\/code>\u547d\u4ee4\u65f6\uff0c<code>0.0.0.0<\/code>\u901a\u914d\u7b26\u63a9\u7801\u8868\u793a\u7cbe\u786e\u5339\u914d\u8be5IP\u5730\u5740<\/li>\n<\/ol>\n\n\n\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6240\u6709\u8def\u7531\u5668\u5e94\u8be5\u80fd\u4e92\u76f8\u5b66\u4e60\u5230\u6240\u6709\u7f51\u7edc\u7684\u8def\u7531\u4fe1\u606f\u3002<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-70cab0e6-2dcc-4805-ad8c-cf94374eadef\" href=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/OSPF\u591a\u533a\u57df.zip\">OSPF\u591a\u533a\u57df<\/a><a href=\"https:\/\/www.axeuh.com\/wp-content\/uploads\/2025\/12\/OSPF\u591a\u533a\u57df.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-70cab0e6-2dcc-4805-ad8c-cf94374eadef\">\u4e0b\u8f7d<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u914d\u7f6e\u6b65\u9aa4\uff1a \u7f51\u7edc\u62d3\u6251\u603b\u7ed3\uff1a OSPF\u914d\u7f6e\uff1a RA \u914d\u7f6e\uff1a RB \u914d\u7f6e\uff1a RC \u914d\u7f6e\uff1a \u5b8c\u6574\u914d\u7f6e\u793a\u4f8b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[16],"tags":[17],"class_list":["post-547","post","type-post","status-publish","format-standard","hentry","category-16","tag-17"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/547","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/comments?post=547"}],"version-history":[{"count":17,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/547\/revisions"}],"predecessor-version":[{"id":576,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/posts\/547\/revisions\/576"}],"wp:attachment":[{"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/media?parent=547"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/categories?post=547"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.axeuh.com\/index.php\/wp-json\/wp\/v2\/tags?post=547"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}