{"id":407,"date":"2021-06-14T13:01:33","date_gmt":"2021-06-14T05:01:33","guid":{"rendered":"http:\/\/b.yesiyu.top\/?p=407"},"modified":"2021-06-14T13:01:33","modified_gmt":"2021-06-14T05:01:33","slug":"%e5%8d%8e%e4%b8%ba%e4%ba%a4%e6%8d%a2%e6%9c%ba%e5%b8%b8%e7%94%a8%e7%9a%84%e4%b8%89%e7%a7%8dvlan%e5%88%92%e5%88%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/b.yesiyu.top\/?p=407","title":{"rendered":"\u534e\u4e3a\u4ea4\u6362\u673a\u5e38\u7528\u7684\u4e09\u79cdvlan\u5212\u5206\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u534e\u4e3a\u4ea4\u6362\u673a\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u8fd9\u7bc7\u5185\u5bb9\u662f\u534e\u4e3a\u4ea4\u6362\u673a\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u4eca\u5929\u6211\u4eec\u6765\u770b\u4e0b\u5177\u4f53\u5e94\u7528\uff0c\u4ee5\u534e\u4e3a\u4ea4\u6362\u673a\u4e3a\u4f8b\uff0c\u4e5f\u662f\u7528\u7684\u6bd4\u8f83\u591a\uff0c\u6765\u770b\u4e0b\u5b83\u7684\u5177\u4f53\u914d\u7f6e\uff0c\u8fd9\u4e2a\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u7ecf\u5e38\u4f1a\u9047\u5230\uff0c\u5b9e\u7528\u6027\u6bd4\u8f83\u5f3a\uff0c\u5982\u679c\u4f60\u4ee5\u5bf9vlan\u4e86\u89e3\u4e0d\u591a\uff0c\u90a3\u4e48\u8fd9\u7bc7\u6587\u7ae0\u53ef\u4ee5\u5e26\u4f60\u6df1\u5165\u5b66\u4e60vlan\uff0c\u90fd\u6709\u8be6\u7ec6\u6ce8\u91ca\u3002<\/p>\n\n\n\n<p><strong>\u7aef\u53e3\u7c7b\u578b<\/strong><\/p>\n\n\n\n<p>\u5728\u5b66\u4e60\u5212\u5206vlan\u524d\uff0c\u5fc5\u987b\u8981\u4e86\u89e3\u534e\u4e3a\u4ea4\u6362\u673a\u7684\u7aef\u53e3\u7c7b\u578b\uff0c\u4ee5\u53ca\u4ed6\u4eec\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u56e0\u4e3a\u7aef\u53e3\u7684\u7c7b\u578b\u5728\u5b9e\u9645\u914d\u7f6e\u4e2d\u662f\u5fc5\u987b\u4f1a\u7528\u5230\u7684\uff0c\u56e0\u4e3a\u4e0b\u9762\u7684vlan\u5212\u5206\u4f1a\u7528\u5230\u3002<\/p>\n\n\n\n<p><strong>1\u3001Access\u7c7b\u578b\u7aef\u53e3<\/strong><\/p>\n\n\n\n<p>\u6267\u884c\u547d\u4ee4port default vlan vlan-id\uff0c\u5c06\u7aef\u53e3\u52a0\u5165\u5230\u6307\u5b9a\u7684VLAN\u4e2d\u3002<\/p>\n\n\n\n<p>Access\u7c7b\u578b\u7aef\u53e3\u53ea\u80fd\u5c5e\u4e8e1\u4e2aVLAN\uff0c\u4e00\u822c\u7528\u4e8e\u8fde\u63a5\u8ba1\u7b97\u673a\u7aef\u53e3\uff1b<\/p>\n\n\n\n<p><strong>2\u3001Trunk\u7c7b\u578b\u7aef\u53e3<\/strong><\/p>\n\n\n\n<p>Trunk\u7c7b\u578b\u7aef\u53e3\u53ef\u4ee5\u5141\u8bb8\u591a\u4e2aVLAN\u901a\u8fc7,\u53ef\u4ee5\u63a5\u6536\u548c\u53d1\u9001\u591a\u4e2aVLAN \u62a5\u6587,<\/p>\n\n\n\n<p><strong>3\u3001Hybrid\u7c7b\u578b\u7aef\u53e3<\/strong><\/p>\n\n\n\n<p>\u2013 \u9009\u62e9\u6267\u884c\u5176\u4e2d\u4e00\u4e2a\u6b65\u9aa4\u914d\u7f6eHybrid\u7aef\u53e3\u52a0\u5165VLAN\u7684\u65b9\u5f0f\uff1aHybrid\u7c7b\u578b\u7aef\u53e3\uff1a\u53ef\u4ee5\u5141\u8bb8\u591a\u4e2aVLAN\u901a\u8fc7\uff0c\u53ef\u4ee5\u63a5\u6536\u548c\u53d1\u9001\u591a\u4e2aVLAN \u62a5\u6587\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u524d\u9762\u66fe\u8bf4\u5230\uff0c\u5173\u4e8evlan\u7684\u5212\u5206\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u9879\u76ee\u5e94\u7528\u4e2d\u8f83\u591a\u7684\u65b9\u6cd5\u5c31\u662f\u57fa\u4e8e<strong>\u7aef\u53e3\u5212\u5206vlan<\/strong>\u3001<strong>\u57fa\u4e8emac\u5730\u5740\u5212\u5206vlan<\/strong>\u3001<strong>\u57fa\u4e8eip\u5730\u5740\u5212\u5206vlan<\/strong>\uff0c\u8981\u771f\u6b63\u5bf9vlan\u4e86\u89e3\uff0c\u5fc5\u987b\u719f\u6089\u8fd9\u4e09\u6b21\u5212\u5206\u65b9\u6cd5\uff0c\u4ee5\u4fbf\u4e8e\u6839\u636e\u5b9e\u9645\u9879\u76ee\u8fdb\u884c\u5e94\u7528\u3002<\/p>\n\n\n\n<p><strong>\u4e00\u3001\u57fa\u4e8e\u7aef\u53e3\u7684vlan\u5212\u5206\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p>\u8fd9\u91cc\u9762\u4e3a\u4e86\u65b9\u4fbf\u5927\u5bb6\u7406\u89e3\uff0c\u76f4\u63a5\u7528\u5b9e\u4f8b\u8bb2\u89e3\u66f4\u6e05\u695a\u3002<\/p>\n\n\n\n<p><strong>1\u3001\u7ec4\u7f51\u9700\u6c42<\/strong><\/p>\n\n\n\n<p>\u5982\u56fe1\u6240\u793a\uff0c\u67d0\u4f01\u4e1a\u7684\u4ea4\u6362\u673a\u8fde\u63a5\u6709\u5f88\u591a\u7528\u6237\uff0c\u4e14\u76f8\u540c\u4e1a\u52a1\u7528\u6237\u901a\u8fc7\u4e0d\u540c\u7684\u8bbe\u5907\u63a5\u5165\u4f01\u4e1a\u7f51\u7edc\u3002\u4e3a\u4e86\u901a\u4fe1\u7684\u5b89\u5168\u6027\uff0c\u4e5f\u4e3a\u4e86\u907f\u514d\u5e7f\u64ad\u62a5\u6587\u6cdb\u6ee5\uff0c\u4f01\u4e1a\u5e0c\u671b\u4e1a\u52a1\u76f8\u540c\u7528\u6237\u4e4b\u95f4\u53ef\u4ee5\u4e92\u76f8\u8bbf\u95ee\uff0c\u4e1a\u52a1\u4e0d\u540c\u7528\u6237\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u5728\u4ea4\u6362\u673a\u4e0a\u914d\u7f6e\u57fa\u4e8e\u7aef\u53e3\u5212\u5206VLAN\uff0c\u628a\u4e1a\u52a1\u76f8\u540c\u7684\u7528\u6237\u8fde\u63a5\u7684\u7aef\u53e3\u5212\u5206\u5230\u540c\u4e00VLAN\u3002<\/p>\n\n\n\n<p>\u4e5f\u5c31\u662f<strong>\u4e0d\u540cVLAN\u7684\u7528\u6237\u4e0d\u80fd\u76f4\u63a5\u8fdb\u884c\u4e8c\u5c42\u901a\u4fe1<\/strong>\uff0c<strong>\u540c\u4e00VLAN\u5185\u7684\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u4e92\u76f8\u901a\u4fe1\u3002<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/5b0988e595225.cdn.sohucs.com\/images\/20190419\/5fd59fe84eab481ea86e644226c536ca.jpeg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>2\u3001\u914d\u7f6e\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<p><strong>\u6b65\u9aa41 \u5728SwitchA\u521b\u5efaVLAN2\u548cVLAN3\uff0c\u5e76\u5c06\u8fde\u63a5\u7528\u6237\u7684\u7aef\u53e3\u5206\u522b\u52a0\u5165VLAN\u3002SwitchB\u914d\u7f6e\u4e0eSwitchA\u7c7b\u4f3c\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] system-view \/\/\u8fdb\u5165\u914d\u7f6e\u89c6\u56fe<\/p>\n\n\n\n<p>[Quidway] sysname SwitchA&nbsp;\/\/\u7ed9\u4ea4\u6362\u673a\u547d\u540d<\/p>\n\n\n\n<p>[SwitchA] vlan batch 2 3&nbsp;\/\/\u540c\u65f6\u521b\u5efavlan2\u4e0evlan3<\/p>\n\n\n\n<p>[SwitchA] interface ethernet 0\/0\/1&nbsp;\/\/\u8fdb\u5165\u7aef\u53e30\/0\/1<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/1] port link-type access&nbsp;\/\/\u8bbe\u7f6e\u7aef\u53e3\u6a21\u5f0f\u4e3aaccess<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/1] port default vlan 2&nbsp;\/\/\u5c06\u7aef\u53e3\u52a0\u5165vlan2\u4e2d<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/1] quit&nbsp;\/\/\u9000\u51fa<\/p>\n\n\n\n<p>[SwitchA] interface ethernet 0\/0\/2&nbsp;\/\/\u8fdb\u5165\u7aef\u53e30\/0\/2<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/2] port link-type access&nbsp;\/\/\u7aef\u53e3\u6a21\u5f0f\u4e3aaccess<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/2] port default vlan 3&nbsp;\/\/\u5c06\u7aef\u53e3\u52a0\u5165vlan3\u4e2d<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/2] quit&nbsp;\/\/\u9000\u51fa<\/p>\n\n\n\n<p><strong>\u6b65\u9aa42 \u914d\u7f6eSwitchA\u4e0a\u4e0eSwitchB\u8fde\u63a5\u7684\u7aef\u53e3\u7c7b\u578b\u53ca\u901a\u8fc7\u7684VLAN\u3002SwitchB\u914d\u7f6e\u4e0eSwitchA\u7c7b\u4f3c\uff0c\u4e0d\u518d\u8d58\u8ff0\u3002<\/strong><\/p>\n\n\n\n<p>[SwitchA] interface ethernet 0\/0\/3&nbsp;\/\/\u8fdb\u5165\u7aef\u53e30\/0\/3<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/3] port link-type trunk&nbsp;\/\/\u8bbe\u7f6e\u7aef\u53e3\u6a21\u5f0f\u4e3atrunk<\/p>\n\n\n\n<p>[SwitchA-Ethernet0\/0\/3] port trunk allow-pass vlan 2 3&nbsp;\/\/trunk\u53e3\u5141\u8bb8\u901a\u8fc7vlan2\u4e0evlan3\u7684\u6570\u636e\u5305<\/p>\n\n\n\n<p><strong>\u6b65\u9aa43 \u9a8c\u8bc1\u914d\u7f6e\u7ed3\u679c\u5c06User1\u548cUser2\u914d\u7f6e\u5728\u4e00\u4e2a\u7f51\u6bb5\uff0c\u6bd4\u5982192.168.100.0\/24\uff1b\u5c06User3\u548cUser4\u914d\u7f6e\u5728\u4e00\u4e2a\u7f51\u6bb5\uff0c\u6bd4\u5982192.168.200.0\/24\u3002<\/strong><\/p>\n\n\n\n<p>User1\u548cUser2\u80fd\u591f\u4e92\u76f8ping\u901a\uff0c\u4f46\u662f\u5747\u4e0d\u80fdping\u901aUser3\u548cUser4\u3002User3\u548cUser4\u80fd\u591f\u4e92\u76f8ping\u901a\uff0c\u4f46\u662f\u5747\u4e0d\u80fdping\u901aUser1\u548cUser2\u3002<\/p>\n\n\n\n<p><strong>\u4e8c\u3001\u57fa\u4e8eMAC\u5730\u5740vlan\u5212\u5206\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<p><strong>1\u3001\u7ec4\u7f51\u9700\u6c42<\/strong><\/p>\n\n\n\n<p>\u67d0\u4e2a\u516c\u53f8\u7684\u7f51\u7edc\u4e2d\uff0c\u7f51\u7edc\u7ba1\u7406\u8005\u5c06\u540c\u4e00\u90e8\u95e8\u7684\u5458\u5de5\u5212\u5206\u5230\u540c\u4e00VLAN\u3002\u4e3a\u4e86\u63d0\u9ad8\u90e8\u95e8\u5185\u7684\u4fe1\u606f\u5b89\u5168\uff0c\u8981\u6c42\u53ea\u6709\u672c\u90e8\u95e8\u5458\u5de5\u7684PC\u624d\u53ef\u4ee5\u8bbf\u95ee\u516c\u53f8\u7f51\u7edc\u3002<\/p>\n\n\n\n<p>\u5982\u56fe2\u6240\u793a\uff0cPC1\u3001PC2\u3001PC3\u4e3a\u672c\u90e8\u95e8\u5458\u5de5\u7684PC\uff0c\u8981\u6c42\u8fd9\u51e0\u53f0PC\u53ef\u4ee5\u901a\u8fc7SwitchA\u3001Switch\u8bbf\u95ee\u516c\u53f8\u7f51\u7edc\uff0c\u5982\u6362\u6210\u5176\u4ed6PC\u5219\u4e0d\u80fd\u8bbf\u95ee\u3002\u53ef\u4ee5\u914d\u7f6e\u57fa\u4e8eMAC\u5730\u5740\u5212\u5206VLAN\uff0c\u5c06\u672c\u90e8\u95e8\u5458\u5de5PC\u7684<strong>MAC\u5730\u5740\u4e0eVLAN\u7ed1\u5b9a<\/strong>\uff0c\u4ece\u800c\u5b9e\u73b0\u8be5\u9700\u6c42\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/5b0988e595225.cdn.sohucs.com\/images\/20190419\/969a15392f5c40ae92d0cce8af04c5fc.jpeg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>2\u3001\u64cd\u4f5c\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<p>\u8fd9\u91cc\u9762\u5f31\u7535\u541b\u5bf9\u4e0a\u9762\u91cd\u590d\u7684\u6ce8\u91ca\u5c31\u4e0d\u518d\u89e3\u91ca\u4e86\uff0c\u548c\u4e0a\u9762\u4e00\u6837\uff0c\u5927\u5bb6\u4e5f\u53ef\u4ee5\u9a8c\u8bc1\u4e0b\uff0c\u7ecf\u8fc7\u4e0a\u9762\u7684\u7406\u89e3\uff0c\u662f\u5426\u80fd\u8ba4\u8bc6\u4e0b\u9762\u7684\u914d\u7f6e\u4ee3\u7801\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa41 \u914d\u7f6eSwitch<\/strong><\/p>\n\n\n\n<p><strong># \u521b\u5efaVLAN<\/strong><\/p>\n\n\n\n<p>[Quidway] system-view<\/p>\n\n\n\n<p>[Quidway] vlan batch 10 100<\/p>\n\n\n\n<p><strong># \u914d\u7f6e\u63a5\u53e3\u7684PVID\u548c\u52a0\u5165VLAN<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/1<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] port hybrid pvid vlan 100&nbsp;\/\/\u5c06\u63a5\u53e3\u4ee5\u52a0\u5165\u5230vlan100<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] port hybrid untagged vlan 10&nbsp;\/\/untagged\u662f\u6307\u5f53\u6570\u636e\u79bb\u5f00\u7aef\u53e3\u65f6\u8131\u6389\u6807\u7b7e\uff0c\u6307\u5b9a\u7aef\u53e3\u5141\u8bb8VLAN 10\u7684\u6570\u636e\u5e27\u901a\u8fc7\uff0c\u4e14\u53d1\u9001\u65f6\u4e0d\u5e26VLAN\u6807\u7b7e<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] quit #\u9000\u51fa<\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/2 #\u8fdb\u5165\u7aef\u53e30\/0\/2<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/2] port hybrid tagged vlan 10&nbsp;\/\/tagged\u662f\u6307\u5f53\u6570\u636e\u79bb\u5f00\u7aef\u53e3\u65f6\u5e26\u7740\u6807\u7b7e\uff0c\u6307\u5b9a\u5141\u8bb8VLAN 10\u7684\u6570\u636e\u5e27\u901a\u8fc7\uff0c\u4e14\u53d1\u9001\u65f6\u5fc5\u987b\u5e26\u6709VLAN\u6807\u7b7e<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/2] quit<\/p>\n\n\n\n<p><strong># PC\u7684MAC\u5730\u5740\u4e0eVLAN10\u5173\u8054<\/strong><\/p>\n\n\n\n<p>[Quidway] vlan 10<\/p>\n\n\n\n<p>[Quidway-Vlan10] mac-vlan mac-address 22-22-22<\/p>\n\n\n\n<p>\/\/\u5173\u8054pc1\u7684mac\u5730\u5740<\/p>\n\n\n\n<p>[Quidway-Vlan10] mac-vlan mac-address 33-33-33<\/p>\n\n\n\n<p>\/\/\u5173\u8054pc2\u7684mac\u5730\u5740<\/p>\n\n\n\n<p>[Quidway-Vlan10] mac-vlan mac-address 44-44-44<\/p>\n\n\n\n<p>\/\/\u5173\u8054pc3\u7684mac\u5730\u5740<\/p>\n\n\n\n<p>[Quidway-Vlan10] quit<\/p>\n\n\n\n<p><strong># \u4f7f\u80fd\u63a5\u53e3\u7684\u57fa\u4e8eMAC\u5730\u5740\u5212\u5206VLAN\u529f\u80fd<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/1<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] mac-vlan enable<\/p>\n\n\n\n<p>\/\/\u8d77\u52a8\u7aef\u53e3\u7684mac-vlan\u529f\u80fd<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] quit<\/p>\n\n\n\n<p><strong>\u4e09\u3001\u57fa\u4e8eIP\u5b50\u7f51\u7684vlan\u5212\u5206<\/strong><\/p>\n\n\n\n<p><strong>1\u3001\u7ec4\u7f51\u9700\u6c42<\/strong><\/p>\n\n\n\n<p>\u67d0\u4f01\u4e1a\u62e5\u6709\u591a\u79cd\u4e1a\u52a1\uff0c\u5982IPTV\u3001VoIP\u3001Internet\u7b49\uff0c\u6bcf\u79cd\u4e1a\u52a1\u4f7f\u7528\u7684IP\u5730\u5740\u7f51\u6bb5\u5404\u4e0d\u76f8\u540c\u3002\u4e3a\u4e86\u4fbf\u4e8e\u7ba1\u7406\uff0c\u73b0\u9700\u8981\u5c06\u540c\u4e00\u79cd\u7c7b\u578b\u4e1a\u52a1\u5212\u5206\u5230\u540c\u4e00VLAN\u4e2d\uff0c\u4e0d\u540c\u7c7b\u578b\u7684\u4e1a\u52a1\u5212\u5206\u5230\u4e0d\u540cVLAN\u4e2d\u3002<\/p>\n\n\n\n<p>\u5982\u56fe3\u6240\u793a\uff0cSwitch\u63a5\u6536\u5230\u7528\u6237\u62a5\u6587\u6709\u6570\u636e\u3001IPTV\u3001\u8bed\u97f3\u7b49\u591a\u79cd\u4e1a\u52a1\uff0c\u7528\u6237\u8bbe\u5907\u7684IP\u5730\u5740\u7f51\u6bb5\u5404\u4e0d\u76f8\u540c\u3002<strong>\u73b0\u9700\u8981\u5c06\u4e0d\u540c\u7c7b\u578b\u7684\u4e1a\u52a1\u5212\u5206\u5230\u4e0d\u540c\u7684VLAN\u4e2d<\/strong>\uff0c\u901a\u8fc7\u4e0d\u540c\u7684VLANID\u5206\u6d41\u5230\u4e0d\u540c\u7684\u8fdc\u7aef\u670d\u52a1\u5668\u4e0a\u4ee5\u5b9e\u73b0\u4e1a\u52a1\u4e92\u901a\u3002<\/p>\n\n\n\n<p>\u8fd9\u7c7b\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u662f\u6bd4\u8f83\u591a\u7684\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/5b0988e595225.cdn.sohucs.com\/images\/20190419\/10fe2b1b469840f8b8d91f1c306dd541.jpeg\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>2\u3001\u914d\u7f6e\u601d\u8def<\/strong><\/p>\n\n\n\n<p>\u91c7\u7528\u5982\u4e0b\u7684\u601d\u8def\u914d\u7f6e\u57fa\u4e8eIP\u5b50\u7f51\u5212\u5206VLAN\uff1a<\/p>\n\n\n\n<p>a\u3001\u521b\u5efaVLAN\uff0c\u786e\u5b9a\u6bcf\u79cd\u4e1a\u52a1\u6240\u5c5e\u7684VLAN\u3002<\/p>\n\n\n\n<p>b\u3001\u5173\u8054IP\u5b50\u7f51\u548cVLAN\uff0c\u5b9e\u73b0\u6839\u636e\u62a5\u6587\u4e2d\u7684\u6e90IP\u5730\u5740\u6216\u6307\u5b9a\u7f51\u6bb5\u786e\u5b9aVLAN\u3002<\/p>\n\n\n\n<p>c\u3001\u914d\u7f6e\u7aef\u53e3\u52a0\u5165VLAN\uff0c\u5b9e\u73b0\u57fa\u4e8eIP\u5b50\u7f51\u7684VLAN\u901a\u8fc7\u5f53\u524d\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>d\u3001\u914d\u7f6eVLAN\u5212\u5206\u65b9\u5f0f\u7684\u4f18\u5148\u7ea7\uff0c\u786e\u4fdd\u4f18\u5148\u9009\u62e9\u57fa\u4e8eIP\u5b50\u7f51\u5212\u5206VLAN\u3002<\/p>\n\n\n\n<p>e\u3001\u4f7f\u80fd\u57fa\u4e8eIP\u5b50\u7f51\u5212\u5206VLAN\u3002<\/p>\n\n\n\n<p><strong>3\u3001\u64cd\u4f5c\u6b65\u9aa4<\/strong><\/p>\n\n\n\n<p><strong>\u6b65\u9aa41 \u521b\u5efaVLAN<\/strong><\/p>\n\n\n\n<p># \u5728Switch\u4e0a\u521b\u5efaVLAN100\u3001VLAN200\u548cVLAN300\u3002<\/p>\n\n\n\n<p>[Quidway] system-view<\/p>\n\n\n\n<p>[Quidway] vlan batch 100 200 300<\/p>\n\n\n\n<p><strong>\u6b65\u9aa42 \u914d\u7f6e\u63a5\u53e3<\/strong><\/p>\n\n\n\n<p><strong># \u5728Switch\u4e0a\u914d\u7f6e\u63a5\u53e3Eth0\/0\/1\u4e3aHybrid\u7c7b\u578b\uff0c\u5e76\u52a0\u5165VLAN100\u3001VLAN200\u548cVLAN300\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/1<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] port link-type hybrid \/\/\u8bbe\u7f6e\u7aef\u53e3\u4e3ahybrid\u6a21\u5f0f<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] port hybrid untagged vlan100 200 300&nbsp;\/\/\u6307\u5b9a\u7aef\u53e3\u5141\u8bb8VLAN 100\u3001vlan200\u3001vlan300\u7684\u6570\u636e\u5e27\u901a\u8fc7\uff0c\u4e14\u53d1\u9001\u65f6\u4e0d\u5e26VLAN\u6807\u7b7e<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] quit<\/p>\n\n\n\n<p><strong># \u5728Switch\u4e0a\u914d\u7f6e\u63a5\u53e3Eth0\/0\/2\u52a0\u5165VLAN100\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/2<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/2] port link-type trunk<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/2] port trunk allow-pass vlan 100 \/\/\u63a5\u53e30\/0\/2\u52a0\u5165vlan100<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/2] quit<\/p>\n\n\n\n<p><strong># \u5728Switch\u4e0a\u914d\u7f6e\u63a5\u53e3Eth0\/0\/3\u52a0\u5165VLAN200\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/3<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/3] port link-type trunk<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/3] port trunk allow-pass vlan 200 \/\/\u63a5\u53e30\/0\/3\u52a0\u5165vlan200<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/3] quit<\/p>\n\n\n\n<p><strong># \u5728Switch\u4e0a\u914d\u7f6e\u63a5\u53e3Eth0\/0\/4\u52a0\u5165VLAN300\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/4<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/4] port link-type trunk<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/4] port trunk allow-pass vlan 300 \/\/\u63a5\u53e30\/0\/4\u52a0\u5165vlan300<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/4] quit<\/p>\n\n\n\n<p><strong># \u5728Switch\u4e0a\u914d\u7f6e\u63a5\u53e3Eth0\/0\/1\u4f7f\u80fd\u57fa\u4e8eIP\u5b50\u7f51\u5212\u5206VLAN\u529f\u80fd\u3002<\/strong><\/p>\n\n\n\n<p>[Quidway] interface ethernet 0\/0\/1<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] ip-subnet-vlan enable<\/p>\n\n\n\n<p>[Quidway-Ethernet0\/0\/1] quit<\/p>\n\n\n\n<p><strong>\u6b65\u9aa43 \u914d\u7f6e\u57fa\u4e8eIP\u5b50\u7f51\u5212\u5206VLAN<\/strong><\/p>\n\n\n\n<p># \u5728Switch\u4e0a\u914d\u7f6eVLAN100\u4e0eIP\u5730\u5740192.168.1.2\/24\u5173\u8054\uff0c\u4f18\u5148\u7ea7\u4e3a2\u3002<\/p>\n\n\n\n<p>[Quidway] vlan 100<\/p>\n\n\n\n<p>[Quidway-vlan100] ip-subnet-vlan 100 ip 192.168.1.2 24 priority 2<\/p>\n\n\n\n<p>[Quidway-vlan100] quit<\/p>\n\n\n\n<p># \u5728Switch\u4e0a\u914d\u7f6eVLAN200\u4e0eIP\u5730\u5740192.168.2.2\/24\u5173\u8054\uff0c\u4f18\u5148\u7ea7\u4e3a3\u3002<\/p>\n\n\n\n<p>[Quidway] vlan 200<\/p>\n\n\n\n<p>[Quidway-vlan200] ip-subnet-vlan 200 ip 192.168.2.2 24 priority 3<\/p>\n\n\n\n<p>[Quidway-vlan200] quit<\/p>\n\n\n\n<p># \u5728Switch\u4e0a\u914d\u7f6eVLAN300\u4e0eIP\u5730\u5740192.168.3.2\/24\u5173\u8054\uff0c\u4f18\u5148\u7ea7\u4e3a4\u3002<\/p>\n\n\n\n<p>[Quidway] vlan 300<\/p>\n\n\n\n<p>[Quidway-vlan300] ip-subnet-vlan 300 ip 192.168.3.2 24 priority 4<\/p>\n\n\n\n<p>[Quidway-vlan300] quit<\/p>\n\n\n\n<p><strong>\u6b65\u9aa44 \u9a8c\u8bc1\u914d\u7f6e\u7ed3\u679c<\/strong><\/p>\n\n\n\n<p>\u5728Switch\u4e0a\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u663e\u793a\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>[Quidway] display ip-subnet-vlan vlan all<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p>Vlan Index IpAddress SubnetMask Priority<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p>100 1 192.168.1.2 255.255.255.0 2<\/p>\n\n\n\n<p>200 1 192.168.2.2 255.255.255.0 3<\/p>\n\n\n\n<p>300 1 192.168.3.2 255.255.255.0 4<\/p>\n\n\n\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n\n\n\n<p>ip-subnet-vlan count: 3 total count: 3<\/p>\n\n\n\n<p>\u5373\u4e3a\u7ec4\u7f51\u914d\u7f6e\u6210\u529f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u534e\u4e3a\u4ea4\u6362\u673a\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u8fd9\u7bc7\u5185\u5bb9\u662f\u534e\u4e3a\u4ea4\u6362\u673a\u7684\u57fa\u672c\u914d\u7f6e\uff0c\u4eca\u5929\u6211\u4eec\u6765\u770b\u4e0b\u5177\u4f53\u5e94\u7528\uff0c\u4ee5\u534e\u4e3a\u4ea4\u6362\u673a\u4e3a\u4f8b\uff0c\u4e5f\u662f\u7528\u7684\u6bd4\u8f83\u591a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/b.yesiyu.top\/?p=407\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u534e\u4e3a\u4ea4\u6362\u673a\u5e38\u7528\u7684\u4e09\u79cdvlan\u5212\u5206\u65b9\u6cd5\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-407","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/407","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=407"}],"version-history":[{"count":1,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions"}],"predecessor-version":[{"id":408,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/407\/revisions\/408"}],"wp:attachment":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}