{"id":66942,"date":"2026-01-27T22:09:21","date_gmt":"2026-01-27T14:09:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/66942.html"},"modified":"2026-01-27T22:09:21","modified_gmt":"2026-01-27T14:09:21","slug":"frr%e5%ae%9e%e7%8e%b0bgp%e8%af%a6%e7%bb%86%e7%89%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/66942.html","title":{"rendered":"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248"},"content":{"rendered":"<h2 id=\"%E8%BE%B9%E7%95%8C%E7%BD%91%E5%85%B3%E5%8D%8F%E8%AE%AE%EF%BC%88BGP%EF%BC%89\">\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09;<\/h2>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E8%BE%B9%E7%95%8C%E7%BD%91%E5%85%B3%E5%8D%8F%E8%AE%AE%EF%BC%88BGP%EF%BC%89-toc\" style=\"margin-left:0px\">\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09;<\/p>\n<p id=\"II.%20BGP%20%E6%A6%82%E8%BF%B0-toc\" style=\"margin-left:40px\">BGP \u6982\u8ff0<\/p>\n<p id=\"III.%20BGP%20%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5%E4%B8%8E%E6%9C%AF%E8%AF%AD-toc\" style=\"margin-left:40px\">BGP \u57fa\u7840\u6982\u5ff5\u4e0e\u672f\u8bed<\/p>\n<p id=\"IV.%20BGP%20%E5%8D%8F%E8%AE%AE%E6%93%8D%E4%BD%9C-toc\" style=\"margin-left:40px\">BGP \u534f\u8bae\u64cd\u4f5c<\/p>\n<p id=\"V.%20BGP%20%E8%B7%AF%E5%BE%84%E5%B1%9E%E6%80%A7%E8%AF%A6%E8%A7%A3-toc\" style=\"margin-left:40px\">BGP \u8def\u5f84\u5c5e\u6027\u8be6\u89e3<\/p>\n<p id=\"BGP%20%E8%B7%AF%E7%94%B1%E7%AD%96%E7%95%A5-toc\" style=\"margin-left:40px\">BGP \u8def\u7531\u7b56\u7565<\/p>\n<p id=\"FRR%E5%AE%9E%E7%8E%B0BGP-toc\" style=\"margin-left:40px\">FRR\u5b9e\u73b0BGP<\/p>\n<p id=\"X.%20BGP%20%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5-toc\" style=\"margin-left:40px\">BGP \u6545\u969c\u6392\u67e5<\/p>\n<hr id=\"hr-toc\" \/>\n<h3 id=\"II.%20BGP%20%E6%A6%82%E8%BF%B0\">BGP \u6982\u8ff0<\/h3>\n<ul>\n<li>\u6838\u5fc3\u7279\u6027&#xff1a;\n<ul>\n<li>\u8def\u5f84\u77e2\u91cf\u534f\u8bae&#xff1a;\u643a\u5e26\u5b8c\u6574\u7684 AS \u8def\u5f84\u4fe1\u606f\u3002<\/li>\n<li>\u57fa\u4e8e\u7b56\u7565\u7684\u8def\u7531&#xff1a;\u5f3a\u5927\u7684\u8def\u7531\u7b56\u7565\u63a7\u5236\u80fd\u529b\u3002<\/li>\n<li>\u4f7f\u7528 TCP \u4f20\u8f93&#xff1a;\u53ef\u9760\u6027\u4fdd\u969c&#xff08;\u7aef\u53e3 179&#xff09;\u3002<\/li>\n<li>\u589e\u91cf\u66f4\u65b0&#xff1a;\u9ad8\u6548\u7684\u8def\u7531\u4fe1\u606f\u4f20\u64ad\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u4e3b\u8981\u529f\u80fd&#xff1a; \u5b9e\u73b0 AS \u95f4\u7684\u4e92\u8054\u4e92\u901a\u548c\u8def\u7531\u53ef\u8fbe\u6027\u3002<\/li>\n<li>\u5e94\u7528\u573a\u666f&#xff1a; \u5927\u578b\u4f01\u4e1a\u591a\u51fa\u53e3\u3001ISP \u9aa8\u5e72\u7f51\u4e92\u8054\u3001\u4e92\u8054\u7f51\u4ea4\u6362\u4e2d\u5fc3&#xff08;IXP&#xff09;\u3001\u4e91\u670d\u52a1\u63d0\u4f9b\u5546\u7f51\u7edc\u3002<\/li>\n<\/ul>\n<h3 id=\"III.%20BGP%20%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5%E4%B8%8E%E6%9C%AF%E8%AF%AD\">BGP \u57fa\u7840\u6982\u5ff5\u4e0e\u672f\u8bed<\/h3>\n<ul>\n<li>\u81ea\u6cbb\u7cfb\u7edf&#xff08;Autonomous System, AS&#xff09;&#xff1a;\n<ul>\n<li>\u5b9a\u4e49&#xff1a;\u4e00\u4e2a\u5728\u5355\u4e00\u7ba1\u7406\u57df\u4e0b\u8fd0\u884c\u7684\u7f51\u7edc\u96c6\u5408\u3002<\/li>\n<li>AS \u53f7&#xff08;ASN&#xff09;&#xff1a;\u5168\u7403\u552f\u4e00\u7684\u6807\u8bc6\u7b26&#xff08;\u516c\u5171 ASN \u548c\u79c1\u6709 ASN&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>BGP \u5bf9\u7b49\u4f53&#xff08;Peers&#xff09;&#xff1a;\n<ul>\n<li>\u5b9a\u4e49&#xff1a;\u5efa\u7acb BGP \u4f1a\u8bdd\u7684\u4e24\u53f0\u8def\u7531\u5668\u3002<\/li>\n<li>\u7c7b\u578b&#xff1a;\n<ul>\n<li>EBGP&#xff08;External BGP&#xff09;&#xff1a;\u4f4d\u4e8e\u4e0d\u540c AS \u7684\u5bf9\u7b49\u4f53&#xff08;\u901a\u5e38\u76f4\u8fde\u6216\u591a\u8df3&#xff09;\u3002<\/li>\n<li>IBGP&#xff08;Internal BGP&#xff09;&#xff1a;\u4f4d\u4e8e\u540c\u4e00 AS \u7684\u5bf9\u7b49\u4f53&#xff08;\u901a\u5e38\u975e\u76f4\u8fde&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>BGP \u8def\u7531&#xff08;\u524d\u7f00&#xff09;&#xff1a; \u9700\u8981\u901a\u544a\u7684\u7f51\u7edc\u53ef\u8fbe\u6027\u4fe1\u606f&#xff08;\u4f8b\u5982&#xff1a;192.0.2.0\/24&#xff09;\u3002<\/li>\n<li>BGP \u5c5e\u6027&#xff08;Attributes&#xff09;&#xff1a; \u63cf\u8ff0\u8def\u7531\u7279\u6027\u3001\u7528\u4e8e\u8def\u5f84\u9009\u62e9\u548c\u7b56\u7565\u5e94\u7528\u7684\u5173\u952e\u53c2\u6570\u96c6\u5408&#xff08;\u4f8b\u5982&#xff1a;AS_PATH, NEXT_HOP, LOCAL_PREF, MED, Community \u7b49&#xff09;\u3002<\/li>\n<\/ul>\n<h3 id=\"IV.%20BGP%20%E5%8D%8F%E8%AE%AE%E6%93%8D%E4%BD%9C\">BGP \u534f\u8bae\u64cd\u4f5c<\/h3>\n<ul>\n<li>BGP \u6709\u9650\u72b6\u6001\u673a&#xff08;FSM&#xff09;&#xff1a; \u63cf\u8ff0\u4f1a\u8bdd\u5efa\u7acb\u548c\u7ef4\u62a4\u7684\u5404\u79cd\u72b6\u6001&#xff08;Idle, Connect, Active, OpenSent, OpenConfirm, Established&#xff09;\u3002<\/li>\n<li>\u5efa\u7acb BGP \u5bf9\u7b49\u4f1a\u8bdd&#xff1a;\n<ul>\n<li>TCP \u8fde\u63a5\u5efa\u7acb\u3002<\/li>\n<li>\u4ea4\u6362 OPEN \u6d88\u606f&#xff1a;\u534f\u5546\u53c2\u6570&#xff08;BGP \u7248\u672c\u3001ASN\u3001Hold Time\u3001BGP Identifier \u7b49&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8def\u7531\u4fe1\u606f\u4ea4\u6362&#xff1a;\n<ul>\n<li>UPDATE \u6d88\u606f&#xff1a;\u7528\u4e8e\u901a\u544a\u65b0\u8def\u7531\u3001\u64a4\u9500\u65e7\u8def\u7531\u6216\u66f4\u65b0\u8def\u7531\u5c5e\u6027\u3002<\/li>\n<li>\u8def\u7531\u901a\u544a\u89c4\u5219&#xff08;\u4f8b\u5982&#xff1a;IBGP \u6c34\u5e73\u5206\u5272&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u4fdd\u6301\u8fde\u63a5&#xff1a; KEEPALIVE \u6d88\u606f\u7684\u4f5c\u7528\u3002<\/li>\n<\/ul>\n<h3 id=\"V.%20BGP%20%E8%B7%AF%E5%BE%84%E5%B1%9E%E6%80%A7%E8%AF%A6%E8%A7%A3\">BGP \u8def\u5f84\u5c5e\u6027\u8be6\u89e3<\/h3>\n<ul>\n<li>\u516c\u8ba4\u5fc5\u9075\u5c5e\u6027&#xff1a; \u6240\u6709 BGP \u5b9e\u73b0\u5fc5\u987b\u8bc6\u522b\u4e14\u5305\u542b\u5728 UPDATE \u6d88\u606f\u4e2d\u3002\n<ul>\n<li>ORIGIN&#xff1a;\u8def\u7531\u6765\u6e90&#xff08;IGP, EGP, Incomplete&#xff09;\u3002<\/li>\n<li>AS_PATH&#xff1a;\u8bb0\u5f55\u8def\u7531\u7ecf\u8fc7\u7684 AS \u5e8f\u5217\u3002<\/li>\n<li>NEXT_HOP&#xff1a;\u5230\u8fbe\u76ee\u7684\u7f51\u7edc\u7684\u4e0b\u4e00\u8df3 IP \u5730\u5740\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u516c\u8ba4\u4efb\u610f\u5c5e\u6027&#xff1a; \u6240\u6709 BGP \u5b9e\u73b0\u90fd\u80fd\u8bc6\u522b&#xff0c;\u4f46\u53ef\u4ee5\u9009\u62e9\u6027\u5305\u542b\u3002\n<ul>\n<li>LOCAL_PREF&#xff08;\u672c\u5730\u4f18\u5148\u7ea7&#xff09;&#xff1a;\u7528\u4e8e IBGP \u5185\u90e8\u9009\u8def&#xff08;\u503c\u8d8a\u9ad8\u8d8a\u4f18\u5148&#xff09;\u3002<\/li>\n<li>ATOMIC_AGGREGATE&#xff1a;\u8868\u793a\u8def\u7531\u88ab\u805a\u5408\u4e14\u4e22\u5931\u4e86\u90e8\u5206\u8def\u5f84\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u53ef\u9009\u4f20\u9012\u5c5e\u6027&#xff1a; \u63a5\u6536\u65b9\u53ef\u4ee5\u4e0d\u8bc6\u522b&#xff0c;\u4f46\u4f1a\u7ee7\u7eed\u4f20\u9012\u7ed9\u5176\u4ed6\u5bf9\u7b49\u4f53\u3002\n<ul>\n<li>AGGREGATOR&#xff1a;\u6807\u8bc6\u6267\u884c\u8def\u7531\u805a\u5408\u7684\u8def\u7531\u5668\u53ca\u5176 AS\u3002<\/li>\n<li>Community&#xff1a;\u4e00\u4e2a\u5f3a\u5927\u7684\u6807\u7b7e\u673a\u5236&#xff0c;\u7528\u4e8e\u7b80\u5316\u8def\u7531\u7b56\u7565\u5e94\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u53ef\u9009\u975e\u4f20\u9012\u5c5e\u6027&#xff1a; \u63a5\u6536\u65b9\u53ef\u4ee5\u4e0d\u8bc6\u522b&#xff0c;\u4e14\u4e0d\u4f1a\u4f20\u9012\u7ed9\u5176\u4ed6\u5bf9\u7b49\u4f53\u3002\n<ul>\n<li>MULTI_EXIT_DISC&#xff08;MED&#xff09;&#xff1a;\u7528\u4e8e\u5411\u90bb\u5c45 AS \u5efa\u8bae\u9996\u9009\u5165\u53e3\u70b9&#xff08;\u503c\u8d8a\u4f4e\u8d8a\u4f18\u5148&#xff09;\u3002<\/li>\n<li>ORIGINATOR_ID&#xff1a;\u7528\u4e8e\u8def\u7531\u53cd\u5c04\u573a\u666f&#xff0c;\u9632\u6b62\u73af\u8def\u3002<\/li>\n<li>CLUSTER_LIST&#xff1a;\u7528\u4e8e\u8def\u7531\u53cd\u5c04\u573a\u666f&#xff0c;\u9632\u6b62\u73af\u8def\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 id=\"BGP%20%E8%B7%AF%E7%94%B1%E7%AD%96%E7%95%A5\">BGP \u8def\u7531\u7b56\u7565<\/h3>\n<ul>\n<li>\u7b56\u7565\u7684\u6838\u5fc3&#xff1a;\u00a0\u57fa\u4e8e\u5c5e\u6027\u64cd\u7eb5\u6765\u63a7\u5236\u8def\u7531\u7684\u63a5\u6536\u3001\u901a\u544a\u548c\u4f18\u9009\u3002<\/li>\n<li>\u5165\u53e3\u7b56\u7565&#xff08;Import Policy&#xff09;&#xff1a;\u00a0\u63a7\u5236\u4ece\u5bf9\u7b49\u4f53\u63a5\u6536\u54ea\u4e9b\u8def\u7531\u4ee5\u53ca\u5982\u4f55\u4fee\u6539\u5176\u5c5e\u6027\u3002<\/li>\n<li>\u51fa\u53e3\u7b56\u7565&#xff08;Export Policy&#xff09;&#xff1a;\u00a0\u63a7\u5236\u5411\u5bf9\u7b49\u4f53\u901a\u544a\u54ea\u4e9b\u8def\u7531\u4ee5\u53ca\u5982\u4f55\u4fee\u6539\u5176\u5c5e\u6027\u3002<\/li>\n<li>\u5e38\u7528\u7b56\u7565\u5de5\u5177&#xff1a;\n<ul>\n<li>\u8bbf\u95ee\u63a7\u5236\u5217\u8868&#xff08;ACL&#xff09;\u548c\u524d\u7f00\u5217\u8868&#xff08;Prefix-list&#xff09;&#xff1a;\u7528\u4e8e\u8def\u7531\u8fc7\u6ee4\u3002<\/li>\n<li>\u8def\u7531\u6620\u5c04&#xff08;Route-map&#xff09;&#xff1a;\u5f3a\u5927\u7684\u7b56\u7565\u5de5\u5177&#xff0c;\u7528\u4e8e\u5339\u914d\u8def\u7531\u5e76\u4fee\u6539\u5c5e\u6027\u6216\u6267\u884c\u52a8\u4f5c&#xff08;\u5141\u8bb8\/\u62d2\u7edd&#xff09;\u3002<\/li>\n<li>\u56e2\u4f53\u5c5e\u6027&#xff08;Community&#xff09;&#xff1a;\u6807\u8bb0\u8def\u7531&#xff0c;\u5b9e\u73b0\u7b56\u7565\u7684\u6a21\u5757\u5316\u548c\u7b80\u5316\u3002<\/li>\n<li>\u6b63\u5219\u8868\u8fbe\u5f0f&#xff1a;\u7528\u4e8e\u5339\u914d\u590d\u6742\u7684\u00a0AS_PATH\u00a0\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5178\u578b\u7b56\u7565\u5e94\u7528\u573a\u666f&#xff1a;\u00a0\u6d41\u91cf\u5de5\u7a0b\u3001\u591a\u5bbf\u4e3b\u73af\u5883\u8d1f\u8f7d\u5206\u62c5\/\u5907\u4efd\u3001\u8054\u76df\u3001\u8def\u7531\u53cd\u5c04\u5668\u914d\u7f6e\u7b49\u3002<\/li>\n<\/ul>\n<h3 id=\"FRR%E5%AE%9E%E7%8E%B0BGP\">FRR\u5b9e\u73b0BGP<\/h3>\n<ul>\n<li>\u914d\u7f6eBGP\u57fa\u672c\u53c2\u6570<\/li>\n<\/ul>\n<p>    sudo sh -c &#034;echo \\\\&#034;<br \/>\n    configure terminal<br \/>\n        hostname ${ROLE}<br \/>\n        ! \u914d\u7f6eBGP\u8def\u7531\u5668<br \/>\n        router bgp ${LOCAL_AS}<br \/>\n            bgp router-id ${LOOPBACK_IP}<br \/>\n            no bgp ebgp-requires-policy<br \/>\n            no bgp network import-check<br \/>\n            end<br \/>\n    exit<br \/>\n    \\\\&#034; | vtysh&#034; <\/p>\n<ul>\n<li>\u914d\u7f6eeBGP\u90bb\u5c45\u5173\u7cfb<\/li>\n<\/ul>\n<p>    for neighbor_info in &#034;${NEIGHBORS[&#064;]}&#034;; do<br \/>\n        read -r neighbor_ip neighbor_as &lt;&lt;&lt; &#034;$neighbor_info&#034;<br \/>\n        sudo sh -c &#034;echo \\\\&#034;<br \/>\n        configure terminal<br \/>\n            hostname ${ROLE}<br \/>\n            router bgp ${LOCAL_AS}<br \/>\n                neighbor ${neighbor_ip} remote-as ${neighbor_as}<br \/>\n                ! Keepalive\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u8fde\u63a5\u5b9a\u65f6\u5668&#xff09; 5s<br \/>\n                ! Holdtime\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u65f6\u95f4\u5b9a\u65f6\u5668&#xff09; 15s<br \/>\n                neighbor ${neighbor_ip} timers 5 15<br \/>\n                end<br \/>\n        exit<br \/>\n        \\\\&#034; | vtysh&#034;<\/p>\n<p>    done <\/p>\n<ul>\n<li>\u914d\u7f6eIPv4\u5730\u5740\u65cf\u548c\u8def\u7531\u901a\u544a\u5e76\u6fc0\u6d3b\u6bcf\u4e2a\u90bb\u5c45<\/li>\n<\/ul>\n<p>    # \u914d\u7f6e\u5730\u5740\u65cf\u548c\u8def\u7531\u6620\u5c04<br \/>\n    sudo sh -c &#034;echo \\\\&#034;<br \/>\n    configure terminal<br \/>\n        router bgp ${LOCAL_AS}<br \/>\n        address-family ipv4 unicast<br \/>\n        network ${LOOPBACK_NET}<br \/>\n        end<br \/>\n    exit<br \/>\n    \\\\&#034; | vtysh&#034;<\/p>\n<p>    # \u6fc0\u6d3b\u6bcf\u4e2a\u90bb\u5c45<br \/>\n    for neighbor_info in &#034;${NEIGHBORS[&#064;]}&#034;; do<br \/>\n        read -r neighbor_ip neighbor_as &lt;&lt;&lt; &#034;$neighbor_info&#034;<br \/>\n        sudo sh -c &#034;echo \\\\&#034;<br \/>\n        configure terminal<br \/>\n            router bgp ${LOCAL_AS}<br \/>\n                address-family ipv4 unicast<br \/>\n                neighbor ${neighbor_ip} activate<br \/>\n                neighbor ${neighbor_ip} route-map PERMIT_ALL in<br \/>\n                neighbor ${neighbor_ip} route-map PERMIT_ALL out<br \/>\n                end<br \/>\n        exit<br \/>\n        \\\\&#034; | vtysh&#034;<br \/>\n    done<br \/>\n    # \u914d\u7f6e\u8def\u7531\u6620\u5c04<br \/>\n    sudo sh -c &#034;echo \\\\&#034;<br \/>\n    configure terminal<br \/>\n        route-map PERMIT_ALL permit 10<br \/>\n        end<br \/>\n        write memory<br \/>\n    exit<br \/>\n    \\\\&#034; | vtysh&#034; <\/p>\n<ul>\n<li>\u67e5\u770b\u914d\u7f6e<\/li>\n<\/ul>\n<p>    sudo vtysh -c &#034;show running-config&#034; <\/p>\n<ul>\n<li>\u53ef\u4ee5\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u7ed3\u679c<\/li>\n<\/ul>\n<p>configure terminal<br \/>\nhostname router2<br \/>\nroute-map PERMIT_ALL permit 10<br \/>\n! \u914d\u7f6eBGP\u8def\u7531\u5668<br \/>\nrouter bgp 65002<br \/>\nbgp router-id 192.168.2.1<br \/>\nno bgp ebgp-requires-policy<br \/>\nno bgp network import-check<br \/>\n! \u914d\u7f6eBGP\u90bb\u5c45<br \/>\nneighbor 10.0.1.1 remote-as 65001<br \/>\nneighbor 10.0.1.1 description eBGP-peer-AS65001<br \/>\n! Keepalive\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u8fde\u63a5\u5b9a\u65f6\u5668&#xff09; 5s<br \/>\n! Holdtime\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u65f6\u95f4\u5b9a\u65f6\u5668&#xff09; 15s<br \/>\nneighbor 10.0.1.1 timers 5 15<br \/>\n! \u914d\u7f6eBGP\u90bb\u5c45<br \/>\nneighbor 10.0.1.3 remote-as 65003<br \/>\nneighbor 10.0.1.3 description eBGP-peer-AS65003<br \/>\n! Keepalive\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u8fde\u63a5\u5b9a\u65f6\u5668&#xff09; 5s<br \/>\n! Holdtime\u5b9a\u65f6\u5668&#xff08;\u4fdd\u6301\u65f6\u95f4\u5b9a\u65f6\u5668&#xff09; 15s<br \/>\nneighbor 10.0.1.3 timers 5 15<br \/>\n!\u914d\u7f6e\u5730\u5740\u65cf\u548c\u8def\u7531\u6620\u5c04<br \/>\naddress-family ipv4 unicast<br \/>\nnetwork 192.168.2.0\/24<br \/>\n!\u6fc0\u6d3b\u6bcf\u4e2a\u90bb\u5c45<br \/>\nneighbor 10.0.1.1 activate<br \/>\nneighbor 10.0.1.1 route-map PERMIT_ALL in<br \/>\nneighbor 10.0.1.1 route-map PERMIT_ALL out<br \/>\n!\u6fc0\u6d3b\u6bcf\u4e2a\u90bb\u5c45<br \/>\nneighbor 10.0.1.3 activate<br \/>\nneighbor 10.0.1.3 route-map PERMIT_ALL in<br \/>\nneighbor 10.0.1.3 route-map PERMIT_ALL out<br \/>\n!\u914d\u7f6e\u8def\u7531\u6620\u5c04<br \/>\nend<br \/>\nwrite memory<br \/>\nexit <\/p>\n<h3 id=\"X.%20BGP%20%E6%95%85%E9%9A%9C%E6%8E%92%E6%9F%A5\">BGP \u6545\u969c\u6392\u67e5<\/h3>\n<ul>\n<li>\u5e38\u89c1\u95ee\u9898&#xff1a;\u90bb\u5c45\u65e0\u6cd5\u5efa\u7acb\u3001\u8def\u7531\u672a\u5b66\u4e60\/\u672a\u901a\u544a\u3001\u8def\u5f84\u9009\u62e9\u4e0d\u7b26\u5408\u9884\u671f\u3001\u8def\u7531\u6ce2\u52a8\u3002<\/li>\n<li>\u6392\u67e5\u5de5\u5177\u4e0e\u65b9\u6cd5&#xff1a;\n<ul>\n<li>\u67e5\u770b BGP \u90bb\u5c45\u72b6\u6001\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>    sudo vtysh -c &#034;show ip bgp summary&#034;     <\/p>\n<ul>\n<li>\u67e5\u770b BGP \u8def\u7531\u8868\u3002<\/li>\n<\/ul>\n<p>    sudo vtysh -c &#034;show ip bgp ipv4 unicast&#034;<br \/>\n    sudo ip route show | grep &#034;bgp&#034; <\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260127140920-6978c71071046.png\" \/><\/p>\n<ul>\n<li>\u67e5\u770b BGP \u901a\u544a\u548c\u63a5\u6536\u7684\u8def\u7531\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p>    sudo vtysh -c &#034;show ip bgp neighbor&#034; <\/p>\n<ul>\n<li>\u67e5\u770b BGP \u7b56\u7565&#xff08;\u5982\u8def\u7531\u6620\u5c04&#xff09;\u7684\u5339\u914d\u548c\u6267\u884c\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<p>    sudo vtysh -c &#034;show route-map&#034; <\/p>\n<ul>\n<li>\u5229\u7528\u7f51\u7edc\u76d1\u63a7\u548c\u53ef\u89c6\u5316\u5de5\u5177\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09;<br \/>\n\u76ee\u5f55<br \/>\n\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09;<br \/>\nBGP \u6982\u8ff0<br \/>\nBGP \u57fa\u7840\u6982\u5ff5\u4e0e\u672f\u8bed<br \/>\nBGP \u534f\u8bae\u64cd\u4f5c<br \/>\nBGP \u8def\u5f84\u5c5e\u6027\u8be6\u89e3<br \/>\nBGP \u8def\u7531\u7b56\u7565<br \/>\nFRR\u5b9e\u73b0BGP<br \/>\nBGP \u6545\u969c\u6392\u67e5 BGP \u6982\u8ff0<br \/>\n\u6838\u5fc3\u7279\u6027&#xff1a; \u8def\u5f84\u77e2\u91cf\u534f\u8bae&#xff1a;\u643a\u5e26\u5b8c\u6574\u7684 AS \u8def\u5f84\u4fe1\u606f\u3002\u57fa\u4e8e\u7b56\u7565\u7684\u8def\u7531&#xff1a;\u5f3a\u5927\u7684\u8def\u7531\u7b56\u7565\u63a7\u5236\u80fd\u529b\u3002\u4f7f\u7528 TCP \u4f20\u8f93&#xff1a;\u53ef\u9760\u6027\u4fdd\u969c&#xff08;\u7aef\u53e3 1<\/p>\n","protected":false},"author":2,"featured_media":66941,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[352,58,190,167,78],"topic":[],"class_list":["post-66942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-bash","tag-linux","tag-190","tag-167","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/66942.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09; \u76ee\u5f55 \u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09; BGP \u6982\u8ff0 BGP \u57fa\u7840\u6982\u5ff5\u4e0e\u672f\u8bed BGP \u534f\u8bae\u64cd\u4f5c BGP \u8def\u5f84\u5c5e\u6027\u8be6\u89e3 BGP \u8def\u7531\u7b56\u7565 FRR\u5b9e\u73b0BGP BGP \u6545\u969c\u6392\u67e5 BGP \u6982\u8ff0 \u6838\u5fc3\u7279\u6027&#xff1a; \u8def\u5f84\u77e2\u91cf\u534f\u8bae&#xff1a;\u643a\u5e26\u5b8c\u6574\u7684 AS \u8def\u5f84\u4fe1\u606f\u3002\u57fa\u4e8e\u7b56\u7565\u7684\u8def\u7531&#xff1a;\u5f3a\u5927\u7684\u8def\u7531\u7b56\u7565\u63a7\u5236\u80fd\u529b\u3002\u4f7f\u7528 TCP \u4f20\u8f93&#xff1a;\u53ef\u9760\u6027\u4fdd\u969c&#xff08;\u7aef\u53e3 1\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/66942.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-27T14:09:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260127140920-6978c71071046.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66942.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/66942.html\",\"name\":\"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-27T14:09:21+00:00\",\"dateModified\":\"2026-01-27T14:09:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/66942.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/66942.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66942.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/66942.html","og_locale":"zh_CN","og_type":"article","og_title":"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09; \u76ee\u5f55 \u8fb9\u754c\u7f51\u5173\u534f\u8bae&#xff08;BGP&#xff09; BGP \u6982\u8ff0 BGP \u57fa\u7840\u6982\u5ff5\u4e0e\u672f\u8bed BGP \u534f\u8bae\u64cd\u4f5c BGP \u8def\u5f84\u5c5e\u6027\u8be6\u89e3 BGP \u8def\u7531\u7b56\u7565 FRR\u5b9e\u73b0BGP BGP \u6545\u969c\u6392\u67e5 BGP \u6982\u8ff0 \u6838\u5fc3\u7279\u6027&#xff1a; \u8def\u5f84\u77e2\u91cf\u534f\u8bae&#xff1a;\u643a\u5e26\u5b8c\u6574\u7684 AS \u8def\u5f84\u4fe1\u606f\u3002\u57fa\u4e8e\u7b56\u7565\u7684\u8def\u7531&#xff1a;\u5f3a\u5927\u7684\u8def\u7531\u7b56\u7565\u63a7\u5236\u80fd\u529b\u3002\u4f7f\u7528 TCP \u4f20\u8f93&#xff1a;\u53ef\u9760\u6027\u4fdd\u969c&#xff08;\u7aef\u53e3 1","og_url":"https:\/\/www.wsisp.com\/helps\/66942.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-27T14:09:21+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260127140920-6978c71071046.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/66942.html","url":"https:\/\/www.wsisp.com\/helps\/66942.html","name":"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-27T14:09:21+00:00","dateModified":"2026-01-27T14:09:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/66942.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/66942.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/66942.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"FRR\u5b9e\u73b0BGP\u8be6\u7ec6\u7248"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=66942"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66942\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/66941"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=66942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=66942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=66942"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=66942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}