{"id":379,"date":"2026-04-29T16:09:20","date_gmt":"2026-04-29T08:09:20","guid":{"rendered":"http:\/\/danielw.top\/?p=379"},"modified":"2026-04-29T16:09:20","modified_gmt":"2026-04-29T08:09:20","slug":"vlan%e6%b8%97%e9%80%8f-%e8%b7%b3%e8%b7%83%e6%94%bb%e5%87%bb","status":"publish","type":"post","link":"http:\/\/danielw.top\/?p=379","title":{"rendered":"VLAN\u6e17\u900f-\u8df3\u8dc3\u653b\u51fb"},"content":{"rendered":"<h1>VLAN\u6e17\u900f<\/h1>\n<h2>VLAN\u4ecb\u7ecd<\/h2>\n<h3>VLAN\u524d\u7f6e\u6982\u5ff5<\/h3>\n<p>\u78b0\u649e\u57df\uff0c\u5e7f\u64ad\u57df\uff0c\u5e7f\u64ad\u98ce\u66b4:<\/p>\n<ul>\n<li><strong>\u78b0\u649e\u57df<\/strong>\uff1a\u4f7f\u7528\u96c6\u7ebf\u5668\u8fde\u63a5\u800c\u6210\u7684\u4ee5\u592a\u7f51\u662f\u4e00\u4e2a\u78b0\u649e\u57df\uff0c\u5373\u6536\u5230\u7684\u6240\u6709\u4ee5\u592a\u7f51\u6570\u636e\u5e27\u4f1a\u88ab\u96c6\u7ebf\u5668\u65e0\u8111\u5e7f\u64ad\u5230\u7f51\u7edc\u4e2d\u9664\u63a5\u6536\u53e3\u4ee5\u5916\u7684\u6bcf\u4e2a\u7aef\u53e3\uff0c\u539f\u56e0\u662f\u96c6\u7ebf\u5668\u5de5\u4f5c\u5728\u7269\u7406\u5c42\uff0c\u6ca1\u6709\u8bc6\u522b\u4e0a\u5c42\u6570\u636e\u94fe\u8def\u5c42\u7684\u4ee5\u592a\u7f51\u6570\u636e\u5e27 (\u5305\u542b\u4e86 MAC \u5730\u5740) \u7ed3\u6784\u7684\u80fd\u529b\u3002<\/li>\n<li><strong>\u5e7f\u64ad\u57df<\/strong>\uff1a\u4f7f\u7528\u4ea4\u6362\u673a\u8fde\u63a5\u800c\u6210\u7684\u4ee5\u592a\u7f51\u662f\u4e00\u4e2a\u5e7f\u64ad\u57df\uff0c\u5373\u6536\u5230\u7684\u4ee5\u592a\u7f51<strong>\u5e7f\u64ad\u5e27<\/strong>\u4f1a\u88ab\u4ea4\u6362\u673a\u8f6c\u53d1\u5230\u9664\u63a5\u6536\u53e3\u4ee5\u5916\u7684\u6bcf\u4e2a\u7aef\u53e3\uff0c\u539f\u56e0\u662f\u4ea4\u6362\u673a\u5de5\u4f5c\u5728\u6570\u636e\u94fe\u8def\u5c42\uff0c\u5177\u6709\u8bc6\u522b MAC \u5730\u5740\u7684\u80fd\u529b\uff0c\u56e0\u6b64\u4e0d\u4f1a\u548c\u96c6\u7ebf\u5668\u4e00\u6837\u5c06<strong>\u5355\u64ad\u5e27<\/strong>\u4e5f\u5e7f\u64ad\u51fa\u53bb\u3002<\/li>\n<li>\u5e7f\u64ad\u98ce\u66b4\uff1a\u540c\u4e00\u4e2a\u7f51\u7edc\u4e2d\u7531\u4e8e\u5145\u65a5\u7740<strong>\u5927\u91cf\u7684\u5e7f\u64ad\u4fe1\u606f<\/strong> \u800c\u5bfc\u81f4\u5360\u7528\u7f51\u7edc\u5e26\u5bbd\u4f7f\u6b63\u5e38\u7f51\u7edc\u4fe1\u53f7\u65e0\u6cd5\u6d41\u901a\u3002\u51fa\u73b0\u5e7f\u64ad\u98ce\u66b4\u540e\u53ea\u80fd\u62d4\u7f51\u7ebf\u6216\u5c06\u4ea4\u6362\u673a\u65ad\u7535\uff0c\u56e0\u4e3a\u4ea4\u6362\u673a\u5de5\u4f5c\u5728\u6570\u636e\u94fe\u8def\u5c42\uff0c\u800c\u6570\u636e\u94fe\u8def\u5c42\u534f\u8bae\u5e76\u6ca1\u6709\u6570\u636e\u5e27\u6700\u5927\u751f\u5b58\u65f6\u95f4 (TTL) \u76f8\u5173\u534f\u8bae\uff0c\u56e0\u6b64\u8def\u7531\u73af\u8def\u7684\u51fa\u73b0\uff0c\u5c31\u4f1a\u4f7f\u5e7f\u64ad\u5e27\u6c38\u4e45\u4fdd\u7559\u5728\u73af\u8def\u4e2d\uff0c\u4f7f\u5f97\u4ea4\u6362\u673a\u4e0d\u65ad\u91cd\u590d\u5e7f\u64ad\uff0c\u9020\u6210\u7f51\u7edc\u62e5\u585e\u3002\u7f51\u7edc\u4e2d\u6700\u5e38\u4f7f\u7528\u5e7f\u64ad\u5e27\u7684\u534f\u8bae\u6709 <a href=\"https:\/\/blog.lololowe.com\/posts\/ae0b\/\" target=\"_blank\"  rel=\"nofollow\" >ARP<\/a>, <a href=\"https:\/\/blog.lololowe.com\/posts\/db6a\/\" target=\"_blank\"  rel=\"nofollow\" >DHCP<\/a>, <a href=\"https:\/\/blog.lololowe.com\/go.html?url=https:\/\/blog.csdn.net\/aikor\/article\/details\/1662338\" target=\"_blank\"  rel=\"nofollow\" >IPX\/SPX<\/a> \u7b49\u3002<\/li>\n<\/ul>\n<p>\u8def\u7531\u5668\u9694\u79bb\u5e7f\u64ad\u57df\uff0c\u4ea4\u6362\u673a\u9694\u79bb\u78b0\u649e\u57df:<\/p>\n<ul>\n<li>\u901a\u5e38\u4e3a\u4e86\u6269\u5c55\u4ee5\u592a\u7f51\u7684\u8303\u56f4\uff0c\u4f1a\u5c06\u591a\u53f0\u4ea4\u6362\u673a\u4e92\u8fde (\u6269\u5927\u4e86\u5e7f\u64ad\u57df),  \u7136\u800c\u4ea4\u6362\u673a\u53ea\u80fd\u9694\u79bb\u78b0\u649e\u57df\uff0c\u56e0\u6b64\u5f53\u5e7f\u64ad\u57df\u8fc7\u5927\u65f6\uff0c\u66f4\u5bb9\u6613\u9020\u6210\u5e7f\u64ad\u98ce\u66b4\uff0c\u4e3a\u6b64\u9700\u8981\u5206\u5272\u5e7f\u64ad\u57df\u3002\u4f7f\u7528\u8def\u7531\u5668\u5c31\u53ef\u4ee5\u5c06\u4e00\u4e2a\u5e7f\u64ad\u57df\u5206\u5272\u6210\u4e24\u4e2a\u8f83\u5c0f\u7684\u5e7f\u64ad\u57df\uff0c\u56e0\u4e3a\u8def\u7531\u5668\u5de5\u4f5c\u5728\u7f51\u7edc\u4f53\u7cfb\u7ed3\u6784\u7684\u7b2c\u4e09\u5c42 (\u7f51\u7edc\u5c42), \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e0d\u5bf9\u5e7f\u64ad\u6570\u636e\u5305\u8fdb\u884c\u8f6c\u53d1\uff0c\u56e0\u6b64\u8def\u7531\u5668\u5f88\u81ea\u7136\u5730\u5c31\u53ef\u4ee5\u9694\u79bb\u5e7f\u64ad\u57df\u3002\u4f46\u95ee\u9898\u662f<strong>\u8def\u7531\u5668\u7684\u6210\u672c\u5f88\u9ad8<\/strong>\u3002<\/li>\n<\/ul>\n<h3>VLAN \u5f15\u5165\u7684\u65b0\u5185\u5bb9<\/h3>\n<p>\u865a\u62df\u5c40\u57df\u7f51 VLAN (<strong>V<\/strong>irtual <strong>L<\/strong>ocal <strong>A<\/strong>rea <strong>N<\/strong>etwork) \u662f\u4e00\u79cd\u5c06\u5c40\u57df\u7f51\u5185\u7684\u8bbe\u5907\u5212\u5206\u6210\u4e0e\u7269\u7406\u4f4d\u7f6e\u65e0\u5173 (\u540c\u4e00\u4e2a VLAN \u4e0b\u7684\u8bbe\u5907\u53ef\u4ee5\u8fde\u63a5\u5728\u4e0d\u540c\u7684\u4ea4\u6362\u673a\u4e0a) \u7684\u903b\u8f91\u7ec4\u7684\u6280\u672f\uff0c\u8fd9\u4e9b\u903b\u8f91\u7ec4\u5177\u6709\u67d0\u4e9b\u5171\u540c\u7684\u9700\u6c42 (\u6bd4\u5982\u4e3a\u540c\u4e00\u4e2a\u90e8\u95e8)\u3002<\/p>\n<p>VLAN \u8981\u6c42\u4ea4\u6362\u673a\u5b9e\u73b0\u4e24\u5927\u529f\u80fd\uff0c\u4e00\u4e2a\u662f\u80fd\u591f\u5904\u7406<strong>\u5e26\u6709 VLAN \u6807\u8bb0\u7684\u5e27<\/strong> , \u4e5f\u5c31\u662f IEEEE  <strong>802.1Q \u5e27<\/strong>\u3002\u53e6\u4e00\u4e2a\u662f\u4ea4\u6362\u673a\u7684\u5404\u7aef\u53e3\u53ef\u652f\u6301<strong>\u4e0d\u540c\u7684\u63a5\u53e3\u7c7b\u578b<\/strong>\u3002\u4e0d\u540c\u63a5\u53e3\u7c7b\u578b\u7684\u7aef\u53e3\u5bf9\u5e27\u7684\u5904\u7406\u65b9\u5f0f\u6709\u6240\u4e0d\u540c\u3002<\/p>\n<h4>802.1Q \u5e27<\/h4>\n<p>802.1Q \u5e27\u4e5f\u79f0\u4e3a Dot One Q \u5e27\uff0c\u662f\u5728<a href=\"https:\/\/blog.lololowe.com\/go.html?url=https:\/\/www.bilibili.com\/video\/BV19t4y1g7Ms\" target=\"_blank\"  rel=\"nofollow\" >\u4ee5\u592a\u7f51 MAC \u5e27\u683c\u5f0f<\/a>\u8fdb\u884c\u4e86\u6269\u5c55\uff0c\u63d2\u5165\u4e86 4 \u5b57\u8282\u7684 VLAN \u6807\u8bb0:<\/p>\n<p><a href=\"https:\/\/blog.lololowe.com\/posts\/9c91\/2024-12-16.jpg\" alt=\"VLAN\u6e17\u900f-\u8df3\u8dc3\u653b\u51fb\" title=\"VLAN\u6e17\u900f-\u8df3\u8dc3\u653b\u51fb\" target=\"_blank\"  rel=\"nofollow\" ><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/2024-12-16.jpg\" alt=\"alt text\" \/><\/a><\/p>\n<p>802.1Q \u5e27\u683c\u5f0f\u8be6\u89e3\uff1a<a href=\"https:\/\/blog.lololowe.com\/go.html?url=https:\/\/www.cnblogs.com\/mutudou\/p\/14244640.html\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/www.cnblogs.com\/mutudou\/p\/14244640.html<\/a><\/p>\n<p><strong>\u91cd\u70b9<\/strong>\uff1a<\/p>\n<ol>\n<li>VLAN \u6807\u8bb0\u7684\u6700\u540e 12 \u6bd4\u7279\u79f0\u4e3a <strong>VLAN \u6807\u8bc6\u7b26 ID (VID)<\/strong>, \u5b83\u552f\u4e00\u7684\u6807\u5fd7\u4e86\u4ee5\u592a\u7f51\u5e27\u5c5e\u4e8e\u54ea\u4e00\u4e2a VLAN\u3002\n<ul>\n<li>VID \u7684\u8303\u56f4\u662f 0 ~ 4095 (0 ~ 2^12-1)<\/li>\n<li>0 \u548c 4095 \u90fd\u4e0d\u7528\u6765\u8868\u793a VLAN, \u56e0\u6b64\u8868\u793a VLAN \u7684 VID \u7684\u6709\u6548\u53d6\u503c\u8303\u56f4\u662f 1 ~ 4094\u3002<\/li>\n<\/ul>\n<\/li>\n<li>802.1Q \u5e27\u662f<strong>\u7531\u4ea4\u6362\u673a\u6765\u5904\u7406<\/strong>\u7684\uff0c\u800c\u4e0d\u662f\u7531\u7528\u6237\u4e3b\u673a\u6765\u5904\u7406\u7684\u3002\n<ul>\n<li>\u5f53\u4ea4\u6362\u673a\u6536\u5230\u666e\u901a\u7684\u4ee5\u592a\u7f51\u5e27\u65f6\uff0c\u4f1a\u5c06\u5176\u63d2\u5165 4 \u5b57\u8282\u7684 VLAN \u6807\u8bb0\u8f6c\u53d8\u4e3a 802.1Q \u5e27\uff0c\u7b80\u79f0<strong>\u6253\u6807\u7b7e<\/strong>.<\/li>\n<li>\u5f53\u4ea4\u6362\u673a\u8f6c\u53d1 802.1Q \u5e27\u65f6\uff0c<strong>\u53ef\u80fd\u4f1a<\/strong>\u5220\u9664\u5176 4 \u5b57\u8282 VLAN \u6807\u8bb0\u8f6c\u53d8\u4e3a\u666e\u901a\u4ee5\u592a\u7f51\u5e27 (\u53d6\u51b3\u4e8e\u7aef\u53e3\u7684 PVID \u4e0e 802.1Q \u5e27\u7684 VID \u662f\u5426\u76f8\u540c\uff0c\u76f8\u540c\u5219\u53bb\u6807\u7b7e\u8f6c\u53d1\uff0c\u5426\u5219\u76f4\u63a5\u8f6c\u53d1), \u7b80\u79f0<strong>\u53bb\u6807\u7b7e<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u4ea4\u6362\u673a\u63a5\u53e3\u7c7b\u578b<\/h3>\n<p>\u4ea4\u6362\u673a\u7684\u63a5\u53e3\u7c7b\u578b\u6709\u4e09\u79cd:<\/p>\n<ol>\n<li>Access (\u8bbf\u95ee)<\/li>\n<li>Trunk (\u4e2d\u7ee7)<\/li>\n<li>Hybrid (\u6df7\u5408)<\/li>\n<\/ol>\n<blockquote>\n<p>\u4e09\u79cd\u7c7b\u578b\u4e2d\uff0cHybrid \u63a5\u53e3\u7c7b\u578b\u662f\u7531\u534e\u4e3a\u516c\u53f8\u5f00\u53d1\u7684\uff0c\u800c\u601d\u79d1\u4ea4\u6362\u673a\u5e76\u4e0d\u652f\u6301 Hybrid \u7c7b\u578b\u3002<\/p>\n<\/blockquote>\n<p>\u5728\u4ecb\u7ecd\u8fd9\u4e09\u79cd\u4ea4\u6362\u673a\u63a5\u53e3\u7c7b\u578b\u4e4b\u524d\uff0c\u9996\u5148\u8981\u4e86\u89e3\u4e00\u4e0b\u7aef\u53e3\u7684<strong>\u7f3a\u7701 VLAN ID<\/strong> \u8fd9\u4e2a\u6982\u5ff5\uff1a<\/p>\n<ul>\n<li>\n<p>\u7f3a\u7701 VLAN ID \u662f\u6307\u5728\u4ea4\u6362\u673a\u4e0a\u7535\u542f\u52a8\u65f6\uff0c\u672a\u7ecf\u914d\u7f6e\u7684\u63a5\u53e3\u6240\u81ea\u52a8\u5206\u914d\u7684 VLAN (\u901a\u5e38\u662f <strong>VLAN 1<\/strong>)\u3002<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e8e\u601d\u79d1\u4ea4\u6362\u673a\uff0c\u63a5\u53e3\u7684\u7f3a\u7701 VLAN ID \u79f0\u4e3a<strong>\u672c\u5f81 VLAN<\/strong>(Native VLAN)\uff1b\u601d\u79d1\u4ea4\u6362\u673a\u5728\u7528\u6237\u672a\u914d\u7f6e VLAN \u65f6\uff0c\u6240\u6709\u7aef\u53e3\u90fd\u9ed8\u8ba4\u5c5e\u4e8e VLAN 1, \u5373\u6240\u6709\u7aef\u53e3\u7684\u672c\u5f81 VLAN \u7684\u503c\u90fd\u662f 1\u3002<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u4e8e\u534e\u4e3a\u4ea4\u6362\u673a\uff0c\u63a5\u53e3\u7684\u7f3a\u7701 VLAN ID \u79f0\u4e3a\u7aef\u53e3 VLAN ID (Port VLAN ID)\uff0c\u7b80\u79f0\u4e3a <strong>PVID<\/strong>\u3002\u534e\u4e3a\u4ea4\u6362\u673a\u5728\u7528\u6237\u672a\u914d\u7f6e VLAN \u65f6\uff0c\u6240\u6709\u7aef\u53e3\u90fd\u9ed8\u8ba4\u5c5e\u4e8e VLAN 1, \u5373\u6240\u6709\u7aef\u53e3\u7684 PVID \u503c\u90fd\u662f 1\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u7b80\u5355\u8d77\u89c1\uff0c\u4e0b\u9762\u5c06\u7edf\u4e00\u4f7f\u7528 PVID \u6765\u8868\u793a\u7aef\u53e3\u7684\u7f3a\u7701 VLAN ID\u3002<\/p>\n<blockquote>\n<p>\u5176\u4e2d\uff0c\u201cLink Type\u201d\u8868\u793a\u63a5\u53e3\u7684\u63a5\u53e3\u7c7b\u578b\uff0c\u201cPVID\u201d\u8868\u793a\u63a5\u53e3\u4e0a\u7684\u7f3a\u7701VLAN\uff0c\u201cTrunk VLAN  List\u201d\u8868\u793aTrunk\u63a5\u53e3\u4e0a\u5141\u8bb8\u901a\u8fc7\u7684VLAN\u5217\u8868\uff0c\u6216Hybrid\u63a5\u53e3\u4e0a\u4ee5Tagged\u65b9\u5f0f\u52a0\u5165\u7684VLAN\u3002\u5982\u679c\u63a5\u53e3\u7c7b\u578b\u662fAccess\uff0c\u6216Hybrid\u63a5\u53e3\u6ca1\u6709\u4ee5Tagged\u65b9\u5f0f\u52a0\u5165VLAN\uff0c\u8be5\u5904\u663e\u793a\u201c-\u201d<\/p>\n<\/blockquote>\n<\/li>\n<\/ul>\n<h4>Access \u7aef\u53e3<\/h4>\n<ol>\n<li>Access \u7aef\u53e3\u4e00\u822c\u7528\u4e8e\u8fde\u63a5\u7528\u6237\u8ba1\u7b97\u673a\u3002<\/li>\n<li>\u601d\u79d1\u4ea4\u6362\u673a\u6240\u6709\u7aef\u53e3\u7684\u9ed8\u8ba4\u63a5\u53e3\u7c7b\u578b\u5c31\u662f Access\u3002<\/li>\n<li>Access \u7aef\u53e3\u53ea\u80fd\u5c5e\u4e8e\u4e00\u4e2a VLAN\u3002<\/li>\n<li>Access \u7aef\u53e3\u7684 <strong>PVID \u503c\u4e0e\u7aef\u53e3\u6240\u5c5e VLAN \u7684 ID \u76f8\u540c<\/strong> (\u9ed8\u8ba4\u4e3a 1)\u3002<\/li>\n<li>Access \u7aef\u53e3<strong>\u63a5\u6536\u5e27<\/strong>\u5904\u7406\u65b9\u6cd5\uff1a\u4e00\u822c\u53ea\u63a5\u53d7<strong>\u672a\u6253\u6807\u7b7e<\/strong>\u7684\u666e\u901a\u4ee5\u592a\u7f51 MAC \u5e27\uff0c\u6839\u636e\u63a5\u6536\u5e27\u7684\u63a5\u53e3\u7684 PVID \u7ed9\u5e27<strong>\u6253\u6807\u7b7e<\/strong> , \u5373\u63d2\u5165 4 \u5b57\u8282\u7684 VLAN \u6807\u7b7e\u5b57\u6bb5\uff0c <strong>VLAN \u6807\u7b7e\u5b57\u6bb5\u4e2d\u7684 VID \u53d6\u503c\u5c31\u662f\u63a5\u53e3\u7684 PVID \u503c<\/strong>\u3002<\/li>\n<li>Access \u7aef\u53e3<strong>\u8f6c\u53d1\u5e27<\/strong>\u5904\u7406\u65b9\u6cd5\uff1a\u82e5\u5e27\u4e2d\u7684 VID \u503c\u4e0e\u63a5\u53e3\u7684 PVID \u503c\u76f8\u7b49\uff0c\u5219\u7ed9\u5e27<strong>\u53bb\u6807\u7b7e\u8f6c\u53d1<\/strong> , \u5426\u5219<strong>\u4e0d\u8f6c\u53d1<\/strong>\u5e27\u3002\u56e0\u6b64\u4ece Access \u63a5\u53e3\u8f6c\u53d1\u51fa\u7684\u5e27\uff0c\u662f\u4e0d\u5e26 VLAN \u6807\u7b7e\u7684\u666e\u901a\u4ee5\u592a\u7f51 MAC \u5e27\u3002<\/li>\n<\/ol>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\"><strong>\u6570\u636e\u65b9\u5411<\/strong><\/th>\n<th style=\"text-align: left;\"><strong>\u53d1\u751f\u4e86\u4ec0\u4e48<\/strong><\/th>\n<th style=\"text-align: left;\"><strong>\u6807\u7b7e\u72b6\u6001<\/strong><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>\u7535\u8111 \u2192 \u4ea4\u6362\u673a<\/strong><\/td>\n<td style=\"text-align: left;\">\u7535\u8111\u53d1\u51fa<strong>\u65e0\u6807\u7b7e<\/strong>\u7684\u666e\u901a\u5e27 \u2192 \u8fdb\u5165\u4ea4\u6362\u673a\u7aef\u53e3 \u2192 \u4ea4\u6362\u673a\u6839\u636e\u7aef\u53e3PVID\uff08\u4f8b\u598220\uff09<strong>\u6253\u4e0aVLAN 20\u6807\u7b7e<\/strong><\/td>\n<td style=\"text-align: left;\"><strong>\u65e0\u6807\u7b7e \u2192 \u6709\u6807\u7b7e<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>\u4ea4\u6362\u673a \u2192 \u7535\u8111<\/strong><\/td>\n<td style=\"text-align: left;\">\u4ea4\u6362\u673a\u5185\u90e8\u5e26\u6709VLAN 20\u6807\u7b7e\u7684\u5e27 \u2192 \u51c6\u5907\u4ece\u7aef\u53e3\u53d1\u51fa \u2192 \u4ea4\u6362\u673a<strong>\u5265\u79bbVLAN 20\u6807\u7b7e<\/strong> \u2192 \u7535\u8111\u6536\u5230<strong>\u65e0\u6807\u7b7e<\/strong>\u7684\u666e\u901a\u5e27<\/td>\n<td style=\"text-align: left;\"><strong>\u6709\u6807\u7b7e \u2192 \u65e0\u6807\u7b7e<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Trunk \u7aef\u53e3<\/h4>\n<ol>\n<li>Trunk \u7aef\u53e3\u4e00\u822c\u7528\u4e8e\u4ea4\u6362\u673a\u4e4b\u95f4\u6216\u4ea4\u6362\u673a\u4e0e\u8def\u7531\u5668\u4e4b\u95f4\u7684\u4e92\u8fde\u3002<\/li>\n<li>Trunk \u7aef\u53e3\u53ef\u4ee5\u5c5e\u4e8e\u591a\u4e2a VLAN, \u4e5f\u5c31\u662f\u8bf4 Trunk \u7aef\u53e3\u53ef\u4ee5\u63a5\u6536\u548c\u53d1\u9001\u5c5e\u4e8e\u4e0d\u540c VLAN \u7684\u5e27\u3002<\/li>\n<li>Trunk \u7aef\u53e3\u7684<strong>\u9ed8\u8ba4 PVID \u503c\u662f 1<\/strong>(\u517c\u5bb9\u6027\u8003\u8651)\u3002\u901a\u5e38\u4e0d\u5efa\u8bae\u7528\u6237\u66f4\u6539\u8fd9\u4e2a\u503c\uff0c\u56e0\u4e3a\u5982\u679c\u4e24\u4e2a\u4e92\u8fde\u7684 Trunk \u63a5\u53e3\u7684 PVID \u503c\u4e0d\u540c\uff0c\u6570\u636e\u4f20\u8f93\u53ef\u80fd\u4f1a\u51fa\u9519\u3002<\/li>\n<li>Trunk \u7aef\u53e3<strong>\u63a5\u6536\u5e27<\/strong>\u5904\u7406\u65b9\u6cd5\uff1a\u65e2\u53ef\u4ee5\u63a5\u6536<strong>\u672a\u6253\u6807\u7b7e<\/strong>\u7684\u666e\u901a\u4ee5\u592a\u7f51 MAC \u5e27\uff0c\u4e5f\u53ef\u4ee5\u63a5\u6536<strong>\u5df2\u6253\u6807\u7b7e<\/strong>\u7684 802.1Q \u5e27\u3002\u82e5\u63a5\u6536\u5230\u666e\u901a\u4ee5\u592a\u7f51 MAC \u5e27\u65f6\uff0c\u6839\u636e\u63a5\u6536\u5e27\u7684\u63a5\u53e3\u7684 PVID \u7ed9\u5e27\u6253\u6807\u7b7e\uff0c\u8fd9\u4e0e Access \u63a5\u53e3\u7684\u5904\u7406\u76f8\u540c\uff0c\u5373\u63d2\u5165 4 \u5b57\u8282\u7684 VLAN \u6807\u7b7e\u5b57\u6bb5\uff0cVLAN \u6807\u7b7e\u5b57\u6bb5\u4e2d\u7684 VID \u53d6\u503c\u5c31\u662f\u63a5\u53e3\u7684 PVID \u503c\u3002<\/li>\n<li>Trunk \u7aef\u53e3<strong>\u8f6c\u53d1\u5e27<\/strong>\u5904\u7406\u65b9\u6cd5\uff1a\u5bf9\u4e8e VID \u503c\u7b49\u4e8e\u63a5\u53e3\u7684 PVID \u503c\u7684 802.1Q \u5e27\uff0c\u5c06\u5176<strong>\u53bb\u6807\u7b7e\u8f6c\u53d1<\/strong> ; \u5bf9\u4e8e VID \u503c\u4e0d\u7b49\u4e8e\u63a5\u53e3\u7684 PVID \u503c 802.1Q \u5e27\uff0c\u5c06\u5176<strong>\u76f4\u63a5\u8f6c\u53d1<\/strong> (Access \u63a5\u53e3\u5219\u76f4\u63a5\u4e22\u5f03)\u3002\u56e0\u6b64\uff0c\u4ece Trunk \u63a5\u53e3\u8f6c\u53d1\u51fa\u7684\u5e27\uff0c\u53ef\u80fd\u662f\u666e\u901a\u4ee5\u592a\u7f51 MAC \u5e27\u4e5f\u53ef\u80fd\u662f 802.1Q \u5e27<\/li>\n<\/ol>\n<h4>Hybrid \u7aef\u53e3<\/h4>\n<p>Hybrid \u63a5\u53e3\u662f\u534e\u4e3a\u5f00\u53d1\u51fa\u7684\u4ea4\u6362\u673a\u63a5\u53e3\u7c7b\u578b\u3002Hybrid \u63a5\u53e3\u65e2\u53ef\u4ee5\u7528\u4e8e\u4ea4\u6362\u673a\u4e4b\u95f4\u7684\u4e92\u8fde (\u4e0e Trunk \u63a5\u53e3\u76f8\u540c),  \u4e5f\u53ef\u7528\u4e8e\u4ea4\u6362\u673a\u4e0e\u7528\u6237\u8ba1\u7b97\u673a\u4e4b\u95f4\u7684\u4e92\u8fde (\u4e0e Access \u63a5\u53e3\u76f8\u540c), \u9664\u6b64\u4e4b\u5916\uff0cHybrid \u63a5\u53e3\u7684\u7edd\u5927\u90e8\u5206\u529f\u80fd\u4e0e Trunk \u63a5\u53e3\u76f8\u540c\u3002<strong>\u4e0d\u540c\u70b9<\/strong>\u5728\u4e8e Hybrid \u63a5\u53e3\u7684\u8f6c\u53d1\u5904\u7406: Hybrid \u63a5\u53e3\u4f1a\u67e5\u770b\u5e27\u7684 VID \u503c\u662f\u5426\u5728\u63a5\u53e3\u7684<strong>\u53bb\u6807\u7b7e\u5217\u8868<\/strong>\u4e2d\uff0c\u82e5\u5b58\u5728\u5219 \u201c\u53bb\u6807\u7b7e\u201d \u540e\u8f6c\u53d1\uff0c\u82e5\u4e0d\u5b58\u5728\u5219\u76f4\u63a5\u8f6c\u53d1\u3002<\/p>\n<blockquote>\n<p>\u534e\u4e3a\u4ea4\u6362\u673a\u6240\u6709\u7aef\u53e3\u7684\u9ed8\u8ba4\u63a5\u53e3\u7c7b\u578b\u5c31\u662f Hybrid\u3002<\/p>\n<\/blockquote>\n<h4>PVID\u6d4b\u8bd5<\/h4>\n<p>\u7f3a\u7701\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u7684\u7aef\u53e3\u90fd\u5728vlan 1\u4e2d\uff0c\u6240\u6709\u7684\u7aef\u53e3\u7684PVID\u6807\u8bc6\u7f3a\u7701\u90fd\u4e3a1<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429101846399.png\" alt=\"image-20260429101846399\" style=\"zoom: 80%;\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429102311692.png\" alt=\"image-20260429102311692\" style=\"zoom:80%;\" \/><\/p>\n<p>\u5bf9\u63a5\u53e3\u8fdb\u884c\u5982\u4e0b\u914d\u7f6e\u540e\u67e5\u770b\u76f8\u5e94\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash\">vlan batch 20 30 40 # \u6279\u91cf\u521b\u5efaVLAN  \n\ninterface GE 1\/0\/0\n port link- type trunk\n port trunk pvid vlan 20\n port trunk allow-pass vlan 20 30 40\n\ninterface GE 1\/0\/2\n port link-type access\n port default vlan 20\n\ninterface GE 1\/0\/3\n port link-type access\n port default vlan 30\n\ninterface GE 1\/0\/4\n port link-type access\n port default vlan 40<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429104345151.png\" alt=\"image-20260429104345151\" style=\"zoom:67%;\" \/><\/p>\n<p>\u53ef\u89c1\u914d\u7f6e\u5b8c access \u7c7b \u578b\u7684\u63a5\u53e3\u540e,\u8be5\u7aef\u53e3\u7f3a\u7701PVID\u7531\u539f\u6765\u76841\u53d8\u6210\u4e86\u914d\u7f6e\u7684\u6240\u5c5evlan\u7684Vlan ID\uff0c\u547d\u4ee4<code>port trunk pvid vlan 20<\/code>\uff0c\u914d\u7f6e\u5b8cTrunk\u7c7b\u578b\u7684\u63a5\u53e3\uff0c\u5982\u679c\u624b\u52a8\u6307\u5b9a\u8be5\u7aef\u53e3\u7684PVID\uff0c\u5219trunk\u7aef\u53e3\u7684PVID\u5c06\u7531\u539f\u6765\u7684PVID=1\u53d8\u6210\u624b\u52a8\u914d\u7f6e\u6307\u5b9a\u7684PVID=20<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429104558849.png\" alt=\"image-20260429104558849\" style=\"zoom:67%;\" \/><br \/>\n<img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429105728187.png\" alt=\"image-20260429105728187\" style=\"zoom:67%;\" \/><\/p>\n<p>\u4e0a\u56fe\u53ef\u4ee5\u53d1\u73b0\u7aef\u53e3\u7684PVID\u5c5e\u6027\u4e00\u76f4\u5b58\u5728\uff0c\u4e0d\u7ba1\u914d\u7f6e\u6216\u8005\u672a\u914d\u7f6ePVID\u90fd\u5b58\u5728\uff0ctrunk\u7c7b\u578b\u7684\u63a5\u53e3\u4e0b\uff0c\u7aef\u53e3\u53ef\u4ee5\u6709\u591a\u4e2avlan\uff0c\u5982\u4e0a\u9762\u622a\u56fe\u4e2d\uff0cTrunk link list \u5217\u8868\u662f1\u300120\u300130\u300140\u8fd9\u51e0\u4e2aVLan\uff0cPVID\u901a\u8fc7\u914d\u7f6e\u53ef\u4ee5\u6539\u53d8,\u4f46\u662f\u4e00\u4e2a\u7aef\u53e3\u6709\u4e14\u4ec5\u6709\u4e00\u4e2aPVID<\/p>\n<p>\u7279\u522b\u9700\u8981\u6ce8\u610f\u8fd9\u4e2a\u5168\u5c40vlan 1\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ctrunk\u7aef\u53e3\u90fd\u662f\u5141\u8bb8vlan 1\u901a\u8fc7\u7684\uff0c\u9664\u975e\u7981\u6b62vlan 1\u901a\u8fc7\uff0c\u914d\u7f6e\u547d\u4ee4\u5982\u4e0b\uff1a <code>undo port trunk allow-pass vlan1<\/code>\u5bf91\/0\/1\u63a5\u53e3\u8f93\u5165\u8fd9\u6761\u547d\u4ee4\u540e\u4ea7\u751f\u5982\u4e0b\u6548\u679c<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429110236425.png\" alt=\"image-20260429110236425\" style=\"zoom:67%;\" \/><\/p>\n<p>\u5bf91\/0\/0\u63a5\u53e3\u8f93\u5165\u8fd9\u6761\u547d\u4ee4\u540e\u4ea7\u751f\u5982\u4e0b\u6548\u679c\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429110434854.png\" alt=\"image-20260429110434854\" style=\"zoom:67%;\" \/><\/p>\n<p>\u6ce8\u610f\u4ee5\u4e0b\u4e24\u4e2a\u7279\u5f81\uff0c<\/p>\n<ul>\n<li>UT(Untagged)\uff1a\u8868\u793a\u8be5 VLAN \u7684\u6570\u636e\u4ece\u8fd9\u4e2a\u7aef\u53e3\u53d1\u51fa\u65f6\u4f1a\u5265\u79bb\u6807\u7b7e\u3002Access \u7aef\u53e3\u548c Hybrid \u7aef\u53e3\uff08\u90e8\u5206\u914d\u7f6e\u4e0b\uff09\u901a\u5e38\u663e\u793a\u4e3a UT\u3002<\/li>\n<li>TG(Tagged)\uff1a\u8868\u793a\u8be5 VLAN \u7684\u6570\u636e\u4ece\u8fd9\u4e2a\u7aef\u53e3\u53d1\u51fa\u65f6\u4f1a\u643a\u5e26\u6807\u7b7e\u3002\u8fd9\u662f Trunk \u7aef\u53e3\u6216 Hybrid \u7aef\u53e3\u7684\u5178\u578b\u7279\u5f81\u3002<\/li>\n<\/ul>\n<p>1\/0\/0\u8fd9\u4e2a\u662ftag\u7684\uff0cvlan 30\u5728trunk\u5141\u8bb8\u901a\u8fc7\u7684\u5217\u8868\u4e2d\uff0c\u8fd9\u91ccg0\/0\/1\u4e2d\u6211\u8bbe\u7f6e\u7684pvid=20\uff0cvlan 30\u7684\u5e27vid=pvid=30\uff0c\u548c\u8be5\u7aef\u53e3pvid\u6bd4\u8f83\uff0c<strong>\u4e0d\u76f8\u540c<\/strong>\uff0c\u6240\u4ee5\u76f4\u63a5\u901a\u8fc7\u8be5\u7aef\u53e3\u8f6c\u53d1\u4e0d\u8fdb\u884c\u5e27\u5265\u79bb<\/p>\n<p><strong>\u60c5\u666f\u4e00\uff1a\u8f6c\u53d1VLAN 30\u7684\u5e27\uff08\u5bf9\u5e94\u60a8\u7684\u63cf\u8ff0\uff09<\/strong><\/p>\n<ol>\n<li>\u4ea4\u6362\u673a\u5185\u90e8\u6709\u4e00\u4e2a<strong>\u76ee\u6807MAC\u5730\u5740\u5728VLAN 30\u4e2d<\/strong>\uff0c\u4e14\u9700\u8981\u4ece <code>G0\/0\/1<\/code>\u53d1\u51fa\u7684\u6570\u636e\u5e27\u3002<\/li>\n<li>\u51fa\u53e3\u7aef\u53e3 <code>G0\/0\/1<\/code>\u662fTrunk\uff0c\u4e14\u5141\u8bb8VLAN 30\u901a\u8fc7\u3002<\/li>\n<li>\u4ea4\u6362\u673a\u68c0\u67e5\uff1a\u5e27\u7684 <strong>VID (30)<\/strong> \u2260 \u7aef\u53e3\u7684 <strong>PVID (20)<\/strong>\u3002<\/li>\n<li><strong>\u5224\u51b3<\/strong>\uff1a\u4fdd\u7559\u6807\u7b7e\uff0c\u76f4\u63a5\u8f6c\u53d1\u3002<\/li>\n<li><strong>\u7ed3\u679c<\/strong>\uff1a\u5bf9\u7aef\u4ea4\u6362\u673a\u6536\u5230\u4e00\u4e2a\u5e26\u6709<code>VLAN 30<\/code>\u6807\u7b7e\u7684\u5e27\uff0c\u53ef\u4ee5\u6b63\u786e\u5904\u7406\u3002<\/li>\n<\/ol>\n<p><strong>\u60c5\u666f\u4e8c\uff1a\u8f6c\u53d1VLAN 20\u7684\u5e27<\/strong><\/p>\n<ol>\n<li>\u4ea4\u6362\u673a\u5185\u90e8\u6709\u4e00\u4e2a<strong>\u76ee\u6807MAC\u5730\u5740\u5728VLAN 20\u4e2d<\/strong>\uff0c\u4e14\u9700\u8981\u4ece <code>G0\/0\/1<\/code>\u53d1\u51fa\u7684\u6570\u636e\u5e27\u3002<\/li>\n<li>\u51fa\u53e3\u7aef\u53e3 <code>G0\/0\/1<\/code>\u662fTrunk\uff0c\u4e14\u5141\u8bb8VLAN 20\u901a\u8fc7\u3002<\/li>\n<li>\u4ea4\u6362\u673a\u68c0\u67e5\uff1a\u5e27\u7684 <strong>VID (20)<\/strong> = \u7aef\u53e3\u7684 <strong>PVID (20)<\/strong>\u3002<\/li>\n<li><strong>\u5224\u51b3<\/strong>\uff1a\u5265\u79bbVLAN 20\u7684\u6807\u7b7e\uff0c\u7136\u540e\u8f6c\u53d1\u3002<\/li>\n<li><strong>\u7ed3\u679c<\/strong>\uff1a\u5bf9\u7aef\u8bbe\u5907\u6536\u5230\u4e00\u4e2a\u666e\u901a\u7684\u3001\u65e0\u6807\u7b7e\u7684\u4ee5\u592a\u7f51\u5e27\u3002\u5982\u679c\u5bf9\u7aef\u662f\u4e00\u4e2a\u4ea4\u6362\u673a\u7aef\u53e3\u4e14PVID\u4e5f\u662f20\uff0c\u5b83\u4f1a\u5c06\u8fd9\u4e2a\u65e0\u6807\u7b7e\u5e27\u5f52\u7c7b\u5230\u81ea\u5df1\u7684VLAN 20\u4e2d\u3002<\/li>\n<\/ol>\n<h2>VLAN \u8df3\u8dc3\u653b\u51fb<\/h2>\n<p>VLAN \u8df3\u8dc3\u653b\u51fb (VLAN-Hopping) \u6709\u4e24\u79cd\u624b\u6bb5\uff0c\u5206\u522b\u662f<strong>\u53cc\u91cd\u6807\u7b7e<\/strong>\u548c<strong>\u4ea4\u6362\u673a\u6b3a\u9a97<\/strong>\u3002<\/p>\n<h3>\u53cc\u91cd\u6807\u7b7e (Double Tagging)<\/h3>\n<p><strong>\u653b\u51fb\u65b9\u6cd5:<\/strong><\/p>\n<p>\u653b\u51fb\u8005\u8981\u60f3\u5b9e\u65bd\u53cc\u5c42 TAG \u653b\u51fb\u7684\u524d\u63d0\u662f\u63a5\u5165\u7f3a\u7701 VLAN, \u7136\u540e\u5728\u5c01\u88c5\u5e27\u65f6\u524d\u9762\u6253\u4e24\u5c42\u6807\u7b7e\uff0c\u6700\u5916\u9762\u4e00\u5c42\u662f\u7f3a\u7701 VLAN ID,  \u7b2c\u4e8c\u5c42\u662f\u8981\u653b\u51fb\u7684 VLAN ID\u3002\u5f53\u8fd9\u4e2a\u5e27\u8fdb\u5165\u7b2c\u4e00\u53f0\u4ea4\u6362\u673a\u65f6\uff0c\u7b2c\u4e00\u5c42\u6807\u7b7e\u88ab\u53bb\u6389\uff0c\u5e76\u9001\u5165\u7f3a\u7701 VLAN, \u4f8b\u5982\u9ed8\u8ba4\u7684 VLAN 1\u3002\u5f53\u8fd9\u4e2a\u5e27\u8fdb\u5165  sw1 \u548c sw2 \u4e4b\u95f4\u7684 Trunk \u65f6\uff0c\u7531\u4e8e\u5b83\u9ed8\u8ba4\u5904\u4e8e\u7f3a\u7701 VLAN, \u56e0\u6b64\u4e0d\u518d\u5c01\u88c5\u65b0\u7684 TAG, \u8fd9\u6837\u5b83\u539f\u672c\u7684\u7b2c\u4e8c\u5c42 TAG  \u5c31\u663e\u9732\u51fa\u6765\u4e86\u3002\u5f53\u8fdb\u5165 sw2 \u65f6\uff0c\u518d\u6458\u6389\u7b2c\u4e8c\u4e2a TAG, \u4e5f\u5c31\u662f\u60f3\u8981\u653b\u51fb\u7684 VLAN, \u8fd9\u6837\u5c31\u6210\u529f\u5730\u5b9e\u65bd\u4e86 VLAN  \u8df3\u8dc3\u653b\u51fb\uff0c\u4f46\u6b64\u7c7b\u653b\u51fb\u4e3a\u5355\u5411\u653b\u51fb\uff0c\u5373\u6d41\u91cf\u4e0d\u53ef\u56de\uff0c\u901a\u5e38\u5e94\u7528\u5728 DDOS \u653b\u51fb\u4e0a\u3002<\/p>\n<p>\u7ecf\u6d4b\u8bd5\uff0cWindows\u7f51\u5361\u4f1a\u81ea\u52a8\u5265\u79bb\u5916\u5c42\u7684VLAN\u6807\u7b7e\uff0c\u6b64\u5904\u4e0d\u8fdb\u884c\u5b9e\u9a8c\u4ec5\u63cf\u8ff0\u8fc7\u7a0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20260429160456515.png\" alt=\"image-20260429160456515\" style=\"zoom:67%;\" \/><\/p>\n<h4>1. \u3010Cloud1\uff08\u653b\u51fb\u8005\u7aef\uff09\u3011\u53d1\u9001\u7684\u539f\u59cb\u5305<\/h4>\n<p>\u8fd9\u662f\u4f60\u811a\u672c\u6784\u9020\u7684\u5b8c\u6574\u53cc\u5c42 VLAN \u5e27\uff0c<strong>\u53ea\u6709\u5728 Cloud1 \u7684\u51fa\u53e3\u6293\u5305\uff0c\u624d\u80fd\u770b\u5230\u5b8c\u6574\u7ed3\u6784<\/strong>\uff1a<\/p>\n<pre><code>Ethernet\u5934(\u76ee\u7684MAC, \u6e90MAC)\n\u2192 \u5916\u5c42802.1Q\u6807\u7b7e\uff1aVLAN ID=10\uff08TPID=0x8100\uff09\n\u2192 \u5185\u5c42802.1Q\u6807\u7b7e\uff1aVLAN ID=20\uff08TPID=0x8100\uff09\n\u2192 IP\u5934\uff1asrc=192.168.21.1 \u2192 dst=192.168.21.9\n\u2192 \u6570\u636e\u8f7d\u8377\uff08\u6bd4\u5982ICMP\/IP\u6570\u636e\uff09<\/code><\/pre>\n<p>\u5728\u8fd9\u91cc\u6293\u5305\uff0c\u80fd\u770b\u5230<strong>\u4e24\u4e2a\u8fde\u7eed\u7684<code>81 00<\/code>\u6807\u7b7e<\/strong>\uff0c\u5206\u522b\u5bf9\u5e94 VLAN10 \u548c VLAN20\u3002<\/p>\n<hr \/>\n<h4>2. \u3010CE1 \u7684\u5165\u7aef\u53e3\uff08\u8fde\u63a5 Cloud1 \u7684 Access \u7aef\u53e3\uff09\u3011<\/h4>\n<p>\u4ea4\u6362\u673a\u6536\u5230\u53cc\u5c42\u6807\u7b7e\u5e27\u540e\uff0c\u4f1a\u6267\u884c\u7ecf\u5178\u7684 \u201c\u672c\u5f81 VLAN \u5265\u79bb\u903b\u8f91\u201d\uff1a<\/p>\n<ul>\n<li>\u8bc6\u522b\u5916\u5c42\u6807\u7b7e VLAN10\uff0c\u53d1\u73b0\u548c\u8be5 Access \u7aef\u53e3\u7684 PVID=10 \u4e00\u81f4<\/li>\n<li><strong>\u81ea\u52a8\u5265\u79bb\u5916\u5c42 VLAN10 \u6807\u7b7e<\/strong>\uff0c\u628a\u5269\u4e0b\u7684\u5e27\uff08\u5e26\u5185\u5c42 VLAN20 \u6807\u7b7e\uff09\u4ece Trunk \u7aef\u53e3\u8f6c\u53d1\u7ed9 CE2<\/li>\n<\/ul>\n<p>\u6240\u4ee5\u5728 CE1 \u7684\u5165\u7aef\u53e3\u6293\u5305\uff1a<\/p>\n<ul>\n<li>\u5165\u65b9\u5411\uff1a\u548c Cloud1 \u53d1\u9001\u7684\u4e00\u6837\uff0c\u662f<strong>\u53cc\u5c42\u6807\u7b7e\u5e27<\/strong><\/li>\n<li>\u51fa\u65b9\u5411\uff08\u5f80 CE2 \u7684 Trunk \u94fe\u8def\uff09\uff1a\u53ea\u5269<strong>\u5355\u5c42 VLAN20 \u6807\u7b7e\u5e27<\/strong><\/li>\n<\/ul>\n<hr \/>\n<h4>\u3010CE1 \u2194 CE2 \u4e4b\u95f4\u7684 Trunk \u94fe\u8def\u3011<\/h4>\n<p>\u4f20\u8f93\u7684\u662f\u88ab\u5265\u79bb\u4e86\u5916\u5c42\u6807\u7b7e\u7684\u5e27\uff0c\u7ed3\u6784\u662f\uff1a<\/p>\n<pre><code>Ethernet\u5934\n\u2192 \u5355\u5c42802.1Q\u6807\u7b7e\uff1aVLAN ID=20\uff08TPID=0x8100\uff09\n\u2192 IP\u5934\uff1asrc=192.168.21.1 \u2192 dst=192.168.21.9\n\u2192 \u6570\u636e\u8f7d\u8377<\/code><\/pre>\n<p>\u5728\u8fd9\u91cc\u6293\u5305\uff0c<strong>\u53ea\u80fd\u770b\u5230 VLAN20 \u7684\u6807\u7b7e<\/strong>\uff0c\u5916\u5c42 VLAN10 \u5df2\u7ecf\u88ab CE1 \u5265\u79bb\u4e86\u3002<\/p>\n<hr \/>\n<h4>\u3010CE2 \u7684\u5904\u7406\u4e0e PC2 \u6536\u5230\u7684\u5305\u3011<\/h4>\n<ul>\n<li>CE2 \u6536\u5230 Trunk \u94fe\u8def\u4e0a\u7684 VLAN20 \u6807\u7b7e\u5e27\uff0c\u8bc6\u522b\u51fa\u5c5e\u4e8e VLAN20 \u7684\u6d41\u91cf<\/li>\n<li>CE2 \u4f1a\u628a\u5e27\u8f6c\u53d1\u5230 VLAN20 \u7684 Access \u7aef\u53e3\uff08\u8fde\u63a5 PC2 \u7684\u7aef\u53e3\uff09<\/li>\n<li>\u8fde\u63a5 PC2 \u7684 Access \u7aef\u53e3\u4f1a<strong>\u5265\u79bb VLAN20 \u6807\u7b7e<\/strong>\uff0c\u628a\u7eaf IP \u5e27\u53d1\u7ed9 PC2<\/li>\n<\/ul>\n<p>PC2 \u6536\u5230\u7684\u5305\u662f<strong>\u5b8c\u5168\u6ca1\u6709 VLAN \u6807\u7b7e\u7684\u7eaf IP \u5e27<\/strong>\uff1a<\/p>\n<pre><code>Ethernet\u5934\n\u2192 IP\u5934\uff1asrc=192.168.21.1 \u2192 dst=192.168.21.9\n\u2192 \u6570\u636e\u8f7d\u8377<\/code><\/pre>\n<p>PC2 \u53ea\u4f1a\u8ba4\u4e3a\u8fd9\u662f\u6765\u81ea 192.168.21.1 \u7684\u666e\u901a IP \u5305\uff0c\u5b8c\u5168\u4e0d\u77e5\u9053\u5b83\u8de8\u8d8a\u4e86 VLAN10 \u548c VLAN20 \u7684\u9694\u79bb\u3002<\/p>\n<p><strong>\u9632\u5fa1\u65b9\u6cd5:<\/strong> <\/p>\n<p>\u66f4\u6539\u9ed8\u8ba4\u7684\u7f3a\u7701 VLAN ID, \u4f7f\u7528\u4e00\u4e2a\u4e0d\u5e38\u7528\u7684 VLAN \u4f5c\u4e3a\u7f3a\u7701 VLAN, \u5e76\u4e14 Trunk \u7684\u4ea4\u6362\u673a\u7f3a\u7701 VLAN ID \u8981\u4fdd\u6301\u4e00\u81f4\u3002\u540c\u65f6\u5c06\u6240\u6709\u4e0d\u4f7f\u7528\u7684\u63a5\u53e3 shutdown \u5e76\u5212\u5165\u8fd9\u4e2a\u65b0\u521b\u5efa\u7684\u672c\u5f81 VLAN\u3002<\/p>\n<h3>\u4ea4\u6362\u673a\u6b3a\u9a97 (Switch Spoofing)-\u601d\u79d1\u4ea4\u6362\u673a<\/h3>\n<p><strong>\u653b\u51fb\u65b9\u6cd5\uff1a<\/strong><\/p>\n<p>\u5f88\u591a\u4ea4\u6362\u673a\u90fd\u5f00\u542f\u4e86\u52a8\u6001 Trunk\uff08DTP\uff09\u7684\u4e3b\u52a8\u534f\u5546\uff0c\u5982\u601d\u79d1\u7684\u7684 SW3550 \u4ea4\u6362\u673a\uff0c\u5982\u679c\u7528\u4e00\u6839\u7f51\u7ebf\u5c06\u4e24\u53f0 3550  \u4ea4\u6362\u673a\u8fde\u63a5\u8d77\u6765\uff0c\u5b83\u4eec\u4f1a\u81ea\u52a8\u534f\u5546\u4e3a Trunk, \u539f\u56e0\u5c31\u662f\u5b83\u4eec\u9ed8\u8ba4\u5f00\u542f\u4e86 DTP \u7684\u4e3b\u52a8\u534f\u5546\u3002\u5982\u679c\u4e00\u4f4d\u653b\u51fb\u8005\u4f7f\u7528\u4e00\u53f0 PC  \u5b89\u88c5\u4e00\u5757\u670d\u52a1\u5668\u7f51\u5361\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u5730\u4e0e\u4ea4\u6362\u673a\u534f\u5546 Trunk\u3002\u4e00\u65e6\u534f\u5546\u5b8c\u6210\uff0c\u5c31\u53ef\u4ee5\u968f\u610f\u8bbf\u95ee\u4efb\u4f55 VLAN\uff08\u67d0\u4e9b\u54c1\u724c\u4ea4\u6362\u673a\u7684 Trunk \u9ed8\u8ba4\u5141\u8bb8\u6240\u6709 VLAN \u6d41\u91cf\u901a\u8fc7\uff0c\u800c\u67d0\u4e9b\u54c1\u724c\u4ea4\u6362\u673a\u7684 Trunk \u9ed8\u8ba4\u53ea\u5141\u8bb8\u9ed8\u8ba4 VLAN, \u5373 VLAN1 \u7684\u6d41\u91cf\u901a\u8fc7\uff09\u3002<\/p>\n<p><strong>\u9632\u5fa1\u65b9\u6cd5<\/strong>\uff1a<\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u5173\u95ed\u4ea4\u6362\u673a\u7684 DTP \u4e3b\u52a8\u534f\u5546\u6765\u7f13\u89e3\u6b64\u7c7b\u653b\u51fb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VLAN\u6e17\u900f VLAN\u4ecb\u7ecd VLAN\u524d\u7f6e\u6982\u5ff5 \u78b0\u649e\u57df\uff0c\u5e7f\u64ad\u57df\uff0c\u5e7f\u64ad\u98ce\u66b4: \u78b0\u649e\u57df\uff1a\u4f7f\u7528\u96c6\u7ebf\u5668\u8fde\u63a5\u800c\u6210\u7684\u4ee5\u592a\u7f51\u662f\u4e00\u4e2a\u78b0\u649e\u57df\uff0c\u5373\u6536\u5230\u7684 &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-379","post","type-post","status-publish","format-standard","hentry","category-19"],"_links":{"self":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=379"}],"version-history":[{"count":1,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions"}],"predecessor-version":[{"id":380,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/379\/revisions\/380"}],"wp:attachment":[{"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=379"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}