{"id":257,"date":"2025-08-05T21:41:31","date_gmt":"2025-08-05T13:41:31","guid":{"rendered":"https:\/\/0x0.pub\/?p=257"},"modified":"2025-08-05T21:41:31","modified_gmt":"2025-08-05T13:41:31","slug":"mpls-vpn-%e5%9f%ba%e7%a1%80%e5%ae%9e%e9%aa%8c2","status":"publish","type":"post","link":"https:\/\/0x0.pub\/?p=257","title":{"rendered":"MPLS VPN \u57fa\u7840\u5b9e\u9a8c2"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>\u62d3\u6251\u56fe<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1297\" height=\"452\" src=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/c015c30b6a919258f2d514f7cb5453a0.png\" alt=\"\" class=\"wp-image-339\" srcset=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/c015c30b6a919258f2d514f7cb5453a0.png 1297w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/c015c30b6a919258f2d514f7cb5453a0-300x105.png 300w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/c015c30b6a919258f2d514f7cb5453a0-768x268.png 768w\" sizes=\"auto, (max-width: 1297px) 100vw, 1297px\" \/><\/figure>\n\n\n\n<p>\u9700\u6c42\uff1aR4-R6\uff0cR5-R7\u5b9e\u73b0BGP MPLS VPN\u5185\u7f51\u4e92\u8054, R4-R6 CE\u6bb5\u4f7f\u7528BGP\u4e92\u8054\u3002 R5-R7\u4f7f\u7528OSPF\u3002<\/p>\n\n\n\n<p>\u914d\u7f6e\u601d\u8def<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1. \u914d\u7f6e\u4e92\u8054\u63a5\u53e3IP\u548c\u73af\u56de\u53e3IP<br>2. \u914d\u7f6e\u9aa8\u5e72\u7f51ISIS\u548cMPLS<br>3. \u914d\u7f6e\u4e24\u4e2aPE\u4e4b\u95f4\u7684BGP vpnv4\u90bb\u5c45<br>4. \u914d\u7f6e\u4e24\u4e2aPE\u76844\u4e2a\u63a5\u5165\u5b9e\u4f8b\uff0c\u7ed1\u5b9a\u63a5\u53e3\u914d\u7f6eIP<br>5. \u914d\u7f6ePE-CE\u7684bgp\u90bb\u5c45\uff08R4-R1\uff0cR3-R6\uff09\uff0cCE\u53d1\u5e03\u79c1\u6709\u7f51\u7edc\u548c\u5f00\u542f\u5141\u8bb8as\u73af\u8def\u3002<br>6. \u914d\u7f6ePE-CE\u7684ospf\u90bb\u5c45\uff08R5-R1\uff0cR3-R7\uff09\u53d1\u5e03ospf\u8def\u7531\u3002R1\/R3 ospf\u7ed1\u5b9a\u5b9e\u4f8b, PE\u7684ospf\u4e0b\u5f15\u5165bgp\u8def\u7531\uff0cbgp\u5bf9\u5e94\u5b9e\u4f8b\u4e2d\u5f15\u5165ospf\u8def\u7531\u3002<\/pre>\n\n\n\n<p>\u914d\u7f6e\u547d\u4ee4<\/p>\n\n\n\n<p>1. \u914d\u7f6e\u4e92\u8054\u63a5\u53e3IP\u548c\u73af\u56de\u53e3IP\uff0c\u7ed1\u5b9aVRF\u7684\u63a5\u53e3\u5728\u521b\u5efa\u5b9e\u4f8b\u540e\u518d\u914d\u7f6e\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nsys\nsysn R1\nint g0\/0\/0\nip addr 12.1.1.1 24\nint lo0\nip addr 1.1.1.1 32\n\n#R2\nsys\nsysn R2\nint g0\/0\/0\nip addr 12.1.1.2 24\nint g0\/0\/1\nip addr 23.1.1.2 24\nint lo0\nip addr 2.2.2.2 32\n\n#R3\nsys\nsysn R3\nint g0\/0\/0\nip addr 23.1.1.3 24\nint lo0\nip addr 3.3.3.3 32\n\n#R4\nsys\nsysn R4\nint g0\/0\/0\nip addr 192.168.14.4 24\nint lo0\nip addr 172.16.1.1 24\n\n#R5\nsys\nsysn R5\nint g0\/0\/0\nip addr 192.168.15.5 24\nint lo0\nip addr 172.16.1.1 24\n\n#R6\nsys\nsysn R6\nint g0\/0\/0\nip addr 192.168.36.6 24\nint lo0\nip addr 172.16.2.1 24\n\n#R7\nsys\nsysn R7\nint g0\/0\/0\nip addr 192.168.37.7 24\nint lo0\nip addr 172.16.2.1 24<\/code><\/pre>\n\n\n\n<p>2.\u914d\u7f6eR1-R2-R3\u9aa8\u5e72\u7f51\u7684ISIS\/MPLS<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nisis 1\nis-level level-2\nnetwork-ent 49.0123.0000.0000.0001.00\nint g0\/0\/0\nisis en 1\nint lo0\nisis en 1\nqu\n\nmpls lsr-id 1.1.1.1\nmpls\nmpls ldp\nint g0\/0\/0\nmpls\nmpls ldp\n\n\n#R2\nisis 1\nis-level level-2\nnetwork-ent 49.0123.0000.0000.0002.00\nint g0\/0\/0\nisis en 1\nint g0\/0\/1\nisis en 1\nint lo0\nisis en 1\nqu\n\nmpls lsr-id 2.2.2.2\nmpls\nmpls ldp\nint g0\/0\/0\nmpls\nmpls ldp\nint g0\/0\/1\nmpls\nmpls ldp\n\n#R3\nisis 1\nis-level level-2\nnetwork-ent 49.0123.0000.0000.0003.00\nint g0\/0\/0\nisis en 1\nint lo0\nisis en 1\nqu\n\nmpls lsr-id 3.3.3.3\nmpls\nmpls ldp\nint g0\/0\/0\nmpls\nmpls ldp<\/code><\/pre>\n\n\n\n<p>3.\u914d\u7f6eR1-R3 BGP vpnv4\u90bb\u5c45<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nbgp 100\nrouter-id 1.1.1.1\nundo default ipv4-unicast\npeer 3.3.3.3 as 100\npeer 3.3.3.3 connect-int lo0\nipv4-family vpnv4\npeer 3.3.3.3 en\n\n#R3\nbgp 100\nrouter-id 3.3.3.3\nundo default ipv4-unicast\npeer 1.1.1.1 as 100\npeer 1.1.1.1 connect-int lo0\nipv4-family vpnv4\npeer 1.1.1.1 en<\/code><\/pre>\n\n\n\n<p>4.\u914d\u7f6eR1\/R3\u63a5\u5165\u76844\u4e2avpn\u5b9e\u4f8b\uff0c\u7ed1\u5b9a\u63a5\u53e3\u914d\u7f6eIP<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nip vpn-instance 4\nrouter-dist 4:4\nvpn-target 4:6 ex\nvpn-target 6:4 im\nqu\nqu\n\nip vpn-instance 5\nrouter-dist 5:5\nvpn-target 5:7 ex\nvpn-target 7:5 im\nqu\nqu\n\nint g0\/0\/1\nip bind vpn-instance 4\nip addr 192.168.14.1 24\nint g0\/0\/2\nip bind vpn-instance 5\nip addr 192.168.15.1 24\n\n\n#R3\nip vpn-instance 6\nrouter-dist 6:6\nvpn-target 6:4 ex\nvpn-target 4:6 im\nqu\nqu\n\nip vpn-instance 7\nrouter-dist 7:7\nvpn-target 7:5 ex\nvpn-target 5:7 im\nqu\nqu\n\nint g0\/0\/1\nip bind vpn-instance 6\nip addr 192.168.36.3 24\nint g0\/0\/2\nip bind vpn-instance 7\nip addr 192.168.37.3 24<\/code><\/pre>\n\n\n\n<p>5.\u914d\u7f6e\u63a5\u5165\u7aefR1\u4e0eR4\u5efa\u7acbEBGP\uff0cR3\u4e0eR6\u5efa\u7acbEBGP\uff0c\u63a5\u5165\u7aefR4\/R6\u5141\u8bb8as\u73af\u8def\u5e76\u53d1\u5e03\u79c1\u6709\u7f51\u7edc\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nbgp 100\nipv4-family vpn-instance 4\npeer 192.168.14.4 as 65001\n\n#R4\nbgp 65001\npeer 192.168.14.1 as 100\npeer 192.168.14.1 allow-as-loop\nnetwork 172.16.1.1 24\n\n#R3\nbgp 100\nipv4-family vpn-instance 6\npeer 192.168.36.6 as 65001\n\n#R6\nbgp 65001\npeer 192.168.36.3 as 100\npeer 192.168.36.3 allow-as-loop\nnetwork 172.16.2.1 24<\/code><\/pre>\n\n\n\n<p>6.\u914d\u7f6eR1\u4e0eR5\u5efa\u7acbOSPF\u90bb\u5c45\/R3\u4e0eR7\u5efa\u7acbOSPF\u90bb\u5c45\u5e76\u53d1\u5e03OSPF\u8def\u7531\u3002R1\/R3 OSPF\u7ed1\u5b9a\u5b9e\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nospf 1 router-id 1.1.1.1 vpn-instance 5\narea 0\nnetwork 192.168.15.1 0.0.0.255\n\n#R5\nospf 1 router-id 5.5.5.5\narea 0\nnetwork 192.168.15.5 0.0.0.255\nnetwork 172.16.1.1 0.0.0.255\n\n#R3\nospf 1 router-id 3.3.3.3 vpn-instance 7\narea 0\nnetwork 192.168.37.3 0.0.0.255\n\n#R7\nospf 1 router-id 7.7.7.7\narea 0\nnetwork 192.168.37.7 0.0.0.255\nnetwork 172.16.2.1 0.0.0.255<\/code><\/pre>\n\n\n\n<p>7.\u914d\u7f6eR1\/R3 \u5b9e\u4f8bOSPF\u4e2d\u5f15\u5165bgp\uff0cBGP vpn\u5b9e\u4f8b\u65cf\u4e2d\u5f15\u5165OSPF<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>#R1\nospf 1 router-id 1.1.1.1 vpn-instance 5\nimport-route bgp\n\nbgp 100\nipv4-family vpn-instance 5 \nimport-route ospf 1\n\n#R3\nospf 1 router-id 3.3.3.3 vpn-instance 7\nimport-route bgp\n\nbgp 100\nipv4-family vpn-instance 7 \nimport-route ospf 1<\/code><\/pre>\n\n\n\n<p>\u7ed3\u679c\u9a8c\u8bc1<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"591\" src=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/6fc136df-d842-4506-bb7b-6f27048e05da.png\" alt=\"\" class=\"wp-image-343\" srcset=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/6fc136df-d842-4506-bb7b-6f27048e05da.png 883w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/6fc136df-d842-4506-bb7b-6f27048e05da-300x201.png 300w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/6fc136df-d842-4506-bb7b-6f27048e05da-768x514.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"689\" src=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/21708c1c-cf79-4462-ab4c-e83533681040.png\" alt=\"\" class=\"wp-image-342\" srcset=\"https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/21708c1c-cf79-4462-ab4c-e83533681040.png 826w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/21708c1c-cf79-4462-ab4c-e83533681040-300x250.png 300w, https:\/\/0x0.pub\/wp-content\/uploads\/2025\/08\/21708c1c-cf79-4462-ab4c-e83533681040-768x641.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u62d3\u6251\u56fe \u9700\u6c42\uff1aR4-R6\uff0cR5-R7\u5b9e\u73b0BGP MPLS VPN\u5185\u7f51\u4e92\u8054, R4-R6 CE\u6bb5\u4f7f\u7528BGP\u4e92\u8054\u3002 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[35],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-ensp","tag-mpls-vpn"],"_links":{"self":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=257"}],"version-history":[{"count":4,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/0x0.pub\/index.php?rest_route=\/wp\/v2\/posts\/257\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0x0.pub\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}