{"id":2484,"date":"2025-05-14T11:25:06","date_gmt":"2025-05-14T03:25:06","guid":{"rendered":"https:\/\/airy.cn\/WordPress\/?p=2484"},"modified":"2025-05-14T11:25:07","modified_gmt":"2025-05-14T03:25:07","slug":"%e5%8d%8e%e4%b8%ba-%e6%80%9d%e7%a7%91%e4%ba%a4%e6%8d%a2%e6%9c%ba%e8%b6%85%e5%ae%9e%e7%94%a8%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/airy.cn\/WordPress\/?p=2484","title":{"rendered":"\u534e\u4e3a\/\u601d\u79d1\u4ea4\u6362\u673a\u8d85\u5b9e\u7528\u547d\u4ee4"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u57fa\u7840\u6392\u67e5\u547d\u4ee4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u5feb\u901f\u67e5\u770b\u8bbe\u5907\u72b6\u6001<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>\u76ee\u7684<\/th><th>\u534e\u4e3a\u4ea4\u6362\u673a<\/th><th>\u601d\u79d1\u4ea4\u6362\u673a<\/th><\/tr><tr><td>\u67e5\u770b\u7aef\u53e3\u72b6\u6001<\/td><td>display interface brief<\/td><td>show ip interface brief<\/td><\/tr><tr><td>\u67e5\u770b\u8fd0\u884c\u914d\u7f6e<\/td><td>display current-configuration<\/td><td>show running-config<\/td><\/tr><tr><td>\u67e5\u770b\u7248\u672c\u4fe1\u606f<\/td><td>display version<\/td><td>show version<\/td><\/tr><tr><td>\u67e5\u770bARP\u8868<\/td><td>display arp<\/td><td>show arp<\/td><\/tr><tr><td>\u67e5\u770bMAC\u5730\u5740\u8868<\/td><td>display mac-address<\/td><td>show mac address-table<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>\u5c0f\u8d34\u58eb<\/strong>\uff1a\u534e\u4e3a\u7528<code>display<\/code>\uff0c\u601d\u79d1\u7528<code>show<\/code>\uff0c\u4e00\u5b9a\u522b\u8bb0\u9519\u5566\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=255267031&amp;content_type=Article&amp;match_order=1&amp;q=VLAN&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">VLAN<\/a>\u914d\u7f6e\u5fc5\u5907\u547d\u4ee4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u521b\u5efaVLAN\u5e76\u5206\u914d\u7aef\u53e3<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] vlan 10\n&#91;Huawei-vlan10] description IT_DEPT\n&#91;Huawei] interface GigabitEthernet0\/0\/1\n&#91;Huawei-GigabitEthernet0\/0\/1] port link-type access\n&#91;Huawei-GigabitEthernet0\/0\/1] port default vlan 10<\/code><\/pre>\n\n\n\n<p><strong>\u601d\u79d1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# vlan 10\nSwitch(config-vlan)# name IT_DEPT\nSwitch(config)# interface GigabitEthernet1\/0\/1\nSwitch(config-if)# switchport mode access\nSwitch(config-if)# switchport access vlan 10<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u6279\u91cf\u7aef\u53e3\u64cd\u4f5c\uff08\u534e\u4e3a\u72ec\u5bb6\uff09<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] port-group 1\n&#91;Huawei-port-group-1] group-member GigabitEthernet 0\/0\/1 to 0\/0\/24\n&#91;Huawei-port-group-1] port link-type trunk\n&#91;Huawei-port-group-1] port trunk allow-pass vlan 10 20<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u5b89\u5168\u5f3a\u5316\u4e09\u5927\u62db<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u9632MAC\u6cdb\u6d2a\u653b\u51fb<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] interface GigabitEthernet0\/0\/1\n&#91;Huawei-GigabitEthernet0\/0\/1] port-security enable\n&#91;Huawei-GigabitEthernet0\/0\/1] port-security max-mac-num 5<\/code><\/pre>\n\n\n\n<p><strong>\u601d\u79d1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config-if)# switchport port-security\nSwitch(config-if)# switchport port-security maximum 5<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u7aef\u53e3\u8bef\u5173\u5feb\u901f\u6062\u590d<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\uff1a<\/strong>&nbsp;<code>undo shutdown<\/code><\/p>\n\n\n\n<p><strong>\u601d\u79d1\uff1a<\/strong>&nbsp;<code>no shutdown<\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=255267031&amp;content_type=Article&amp;match_order=1&amp;q=STP&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">STP<\/a>\u9632\u73af\u8def\u6280\u5de7<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 \u5f3a\u5236\u6839\u6865\u9009\u4e3e<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] stp root primary  # \u4e3b\u6839\u6865\n&#91;Huawei] stp root secondary  # \u5907\u4efd\u6839\u6865<\/code><\/pre>\n\n\n\n<p><strong>\u601d\u79d1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# spanning-tree vlan 1 root primary<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 \u67e5\u770bSTP\u72b6\u6001<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\uff1a<\/strong>&nbsp;<code>display stp brief<\/code><\/p>\n\n\n\n<p><strong>\u601d\u79d1\uff1a<\/strong>&nbsp;<code>show spanning-tree brief<\/code><\/p>\n\n\n\n<p><strong>\u5173\u952e\u6307\u6807\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Forwarding\uff08\u6b63\u5e38\u8f6c\u53d1\uff09<\/li>\n\n\n\n<li>Blocking\uff08\u7aef\u53e3\u88ab\u963b\u585e\uff09<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u94fe\u8def\u805a\u5408\uff08<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=255267031&amp;content_type=Article&amp;match_order=1&amp;q=LACP&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">LACP<\/a>\uff09\u5b9e\u64cd<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u534e\u4e3a\u914d\u7f6e<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] interface Eth-Trunk1\n&#91;Huawei-Eth-Trunk1] mode lacp\n&#91;Huawei-Eth-Trunk1] trunkport GigabitEthernet 0\/0\/23 to 0\/0\/24\n&#91;Huawei-Eth-Trunk1] port link-type trunk\n&#91;Huawei-Eth-Trunk1] port trunk allow-pass vlan 10<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u601d\u79d1\u914d\u7f6e<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# interface port-channel1\nSwitch(config-if)# switchport mode trunk\nSwitch(config)# interface range Gig1\/0\/23-24\nSwitch(config-if-range)# channel-group 1 mode active<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001<a href=\"https:\/\/zhida.zhihu.com\/search?content_id=255267031&amp;content_type=Article&amp;match_order=1&amp;q=QOS&amp;zhida_source=entity\" target=\"_blank\" rel=\"noreferrer noopener\">QOS<\/a>\u9650\u901f\u6307\u5357<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u534e\u4e3a\u7aef\u53e3\u9650\u901f<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] interface GigabitEthernet0\/0\/1\n&#91;Huawei-GigabitEthernet0\/0\/1] qos lr outbound cir 10000  # \u9650\u901f10Mbps<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u601d\u79d1ACL\u9650\u901f<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# access-list 100 permit ip any any\nSwitch(config)# class-map CLASS_10M\nSwitch(config-cmap)# match access-group 100\nSwitch(config)# policy-map POLICE_10M\nSwitch(config-pmap)# class CLASS_10M\nSwitch(config-pmap-c)# police 10000000 1500 conform-action transmit exceed-action drop\nSwitch(config)# interface Gig1\/0\/1\nSwitch(config-if)# service-policy input POLICE_10M<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u5feb\u901f\u6392\u9519\u79d8\u7c4d<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u7f51\u7edc\u73af\u8def\u68c0\u6d4b<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u534e\u4e3a\uff1a<\/strong><code>display loop-detect<\/code><\/li>\n\n\n\n<li><strong>\u601d\u79d1\uff1a<\/strong><code>show spanning-tree inconsistentports<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u67e5\u770b\u63a5\u53e3\u9519\u8bef\u5305<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u534e\u4e3a\uff1a<\/strong><code>display interface GigabitEthernet0\/0\/1 | include errors<\/code><\/li>\n\n\n\n<li><strong>\u601d\u79d1\uff1a<\/strong><code>show interfaces Gig1\/0\/1 | include errors<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u6293\u5305\u6280\u5de7<\/h3>\n\n\n\n<p><strong>\u534e\u4e3a\u955c\u50cf\u7aef\u53e3\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Huawei] observe-port 1 interface GigabitEthernet0\/0\/24\n&#91;Huawei] interface GigabitEthernet0\/0\/1\n&#91;Huawei-GigabitEthernet0\/0\/1] mirror to observe-port 1<\/code><\/pre>\n\n\n\n<p><strong>\u601d\u79d1SPAN\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# monitor session 1 source interface Gig1\/0\/1\nSwitch(config)# monitor session 1 destination interface Gig1\/0\/24<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u5b89\u5168\u52a0\u56fa\u6280\u5de7<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5173\u95ed\u5371\u9669\u670d\u52a1<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u534e\u4e3a\uff1a<\/strong><code>undo http server enable<\/code>\u00a0\/\u00a0<code>undo telnet server enable<\/code><\/li>\n\n\n\n<li><strong>\u601d\u79d1\uff1a<\/strong><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Switch(config)# no ip http server\nSwitch(config)# line vty 0 4\nSwitch(config-line)# transport input ssh<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u767b\u5f55\u5931\u8d25\u81ea\u52a8\u9501\u5b9a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u534e\u4e3a\uff1a<\/strong>\u00a0\u8bbe\u7f6e\u5f3a\u5bc6\u7801<\/li>\n\n\n\n<li><strong>\u601d\u79d1\uff1a<\/strong><code>login block-for 300 attempts 3 within 60<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>\u5b9e\u64cd\u5c0f\u63d0\u793a\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8c28\u614e\u4f7f\u7528<code>reset saved-configuration<\/code>\uff08\u534e\u4e3a\uff09\u548c<code>write erase<\/code>\uff08\u601d\u79d1\uff09\u3002<\/li>\n\n\n\n<li>\u505a\u4efb\u4f55\u53d8\u66f4\u524d\u52a1\u5fc5\u4fdd\u5b58\u5f53\u524d\u914d\u7f6e\uff1a<code>save<\/code>\uff08\u534e\u4e3a\uff09\u3001<code>copy running-config startup-config<\/code>\uff08\u601d\u79d1\uff09\u3002<\/li>\n\n\n\n<li>\u9ad8\u98ce\u9669\u64cd\u4f5c\u52a1\u5fc5\u4e09\u786e\u8ba4\uff1a\u7aef\u53e3\u5173\u95ed\u3001VLAN\u5220\u9664\u3001ACL\u5e94\u7528\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u57fa\u7840\u6392\u67e5\u547d\u4ee4 1\ufe0f\u20e3 \u5feb\u901f\u67e5\u770b\u8bbe\u5907\u72b6\u6001 \u76ee\u7684 \u534e\u4e3a\u4ea4\u6362\u673a \u601d\u79d1\u4ea4\u6362\u673a \u67e5\u770b\u7aef\u53e3\u72b6\u6001 display int &#8230; <a title=\"\u534e\u4e3a\/\u601d\u79d1\u4ea4\u6362\u673a\u8d85\u5b9e\u7528\u547d\u4ee4\" class=\"read-more\" href=\"https:\/\/airy.cn\/WordPress\/?p=2484\" aria-label=\"\u9605\u8bfb \u534e\u4e3a\/\u601d\u79d1\u4ea4\u6362\u673a\u8d85\u5b9e\u7528\u547d\u4ee4\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-2484","post","type-post","status-publish","format-standard","hentry","category-airy-tech"],"_links":{"self":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/2484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2484"}],"version-history":[{"count":1,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/2484\/revisions"}],"predecessor-version":[{"id":2485,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=\/wp\/v2\/posts\/2484\/revisions\/2485"}],"wp:attachment":[{"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/airy.cn\/WordPress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}