首页 配置接口

配置接口

举报
开通vip

配置接口 配置接口 本章描述锐捷交换机的接口类型以及如何配置接口,本章主要包括以下几个部分: z 概述 z 配置接口 z 显示接口状态 概述 本章主要对锐捷交换机的接口类型进行划分,并对每种接口类型进行详细定义。锐捷交换机的接口类型可分为以下 两大类: z 2 层接口(L2 interface) z 3 层...

配置接口
配置接口 本章描述锐捷交换机的接口类型以及如何配置接口,本章主要包括以下几个部分: z 概述 z 配置接口 z 显示接口状态 概述 本章主要对锐捷交换机的接口类型进行划分,并对每种接口类型进行详细定义。锐捷交换机的接口类型可分为以下 两大类: z 2 层接口(L2 interface) z 3 层接口(L3 interface) (三层交换机支持) 2 层接口(L2 interface) 本节主要描述 2 层接口的类型及相关的定义,可分为以下几种类型 z Switch Port z L2 Aggregate Port Switch Port 由交换机上的单个物理端口构成,只有2层交换功能。分为Access Port和Trunk Port。Access Port和Trunk Port的配置必须通过手动配置。通过switchport 接口配置命令可对switch port进行配置,有关Access Port和Trunk Port的详细配置过程可参照“第八章 配置VLAN”。 Access Port 每个 access port 只能属于一个 VLAN, Access port 只传输属于这个 VLAN 的帧。Access port 只接收以 下三种帧:untagged 帧;vid 为 0 的 tagged 帧;vid 为 access port 所属 VLAN 的帧。只发送 untagged 帧。 Trunk Port Trunk port 传输属于多个 VLAN 的帧,缺省情况下 Trunk port 将传输所有 VLAN 的帧,可通过设置 VLAN 许可列表来限制 trunk port 传输哪些 VLAN 的帧。每个接口都属于一个 native VLAN,所谓 native VLAN,就是指在这个接口上收发的 UNTAG 报文,都被认为是属于这个 VLAN 的。Trunk port 可接收 tagged 和 untagged 帧,若 Trunk port 接收到的帧不带 IEEE802.1Q tag,那么帧将在这个接口的 native vlan 中传 输,每个 trunk port的 native vlan都可设置。若 trunk port发送的帧所带的VID等于该 trunk port的 native vlan,则帧从该 trunk port 出去时,tag 将被剥离。Trunk Port 发送的非 native vlan 的帧是带 tag 的。 L2 Aggregate Port 由多个物理端口构成的 Switch port。对于 2 层交换来说 L2 Aggregate port 就好象一个高带宽的 Switch port,通过 L2 Aggregate port 发送的帧将在 L2 Aggregate port 的成员端口上进行流量平衡,当一个成 员端口链路失效后,L2 Aggregate port 会自动将这个成员端口上的流量转移到别的端口上。同样 L2 Aggregate port 可以为 access port 或 trunk port,但 L2 Aggregate port 成员端口必须为同一类型。您可 通过 interface aggregateport 命令来创建 L2 Aggregate port。 3 层接口(L3 interface) 本节主要描述 3 层接口的类型及相关的定义,可分为以下几种类型 z SVI(Switch virtual interface) z Routed port z L3 Aggregate Port SVI(Switch virtual interface) SVI 是和某个 VLAN 关联的 IP 接口。每个 SVI 只能和一个 VLAN 关联,可分为以下两种类型: – SVI 是本机的管理接口,通过该管理接口管理员可管理交换机。 – SVI 是一个网关接口,用于 3 层交换机中跨 VLAN 之间的路由。 您可通过 interface vlan 接口配置命令来创建 SVI,然后给 SVI 分配 IP 地址来建立 VLAN 之间的路 由。想要有关 SVI 的更多信息请参考“第二十章 配置 IP 单址路由”。 如图所示,VLAN20 的主机可直接互相通讯,无需通过三层交换机的路由,若 VLAN20 内的主机 A 想和 VLAN30 内的主机 B 通讯必须通过 VLAN20 对应的 SVI1 和 VLAN30 对应的 SVI2。 Routed Port 在三层交换机上,可以使用单个物理端口作为三层交换的网关接口,这个接口称为 Routed port。Routed port不具备2层交换的功能。您可通过no switchport命令将一个2层接口 switch port转变为Routed port, 然后给 Routed port 分配 IP 地址来建立路由。 一个限制是,当一个接口是 L2 Aggregate Port 的成员口时,是不能用 switchport/ no switchport 命令进行 层次切换的。 L3 Aggregate Port L3 Aggregate port 使用一个 Aggregate port 作为三层交换的网关接口。L3 Aggregate port 不具备 2 层交 换的功能。您可通过 no switchport 将一个无成员 2 层接口 L2 Aggregate port 转变为 L3 Aggregate port, 接着将多个 routed port 加入此 L3 Aggregate port,然后给 L3 Aggregate port 分配 IP 地址来建立路由。 配置接口 本节描述接口的缺省配置,配置指南,配置步骤,配置实例 接口编号规则 对于 Switch Port,其编号由两个部分组成:插槽号,端口在插槽上的编号。例如端口所在的插槽编号为 2,端口在 插槽上的编号为 3,则端口对应的接口编号为 2/3。插槽的编号是从 0-插槽的个数。插槽的编号规则是:面对交换 机的面板,插槽按照从前至后,从左至右,从上至下的顺序依次排列,对应的插槽号从 0 开始依次增加。静态模块 (固定端口所在模块)编号为 0。插槽上的端口编号是从 1-插槽上的端口数,编号顺序是从左到右。对于可以选 择介质类型的交换机(S3550-12SFP/GT),端口包括两种介质(光口和电口),无论使用那种介质,都使用相同的端 口编号。你也可以通过命令行中的 show 命令来查看插槽以及插槽上的端口信息。 对于 Aggregate Port,其编号的范围为 1-交换机支持的 Aggregate Port 个数。 对于 SVI,其编号就是这个 SVI 对应的 VLAN 的 VID。 接口配置命令的使用 您可在全局配置模式下使用 interface 命令进入接口配置模式。遵循下面的步骤可进入接口配置模式: 命令 含义 步骤 1 configure terminal 进入全局配置模式 步骤 2 interface 接口 ID 在全局配置模式下输入 interface 命令,进入接口 配置模式。用户也可以在全局配置模式下使用 interface range 或 interface range macro 命令配 置一定范围的接口。但是定义在一个范围内的接 口必须是相同类型和具有相同特性的 步骤 3 相关设置命令 在接口配置模式下,可以对指定的接口配置相关 的 协议 离婚协议模板下载合伙人协议 下载渠道分销协议免费下载敬业协议下载授课协议下载 或者进行某些应用。使用 end 命令可以回 到特权模式。 下例给出了进入 gigabitethernet2/1 接口的示例: Switch(config)# interface gigabitethernet 2/1 Switch(config-if)# 在接口配置模式下您可配置接口的相关属性。 使用 interface range 命令 配置一定范围的接口 用户可以使用全局配置模式下的 interface range 命令同时配置多个接口。当进入 interface range 配置模式时,此时 设置的属性适用于所选范围内的所有接口。 在特权模式下,下面的步骤使一定范围内的接口具备相同的属性: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface range {port-range | macro macro_name} 输入一定范围的接口。 interface range 命令可以指定若干范围段。 macro参数可以使用范围段的宏定义,参见配置和使用端口范 围的宏定义。 每个范围段可以使用逗号(,)隔开。 同一条命令中的所有范围段中的接口必须属于相同类型。 步骤 3 使用通常的接口配置命令来配置一定范围内的接口。 步骤 4 End 回到特权模式。 当使用 interface range 命令时,请注意 range 参数的格式: 有效的接口范围格式: – vlan vlan-ID - vlan-ID, VLAN ID 范围 1~4094; – fastethernet slot/{第一个 port} - {最后一个 port}; – gigabitethernet slot/{第一个 port} - {最后一个 port}; – Aggregate Port Aggregate port 号 - Aggregate port 号, 范围 1~n; 在一个 interface range 中的接口必须是相同类型的,即或者全是 fastethernet,gigabitethernet 或者全是 Aggregate port, 或者全是 SVI。 下面的例子是在全局配置模式下使用 interface range 命令: Switch#configure terminal Switch(config)#interface range fastethernet 0/1 - 10 Switch(config-if-range)#no shutdown Switch(config-if-range)# 下面的例子是如何使用分隔符号(,)隔开多个 range: Switch#configure terminal Switch(config)#interface range fastethernet 0/1-5, 0/7-8 Switch(config-if-range)#no shutdown Switch(config-if-range)# 配置和使用端口范围的宏定义 用户可以自行定义一些宏来取代端口范围的输入。但在用户使用 interface range 命令中的 macro 关键 字之前,必须先在全局配置模式下使用 define interface-range 命令定义这些宏。 从特权模式出发,按以下步骤定义接口范围的宏定义: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 define interface-range macro_name interface-range 定义接口范围的宏定义。 macro_name-宏定义的名字,不超过 32 个字符。 宏定义的内部可以包括多个范围段。 同一宏定义中的所有范围段中的接口必须属于相同类 型。 步骤 3 interface range macro macro_name 宏定义的字符串将被保存在内存中,使用 interface range 命令时,可以使用宏定义的名字来取代需要输入 的表示接口范围的字符串。 步骤 4 end 回到特权模式。 在全局配置模式下使用 no define interface-range macro_name 命令来删除设置的宏定义。 当使用 define interface-range 命令来定义接口范围时,注意: 有效的接口范围格式: – vlan vlan-ID - vlan-ID, VLAN ID 范围 1~4094; – fastethernet slot/{第一个 port} - {最后一个 port}; – gigabitethernet slot/{第一个 port} - {最后一个 port}; – Aggregate Port Aggregate port 号 - Aggregate port 号, 范围 1~n; 在一个 interface range 中的接口必须是相同类型的,即或者全是 switch port,或者全是 Aggregate Port,或者全 是 SVI。 下面的例子是如何使用 define interface-range 命令来定义 fastethernet1/1-4 的宏定义: Switch#configure terminal Switch(config)#define interface-range resource fastethernet0/1-4 Switch(config)#end Switch# 下面的例子显示如何定义多个接口范围段的宏定义: Switch#configure terminal Switch(config)#define interface-range ports1to2N5to7 fastethernet0/1-2, 0/5-7 Switch(config)#end Switch# 下面的例子显示使用宏定义 ports1to2N5to7 来配置指定范围的接口: Switch#configure terminal Switch(config)#interface range macro ports1to2N5to7 Switch(config-if-range)# Switch# 下面的例子显示如何删除宏定义 ports1to2N5to7: Switch#configure terminal Switch(config)#no define interface-range ports1to2N5to7 Switch#end Switch# 选择接口介质类型 S3550-12SFP/GT 交换机的接口可以有两种介质类型给用户选择,您只能选择其中一种介质使用。 一旦您选定介质类型,接口的连接状态,速度,双工,流控等属性都是指该介质类型的属性,如果 您改变介质类型,新选介质类型的这些属性将使用默认值,你根据需要重新设定这些属性。 此配置命令只对物理端口有效。Aggregate Port 和 SVI 接口不支持介质类型设置。 配置为 Aggregate Port 成员口的端口,其介质类型必须一致,否则无法加入到 Ap 中。Aggregate Port 成员口的端口类型不能改变。 命令 含义 步骤1 configure terminal 进入全局配置模式。 步骤2 interface {{fastethernet|gigabitethernet}interface-id } 进入接口配置模式。 步骤3 medium { fiber | copper } 关闭一个接口 步骤4 end 回到特权模式。 下面的例子显示了如何设置接口 的gigabitethernet 1/1 介质类型: Switch#config terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 1/1 Switch(config-if)#medium-type fiber Switch(config-if)#end Switch# 配置接口的描述和管理状态 为了有助与你记住一个接口的功能,你可以为一个接口起一个专门的名字来标识这个接口,也就是 接口的描述(Description)。你可以根据要表达的含义来设置接口的具体名称,比如,如果你想将 gigabitethernet 1/1 分配给用户 A 专门使用,你就可以将这个接口的描述设置为“Port for User A”。在 特权模式下,遵照以下步骤可为某个接口配置描述: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface interface-id 进入接口配置模式。 步骤 3 description string 设置接口的描述,最多 32 个字符。 步骤 4 End 回到特权模式。 下面的例子显示了如何设置接口 gigabitethernet 1/1 的描述: Switch#config terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 1/1 Switch(config-if)#description PortForUser A Switch(config-if)#end Switch# 在某些情况下,你可能需要禁用某个接口。你可以通过设置接口的管理状态来直接关闭一个接口。如果关闭一个接 口,则这个接口上将不会接收和发送任何帧,这个接口将丧失这个接口对应的所有功能。你也可以通过设置管理状 态来重新打开一个已经关闭的接口。接口的管理状态有两种:up 和 down,当端口被关闭时,端口的管理状态为 down, 否则为 up。 在特权模式下,你可以通过以下步骤来关闭一个接口: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {{fastethernet|gigabitethernet}interface-id} |{vlan vlan-id}|{ aggregateport port-number} 进入接口配置模式。 步骤 3 shutdown 关闭一个接口 步骤 4 end 回到特权模式。 下面的例子描述如何关闭接口 gigabitethernet 1/2: Switch#configure terminal Switch(config)#interface gigabitethernet 1/8 Switch(config-if)#shutdown Switch(config-if)#end Switch# 配置接口的速度,双工,流控 本节描述如何配置接口的速率,双工和流控模式。 以下配置命令只对 Switch Port,L2 Aggregrate port,Routed port,L3 Aggregate port 有效。 在特权模式下,请遵照以下步骤来配置接口的速率,双工和流控模式: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface interface-id 进入接口配置模式。 步骤 3 speed {10 | 100 | 1000 | auto } 设置接口的速率参数,或者设置为 auto。 注意:1000 只对千兆口有效 步骤 4 duplex {auto | full | half} 设置接口的双工模式。 步骤 5 flowcontrol {auto | on | off} 设置接口的流控模式。 注意:当 speed,duplex,flowcontrol 都设为非 auto 模式时,该接 口关闭自协商过程 步骤 6 end 回到特权模式。 在接口配置模式下使用 no speed , no duplex 和 no flowcontrol 命令,将接口的速率,双工和流控配置恢复为缺省 值。下面的例子显示如何将 gigabitethernet 1/1 的速率设为 1000M,双工模式设为全双工,流控关闭: Switch#configure terminal Switch(config)#interface gigabitethernet 1/1 Switch(config-if)#speed 1000 Switch(config-if)#duplex full Switch(config-if)# flowcontrol off Switch(config-if)#end Switch# 配置 2 层接口 下表显示了 2 层接口的缺省配置,有关 VLAN 及端口的配置请参照“第十章 配置 VLAN”和“第二 十章 配置基于端口的流量控制”。 2 层接口的缺省配置 属性 缺省设置 工作模式 2 层交换模式(switchport 命令) Switch port 模式 access port 允许的 VLAN 范围 VLAN 1~4094 缺省 VLAN(对于 access port 而言) VLAN 1 Native VLAN(对于 trunk port 而言) VLAN 1 介 质 类 型 ( 对 于 S3550-12SFP/GT 而言) copper 接口管理状态 Up 接口描述 空 速度 自协商 双工模式 自协商 流控 关闭 Aggregate port 缺省没有任何接口被设为 Aggregate port 接口。 风暴控制 关闭 保护端口 关闭 端口安全 关闭 配置 Switch Port 本节主要讲述配置 Switchport 的操作模式(access/trunk port)及每种模式下的相关配置。 您可在接口配置模式下通过 switchport 或其他命令来配置 Switch Port 的相关属性,在 特权模式下,请遵循以下步骤来配置 Switch port 的模式: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {fastethernet|gigabitethernet}interface-id 选择接口,进入接口配置模式。 步骤 3 switchport mode {access | trunk } 配置接口的操作模式。 步骤 4 end 回到特权模式。 下例显示如何配置 gigabitethernet 1/2 的操作模式为 access port。 Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 1/2 Switch(config-if)#switchport mode access Switch(config-if)#end Switch# 请遵循以下步骤来配置 access port 所属的 VLAN: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {fastethernet|gigabitethernet}interface-id 选择接口,进入接口配置模式。 步骤 3 switchport access vlan vlan-id 配置 access port 所属的 VLAN。 步骤 4 end 回到特权模式。 下例显示如何配置 access port gigabitethernet 2/1 所属 vlan 为 100。 Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 2/1 Switch(config-if)#switchport access vlan 100 Switch(config-if)#end Switch# 请遵循以下步骤来配置 trunk port 的 native VLAN: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {fastethernet|gigabitethernet}interface-id 选择接口,进入接口配置模式。 步骤 3 switchport trunk native vlan vlan-id 配置 trunk port 的 NATIVE VLAN。 步骤 4 end 回到特权模式。 下例显示如何配置 trunk port gigabitethernet 2/1 的 native vlan 为 10。。 Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet /1 Switch(config-if)#switchport trunk native vlan 10 Switch(config-if)#end Switch# 请遵循以下步骤来配置接口的端口安全,有关端口安全更详细的信息请参照“基于端口的流量控制”: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {fastethernet|gigabitethernet}interface-id 选择接口,进入接口配置模式。 步骤 3 switchport port-security 配置接口的端口安全。 步骤 4 end 回到特权模式。 下例显示如何打开 gigabitethernet 2/1 的端口安全。。 Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 2/1 Switch(config-if)#switchport port-security Switch(config-if)#end Switch# 配置接口的速度,双工,流控请参照“配置接口的速度,双工,流控”, 下例显示如何配置 gigabitethernet 2/1 为 access port,所属 VLAN 为 100,速度,双工,流控为自协商 模式,端口安全打开: Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 2/1 Switch(config-if)#switchport access vlan 100 Switch(config-if)#speed auto Switch(config-if)#duplex auto Switch(config-if)#flowcontrol auto Switch(config-if)#switchport port-security Switch(config-if)#end Switch# 配置 L2 Aggregate Port 本节主要讲述如何创建 L2 Aggregate Port 及和 L2 Aggregate Port 相关的一些配置。 您可以在接口配置模式下使用 aggregateport 来创建 L2 Aggregate Port,具体的配置过程请参照“第 十五章 配置 Aggregate Port”。 清除接口的统计值并复位该接口 在特权模式下您可通过 clear 命令清除接口的统计值并复位该接口。该命令只对 Switch Port,L2 Aggregrate port 的成 员端口,Routed port,L3 Aggregate port 的成员端口有效,以下为 clear 命令: 命令 说明 关于失联党员情况说明岗位说明总经理岗位说明书会计岗位说明书行政主管岗位说明书 clear counters [interface-id] 清除接口统计值。 clear interrfaces interface-id 接口硬件复位 接口的统计值可以通过特权模式命令 show interfaces counters 查看,在特权模式下使用 clear counters 命令,可以 将接口的统计值清零。如果不指定接口,则将所有的 L2 接口计数器清零。 下面的例子显示如何清除 gigabitethernet 1/1 的计数器: Switch#clear counters gigabitethernet 1/1 Clear "show interface" counters on this interface [confirm] y Switch# 配置 3 层接口 在特权模式下,请遵循以下步骤配置 3 层接口: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {{fastethernet|gigabitethernet}interface-id} |{vlan vlan-id}|{aggregateport port-number} 选择接口,进入接口配置模式。 步骤 3 no switchport 将该接口Shut Down并且重新转换成 3 层模式。该命令只适用于 Switch Port 和 L2 Aggregrate port。 步骤 4 ip address ip_address subnet_mask [secondary] 配置 IP 地址和子网掩码。 步骤 5 no shutdown 重新打开接口。 步骤 6 end 回到特权模式。 删除一个 3 层接口的 IP 地址可以使用接口配置模式的 no ip address ip-address 命令。使用 命令 no ip address 则删除所有的 ip 地址.一个 L2 Aggregate Port 的成员口,不能进行 no switchport 操作。 下面的例子是描述如何将一个 2 层接口配置成 routed port,并且给该接口分配 IP 地址: Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface gigabitethernet 2/1 Switch(config-if)#no switchport Switch(config-if)#ip address 192.20.135.21 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#end 配置 SVI 本节主要描述如何创建 SVI 及和 SVI 的一些相关配置。 您可在通过 interface vlan vlan-id 创建一个 SVI 或修改一个已经存在的 SVI。 在特权模式下,请遵循以下步骤进行 SVI 的配置: 1.通过以下步骤进入 SVI 接口配置模式: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface vlan vlan-id 进入 SVI 接口配置模式。 2.然后可对 SVI 的相关属性进行配置,详细的信息请参考“第二十五章 配置 IP 单址路由”。 下面的例子显示如何进入接口配置模式,并且给 SVI 100 分配 IP 地址: Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface vlan 100 Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#end Switch# 配置 Routed port 本节描述如何创建 Routed port 及和 Routed port 的一些相关配置。 您可在接口模式下,进入某个接口后,使用 no switchport 来创建 Routed port。 请遵循以下步骤来创建一个 Routed port 并给该 Routed port 分配 IP 地址: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface {fastethernet|gigabitethernet}interface-id 选择接口,进入接口配置模式。 步骤 3 no switchport 将该接口 Shut Down 并转换成 3 层模 式 步骤 4 ip address ip_address subnet_mask 配置 IP 地址和子网掩码。 步骤 5 no shutdown 重新打开接口。 步骤 6 end 回到特权模式。 注意:当一个接口是 L2 Aggregate Port 的成员口时,是不能用 switchport/ no switchport 命令进行层次切 换的。 下面的例子显示如何将一个 2 层接口配置成 routed port,并且给该接口分配 IP 地址: Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface fastethernet 0/6 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#end Switch# 配置 L3 Aggregate Port 本节描述如何创建 L3 Aggregate Port 及和 L3 Aggregate Port 的一些相关配置。 您可在接口模式下使用 no switchport 将某个 L2 Aggregate Port 转化为 L3 Aggregate Port,请遵循以 下步骤来创建一个 L3 Aggregate Port 并给该 L3 Aggregate Port 分配 IP 地址: 命令 含义 步骤 1 configure terminal 进入全局配置模式。 步骤 2 interface aggregateport port-number 选择接口,进入接口配置模式。 步骤 3 no switchport 将该接口 Shut Down 并转换成 3 层模 式。 步骤 4 ip address ip_address subnet_mask 配置 IP 地址和子网掩码。 步骤 5 no shutdown 重新打开接口。 步骤 6 end 回到特权模式。 下面的例子显示如何创建 L3 Aggregate Port,并且给该接口分配 IP 地址: Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#interface aggregateport 2 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#end Switch# 显示接口状态 本节描述接口的显示内容,显示实例。您可在特权模式下通过 show 命令可来查看接口状态。在特权 模式下您可使用以下命令显示接口状态: 命令 说明 show interfaces [interface-id] 显示指定接口的全部状态和配置信息。 show interfaces interface-id status 显示接口的状态。 show interfaces [interface-id] switchport 显示可交换接口(非路由接口)的 administrative 和 operational 状态信息。 show interfaces [interface-id] description 显示指定接口的描述配置和接口状态。 show interfaces [interface-id] counters 显示指定端口的统计值信息 show running-config interface [interface-id] 显示当前运行的接口配置. 以下例子为显示接口 gigabitethernet 1/1 的接口状态: Switch#show interfaces gigabitethernet 1/1 GigabitEthernet : Gi 1/1 Description : user A AdminStatus : up OperStatus : down Hardware : 1000BASE-TX Mtu : 1500 PhysAddress : LastChange : 0:0h:0m:0s AdminDuplex : Auto OperDuplex : Unknown AdminSpeed : 1000M OperSpeed : Unknown FlowControlAdminStatus : Enabled FlowControlOperStatus : Disabled Priority : 1 以下例子为显示接口 SVI 5 的接口状态和配置信息: Switch#show interfaces vlan 5 VLAN : V5 Description : SVI 5 AdminStatus : up OperStatus : down Primary Internet address : 192.168.65.230/24 Secondary Internet address : 192.168.65.111/24 Tertiary Internet address : 192.168.65.10/24 Quartus Internet address : 192.168.65.11/24 Broadcast address : 192.168.65.255 PhysAddress : 00d0.f800.0001 LastChange : 0:0h:0m:5s 以下例子为显示接口 aggregateport 3 的接口状态: Switch#show interfaces aggregateport 3: Interface : AggreatePort 3 Description : AdminStatus : up OperStatus : down Hardware : - Mtu : 1500 LastChange : 0d:0h:0m:0s AdminDuplex : Auto OperDuplex : Unknown AdminSpeed : Auto OperSpeed : Unknown FlowControlAdminStatus : Autonego FlowControlOperStatus : Disabled Priority : 0 以下例子显示接口 fastethernet 0/1 的接口配置信息: Switch#show interfaces fastethernet 0/1 switchport Interface Switchport Mode Access Native Protected VLAN lists ---------- ---------- --------- --------- --------- --------- ------------------ Fa0/1 Enabled Access 1 1 Enabled All 以下例子为显示接口 gigabitethernet 2/1 的接口描述: Switch#show interfaces gigabitethernet 1/2 discription Interface Status Administrative Description ------------ --------- ----------- ------------------ Gi2/1 down down Gi 2/1 以下例子为显示端口 Switch#show interfaces fastEthernet0/2 counters Interface : Fa0/2 5 minute input rate :9144 bits/sec, 9 packets/sec 5 minute output rate :1280 bits/sec, 1 packets/sec InOctets : 17310045 InUcastPkts : 37488 InMulticastPkts : 28139 InBroadcastPkts : 32472 OutOctets : 1282535 OutUcastPkts : 17284 OutMulticastPkts : 249 OutBroadcastPkts : 336 Undersize packets : 0 Oversize packets : 0 collisions : 0 Fragments : 0 Jabbers : 0 CRC alignment errors : 0 AlignmentErrors : 0 FCSErrors : 0 dropped packet events (due to lack of resources): 0 packets received of length (in octets): 64:46264, 65-127: 47427, 128-255: 3478, 256-511: 658, 512-1023: 18016, 1024-1518: 125 以下例子为显示所有接口的配置信息 Switch#sh running-config interface Building configuration... Current configuration : 88 bytes ! interface vlan 1 no shutdown ip address 192.168.65.122 255.255.255.0 ! end 配置接口 概述 2层接口(L2 interface) Switch Port Access Port Trunk Port L2 Aggregate Port 3层接口(L3 interface) SVI(Switch virtual interface) Routed Port L3 Aggregate Port 配置接口 接口编号规则 接口配置命令的使用 使用interface range命令 配置一定范围的接口 配置和使用端口范围的宏定义 选择接口介质类型 配置接口的描述和管理状态 配置接口的速度,双工,流控 配置2层接口 配置Switch Port 配置L2 Aggregate Port 清除接口的统计值并复位该接口 配置3层接口 配置SVI 配置Routed port 配置L3 Aggregate Port 显示接口状态 << /ASCII85EncodePages false /AllowTransparency false /AutoPositionEPSFiles true /AutoRotatePages /All /Binding /Left /CalGrayProfile (Dot Gain 20%) /CalRGB
本文档为【配置接口】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_164532
暂无简介~
格式:pdf
大小:705KB
软件:PDF阅读器
页数:18
分类:互联网
上传时间:2010-11-01
浏览量:27