{"id":824,"date":"2025-12-23T03:20:19","date_gmt":"2025-12-22T19:20:19","guid":{"rendered":"https:\/\/www.htmacg.cn\/?p=824"},"modified":"2025-12-23T03:20:19","modified_gmt":"2025-12-22T19:20:19","slug":"%e5%8d%8e%e4%b8%ba%e6%a8%a1%e6%8b%9f%e5%99%a8-pvid-%e5%ae%9e%e6%88%98%e6%95%99%e7%a8%8b%ef%bc%9a%e7%94%a8%e6%b3%95%e4%b8%8e%e9%aa%8c%e8%af%81","status":"publish","type":"post","link":"https:\/\/htmacg.cn\/?p=824","title":{"rendered":"\u534e\u4e3a\u6a21\u62df\u5668 PVID \u5b9e\u6218\u6559\u7a0b\uff1a\u7528\u6cd5\u4e0e\u9a8c\u8bc1"},"content":{"rendered":"<h2><strong><b>\u4e00\u3001\u5b9e\u9a8c\u51c6\u5907<\/b><\/strong><\/h2>\n<h3><strong><b>1. \u73af\u5883\u642d\u5efa<\/b><\/strong><\/h3>\n<ul>\n<li>\u8bbe\u5907\u6e05\u5355\uff1a2 \u53f0\u534e\u4e3a\u4ea4\u6362\u673a\uff08LSW1\u3001LSW2\uff09\u30012 \u53f0 PC \u673a\uff08PC1\u3001PC2\uff09<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/img.htmacg.cn\/uploads\/2025\/12\/23\/694996ffcfce7.png\" alt=\"QQ20251223-030647.png\" \/><\/p>\n<ul>\n<li>\u6838\u5fc3\u8bf4\u660e\uff1aPC1 \u548c PC2 \u5904\u4e8e\u540c\u7f51\u6bb5\uff0810.0.0.0 \u7f51\u6bb5\uff09\uff0c\u901a\u8fc7\u4e24\u53f0\u4ea4\u6362\u673a\u4e92\u8054\u9a8c\u8bc1 PVID \u529f\u80fd<\/li>\n<\/ul>\n<h3><strong><b>2. \u5173\u952e\u524d\u63d0<\/b><\/strong><\/h3>\n<p><strong><b>PVID \u7684\u6838\u5fc3\u4f7f\u7528\u89c4\u5219<\/b><\/strong>\uff1aPVID\uff08\u7aef\u53e3\u9ed8\u8ba4 VLAN ID\uff09\u4ec5\u80fd\u5728 Trunk \u63a5\u53e3\u914d\u7f6e\uff0cAccess \u63a5\u53e3\u65e0\u9700\u624b\u52a8\u8bbe\u7f6e PVID\uff08\u5176 PVID \u9ed8\u8ba4\u7b49\u4e8e\u6240\u5c5e\u7684 Access VLAN\uff0c\u4e0d\u53ef\u4fee\u6539\uff09\u3002PVID \u7684\u4f5c\u7528\uff1a\u5f53\u65e0\u6807\u7b7e\u6570\u636e\u5e27\u8fdb\u5165 Trunk \u63a5\u53e3\u65f6\uff0c\u4ea4\u6362\u673a\u4f1a\u81ea\u52a8\u7ed9\u8be5\u6570\u636e\u5e27\u6253\u4e0a PVID \u5bf9\u5e94\u7684 VLAN \u6807\u7b7e\uff1b\u5f53\u5e26\u6709 PVID \u6807\u7b7e\u7684\u6570\u636e\u5e27\u4ece Trunk \u63a5\u53e3\u53d1\u51fa\u65f6\uff0c\u4f1a\u5265\u79bb\u6807\u7b7e\u4ee5\u65e0\u6807\u7b7e\u5f62\u5f0f\u8f6c\u53d1\u3002<\/p>\n<h2><strong><b>\u4e8c\u3001\u914d\u7f6e<\/b><\/strong><strong><b>\u6b65\u9aa4<\/b><\/strong><\/h2>\n<h3><strong><b>1. \u4ea4\u6362\u673a LSW1 \u914d\u7f6e<\/b><\/strong><\/h3>\n<pre>\/\/ 1. \u521b\u5efaVLAN 3\uff08\u7528\u4e8e\u5173\u8054PC1\u7684\u63a5\u5165\u7aef\u53e3\uff09\n\nvlan 3\n\n\/\/ 2. \u914d\u7f6ePC1\u7684\u63a5\u5165\u7aef\u53e3\uff08Access\u6a21\u5f0f\uff09\n\nint g0\/0\/2\n\nport link-type access \u00a0\/\/ \u63a5\u5165\u7aef\u53e3\u8bbe\u4e3aAccess\u6a21\u5f0f\uff0c\u8fde\u63a5\u7ec8\u7aef\n\nport default vlan 3 \u00a0\u00a0\u00a0\/\/ \u5c06\u8be5\u7aef\u53e3\u5212\u5165VLAN 3\uff0cAccess\u63a5\u53e3PVID\u9ed8\u8ba4=3\n\n\/\/ 3. \u914d\u7f6e\u4e0eLSW2\u4e92\u8054\u7684Trunk\u63a5\u53e3\uff08\u6838\u5fc3PVID\u914d\u7f6e\uff09\n\nint g0\/0\/1\n\nport link-type trunk \u00a0\/\/ \u4e92\u8054\u7aef\u53e3\u8bbe\u4e3aTrunk\u6a21\u5f0f\uff0c\u5141\u8bb8\u591aVLAN\u6570\u636e\u4f20\u8f93\n\nport trunk allowed-pass vlan all \u00a0\/\/ \u5141\u8bb8\u6240\u6709VLAN\u6570\u636e\u901a\u8fc7Trunk\u94fe\u8def\n\nport trunk pvid vlan 3 \u00a0\/\/ \u5173\u952e\uff1a\u8bbe\u7f6e\u8be5Trunk\u63a5\u53e3\u7684PVID=3\uff08\u4ec5Trunk\u63a5\u53e3\u652f\u6301\u6b64\u547d\u4ee4\uff09<\/pre>\n<h3><strong><b>2. \u4ea4\u6362\u673a LSW2 \u914d\u7f6e<\/b><\/strong><\/h3>\n<pre>\/\/ 1. \u521b\u5efaVLAN 4\n\nvlan 4\n\n\/\/ 2. \u914d\u7f6e\u4e0eLSW1\u4e92\u8054\u7684Trunk\u63a5\u53e3\uff08\u6838\u5fc3PVID\u914d\u7f6e\uff09\n\nint g0\/0\/1\n\nport link-type trunk \u00a0\/\/ \u4e92\u8054\u7aef\u53e3\u8bbe\u4e3aTrunk\u6a21\u5f0f\n\nport trunk allowed-pass vlan all \u00a0\/\/ \u5141\u8bb8\u6240\u6709VLAN\u6570\u636e\u901a\u8fc7\n\nport trunk pvid vlan 4 \u00a0\/\/ \u5173\u952e\uff1a\u8bbe\u7f6e\u8be5Trunk\u63a5\u53e3\u7684PVID=4\uff08\u4ec5Trunk\u63a5\u53e3\u652f\u6301\uff09\n\n\/\/ 3. PC2\u63a5\u5165\u7aef\u53e3\u9ed8\u8ba4\u914d\u7f6e\u8bf4\u660e\uff1a\u82e5\u672a\u624b\u52a8\u914d\u7f6e\uff0cLSW2\u7684g0\/0\/2\u63a5\u53e3\u9ed8\u8ba4\u5c5e\u4e8eVLAN 1\uff0cPVID=1<\/pre>\n<h2><strong><b>\u4e09\u3001\u9a8c\u8bc1\u7ed3\u679c<\/b><\/strong><\/h2>\n<p>\u5728 PC1 \u7684\u547d\u4ee4\u884c\u4e2d\u6267\u884c ping \u6d4b\u8bd5\uff0c\u9a8c\u8bc1 PVID \u914d\u7f6e\u6709\u6548\u6027\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.htmacg.cn\/uploads\/2025\/12\/23\/694996ffce86a.png\" alt=\"QQ20251223-030712.png\" \/><\/p>\n<p><strong><b>\u7ed3\u679c\u5206\u6790<\/b><\/strong>\uff1aPing \u6d4b\u8bd5 100% \u6210\u529f\uff0c\u8bf4\u660e PVID \u914d\u7f6e\u751f\u6548\u3002\u6570\u636e\u4f20\u8f93\u6d41\u7a0b\uff08PVID \u4f5c\u7528\u4f53\u73b0\uff09\uff1a<\/p>\n<ol>\n<li>PC1 \u53d1\u9001\u65e0\u6807\u7b7e\u6570\u636e\u5e27\uff0c\u901a\u8fc7 LSW1 \u7684 g0\/0\/2 \u63a5\u53e3\uff08Access \u6a21\u5f0f\uff0cVLAN 3\uff09\u8fdb\u5165 LSW1\uff0c\u6570\u636e\u5e27\u88ab\u6253\u4e0a VLAN 3 \u6807\u7b7e\uff1b<\/li>\n<li>\u6570\u636e\u5e27\u901a\u8fc7 LSW1 \u7684 g0\/0\/1 \u63a5\u53e3\uff08Trunk \u6a21\u5f0f\uff0cPVID=3\uff09\u8f6c\u53d1\u65f6\uff0c\u56e0\u6807\u7b7e = PVID\uff0c\u5265\u79bb\u6807\u7b7e\u540e\u4ee5\u65e0\u6807\u7b7e\u5f62\u5f0f\u53d1\u9001\u5230 LSW2\uff1b<\/li>\n<li>LSW2 \u7684 g0\/0\/1 \u63a5\u53e3\uff08Trunk \u6a21\u5f0f\uff0cPVID=4\uff09\u63a5\u6536\u65e0\u6807\u7b7e\u6570\u636e\u5e27\uff0c\u81ea\u52a8\u6253\u4e0a VLAN 4 \u6807\u7b7e\uff0c\u518d\u8f6c\u53d1\u7ed9 PC2\uff1b<\/li>\n<li>\u56de\u5305\u6d41\u7a0b\u540c\u7406\uff0c\u6700\u7ec8\u5b9e\u73b0 PC1 \u4e0e PC2 \u7684\u4e92\u901a\u3002<\/li>\n<\/ol>\n<h2><strong><b>\u56db\u3001PVID \u5feb\u901f\u4f7f\u7528\u603b\u7ed3<\/b><\/strong><\/h2>\n<ol>\n<li>\u9002\u7528\u573a\u666f\uff1a\u4ec5 Trunk \u63a5\u53e3\uff08\u8bbe\u5907\u4e92\u8054\u573a\u666f\uff09\u9700\u914d\u7f6e PVID\uff0cAccess \u63a5\u53e3\uff08\u7ec8\u7aef\u63a5\u5165\u573a\u666f\uff09\u65e0\u9700\u624b\u52a8\u8bbe\u7f6e\uff1b<\/li>\n<li>\u914d\u7f6e\u547d\u4ee4\uff1aport trunk pvid vlan [VLAN\u53f7]\uff08\u9700\u5148\u5c06\u63a5\u53e3\u8bbe\u4e3a Trunk \u6a21\u5f0f\uff09\uff1b<\/li>\n<li>\u6838\u5fc3\u4f5c\u7528\uff1a\u89e3\u51b3\u65e0\u6807\u7b7e\u6570\u636e\u5e27\u5728 Trunk \u94fe\u8def\u4e0a\u7684 VLAN \u5f52\u5c5e\u95ee\u9898\uff0c\u5b9e\u73b0\u4e0d\u540c\u4ea4\u6362\u673a\u95f4\u7ec8\u7aef\u7684\u4e92\u901a\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5b9e\u9a8c\u51c6\u5907 1. \u73af\u5883\u642d\u5efa \u8bbe\u5907\u6e05\u5355\uff1a2 \u53f0\u534e\u4e3a\u4ea4\u6362\u673a\uff08LSW1\u3001LSW2\uff09\u30012 \u53f0 PC \u673a\uff08PC1\u3001PC2\uff09 \u6838\u5fc3\u8bf4\u660e\uff1aPC1 \u548c PC2 \u5904\u4e8e\u540c\u7f51\u6bb5\uff0810.0.0.0 \u7f51\u6bb5\uff09\uff0c\u901a\u8fc7\u4e24\u53f0\u4ea4\u6362\u673a\u4e92\u8054\u9a8c\u8bc1 PVID \u529f\u80fd 2. \u5173\u952e\u524d\u63d0 PVID \u7684\u6838\u5fc3\u4f7f\u7528\u89c4\u5219\uff1aPVID\uff08\u7aef\u53e3\u9ed8\u8ba4 VLAN ID&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-824","post","type-post","status-publish","format-standard","hentry","category-operational_maintenance_simulation"],"_links":{"self":[{"href":"https:\/\/htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts\/824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/htmacg.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/htmacg.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=824"}],"version-history":[{"count":0,"href":"https:\/\/htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts\/824\/revisions"}],"wp:attachment":[{"href":"https:\/\/htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}