首页 综合布线 1分钟了解网络交换机的6种命令配置模式,交换机的配置模式和常用命令

1分钟了解网络交换机的6种命令配置模式,交换机的配置模式和常用命令

现在还有好多人不知道1分钟了解网络交换机的6种命令配置模式,接下来我们小编就来分享一下。

1分钟了解网络交换机的6种命令配置模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">我们在配置交换机的时候首先要了解的就是交换机命令模式,小编用Cisco思科交换机为例带大家了解交换机的6种配置模式。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Cisco IOS提供了用户EXEC模式和特权EXEC模式两种基本的命令执行级别,同时还提供了全局配置、接口配置、Line配置和vlan数据库配置等多种级别的配置模式,以允许用户对交换机的资源进行配置和管理。

1分钟了解网络交换机的6种命令配置模式,交换机的配置模式和常用命令

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">1、用户EXEC模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">当用户通过交换机的控制台端口或Telnet会话连接并登录到交换机时,此时所处的命令执行模式就是用户EXEC模式。在该模式下,只执行有限的一组命令,这些命令通常用于查看显示系统信息、改变终端设置和执行一些最基本的测试命令,如ping、traceroute等。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">用户EXEC模式的命令状态行是:Switch>

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">其中的Switch是交换机的主机名,对于未配置的交换机默认的主机名是Switch。在用户EXEC模式下,直接输入?并回车,可获得在该模式下允许执行的命令帮助。

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">2、特权EXEC模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在用户EXEC模式下,执行enable命令,将进入到特权EXEC模式。在该模式下,用户能够执行IOS提供的所有命令。特权EXEC模式的命令状态行为:Switch#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch>enable

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Password:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在前面的启动配置中,设置了登录特权EXEC模式的密码,因此系统提示输入用户密码,密码输入时不回显,输入完毕按回车,密码校验通过后,即进入特权EXEC模式。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">若进入特权EXEC模式的密码未设置或要修改,可在全局配置模式下,利用enable secret命令进行设置。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在该模式下键入?,可获得允许执行的全部命令的提示。离开特权模式,返回用户模式,可执行exit或disable命令。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">重新启动交换机,可执行reload命令。

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">3、全局配置模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在特权模式下,执行configure terminal命令,即可进入全局配置模式。在该模式下,只要输入一条有效的配置命令并回车,内存中正在运行的配置就会立即改变生效。该模式下的配置命令的作用域是全局性的,是对整个交换机起作用。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">全局配置模式的命令状态行为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#config terminal

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在全局配置模式,还可进入接口配置、line配置等子模式。从子模式返回全局配置模式,执行exit命令;从全局配置模式返回特权模式,执行exit命令;若要退出任何配置模式,直接返回特权模式,则要直接end命令或按Ctrl+Z组合键。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">例如,若要设交换机名称为student2,则可使用hostname命令来设置,其配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#hostname student2

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">student2(config)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">若要设置或修改进入特权EXEC模式的密码为123456,则配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#enable secret 123456

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">或

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#enable password 123456

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">其中enable secret命令设置的密码在配置文件中是加密保存的,强列推荐采用该方式;而enable password命令所设置的密码在配置文件中是采用明文保存的。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">对配置进行修改后,为了使配置在下次掉电重启后仍生效,需要将新的配置保存到NVRAM中,其配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#exit

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#write

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">4、接口配置模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在全局配置模式下,执行interface命令,即进入接口配置模式。在该模式下,可对选定的接口(端口)进行配置,并且只能执行配置交换机端口的命令。接口配置模式的命令行提示符为:Switch(config-if)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">例如,若要设置Cisco Catalyst 2950交换机的0号模块上的第3个快速以太网端口的端口通讯速度设置为100M,全双工方式,则配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#interface fastethernet 0/3

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-if)#speed 100

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-if)#duplex full

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-if)#end

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#write

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">5、Line配置模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在全局配置模式下,执行line vty或line console命令,将进入Line配置模式。该模式主要用于对虚拟终端(vty)和控制台端口进行配置,其配置主要是设置虚拟终端和控制台的用户级登录密码。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Line配置模式的命令行提示符为:Switch(config-line)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">交换机有一个控制端口(console),其编号为0,通常利用该端口进行本地登录,以实现对交换机的配置和管理。为安全起见,应为该端口的登录设置密码,设置方法为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#config terminal

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#line console 0

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#?

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">exit exit from line configuration mode

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">login Enable password checking

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">password Set a password

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">从帮助信息可知,设置控制台登录密码的命令是password,若要启用密码检查,即让所设置的密码生效,则还应执行login命令。退出line配置模式,执行exit命令。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">下面设置控制台登录密码为654321,并启用该密码,则配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#password 654321

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#login

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#end

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#write

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">设置该密码后,以后利用控制台端口登录访问交换机时,就会首先询问并要求输入该登录密码,密码校验成功后,才能进入到交换机的用户EXEC模式。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">交换机支持多个虚拟终端,一般为16个(0-15)。设置了密码的虚拟终端,就允许登录,没有设置密码的,则不能登录。如果对0-4条虚拟终端线路设置了登录密码,则交换机就允许同时有5个telnet登录连接,其配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#line vty 0 4

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#password 123456

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#login

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#end

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#write

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">若要设置不允许telnet登录,则取消对终端密码的设置即可,为此可执行no password和no login来实现。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在Cisco IOS命令中,若要实现某条命令的相反功能,只需在该条命令前面加no,并执行前缀有no的命令即可。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">为了防止空闲的连接长时间的存在,通常还应给通过console口的登录连接和通过vty线路的telnet登录连接,设置空闲超时的时间,默认空闲超时的时间是10分钟。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">设置空闲超时时间的配置命令为:exec-timeout 分钟数 秒数

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">例如,要将vty 0-4线路和Console的空闲超时时间设置为3分钟0秒,则配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#config t

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#line vty 0 4

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#exec-timeout 3 0

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#line console 0

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#exec-timeout 3 0

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config-line)#end

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch#

<h1 style="margin: 36px 0px 22px; padding: 0px; font-size: 24px; max-width: 100%; box-sizing: border-box; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; line-height: 32px; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">6、vlan数据库配置模式

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在特权EXEC模式下执行vlan database配置命令,即可进入vlan数据库配置模式,此时的命令行提示符为:Switch(vlan)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在该模式下,可实现对VLAN(虚拟局域网)的创建、修改或删除等配置操作。退出vlan配置模式,返回到特权EXEC模式,可执行exit命令。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">(1)设置主机名

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">设置交换机的主机名可在全局配置模式,通过hostname配置命令来实现,其用法为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">hostname 自定义名称

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">默认情况下,交换机的主机名默认为Switch。当网络中使用了多个交换机时,为了以示区别,通常应根据交换机的应用场地,为其设置一个具体的主机名。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">例如,若要将交换机的主机名设置为Switch-1,则设置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch(config)#hostname Switch-1

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Switch-1(config)#

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">(2)配置管理IP地址

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">在2层交换机中,IP地址仅用于远程登录管理交换机,对于交换机的正常运行不是必需的。若没有配置管理IP地址,则交换机只能采用控制端口进行本地配置和管理。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">默认情况下,交换机的所有端口均属于VLAN 1,VLAN 1是交换机自动创建和管理的。每个VLAN只有一个活动的管理地址,因此,对2层交换机设置管理地址之前,首先应选择VLAN 1接口,然后再利用ip address配置命令设置管理IP地址,其配置命令为:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">interface vlan vlan-id

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">ip address address netmask

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">参数说明:

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">vlan-id代表要选择配置的VLAN号。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">address为要设置的管理IP地址,netmask为子网掩码。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">Interface vlan配置命令用于访问指定的VLAN接口。2层交换机,如2900/3500XL、2950等没有3层交换功能,运行的是2层IOS,VLAN间无法实现相互通讯,VLAN接口仅作为管理接口。

<p style="margin-top: 16px; margin-bottom: 16px; padding: 0px; max-width: 100%; box-sizing: border-box; clear: both; min-height: 1em; letter-spacing: 0.544px; white-space: normal; -webkit-tap-highlight-color: transparent; color: rgb(34, 34, 34); font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif; overflow-wrap: break-word !important;">若要取消管理IP地址,可执行no ip address配置命令。

关于1分钟了解网络交换机的6种命令配置模式的内容到此结束,希望对大家有所帮助。安防网往后会继续推荐1分钟了解网络交换机的6种命令配置模式相关内容。

热门文章