思科路由器配置命令(二)

您所在的位置:网站首页 思科怎么进入config-if 思科路由器配置命令(二)

思科路由器配置命令(二)

2024-07-15 23:38:56| 来源: 网络整理| 查看: 265

一、交换机基础配置命令

Switch>enable Switch# configure terminal Switch(config)# vlan 10 创建vlan,编号为10 Switch(config-vlan)# name nanjin 命名vlan,名称为nanjin Switch(config)#interface vlan 10 进入vlan Switch (config-if)#description link-to dianx 给vlan添加备注信息 Switch(config-if)# ip address 172.16.1.1 255.255.255.0 给vlan配ip地址。 Switch(config-if)# no shutdown 打开vlan Switch#show vlan brief 查看vlan及接口详情 Switch#show interfaces vlan 10 查看具体vlan的情况

二、交换技术配置

1、trunk端口配置 Switch(config)# int e0/1 Switch(config-if)#switchport trunk encapsulation dot1q 接口的trunk封装802.1Q协议,用于启用trunk Switch(config-if)# switchport mode trunk 接口模式为trunk模式 2、access端口配置 Switch(config)# int e0/0 Switch(config-if)# switchport mode access 接口模式为access模式 Switch(config-if)# switchport access vlan 10 将接口划分到vlan10下 3、VLAN许可 Switch(config-if)# switchport trunk allowed vlan 10 trunk链路放行vlan10的流量 Switch(config-if)# switchport trunk native vlan 20 trunk链路禁止vlan20流量通过 Switch #show interfaces trunk 查看trunk链路详情

三、链路聚合

SW1(config)# interface port-channel 1 创建一个通道,通道号为1 SW1(config)#int e0/0 SW1(config-if)# switchport trunk encapsulation dot1q 启用trunk链路 SW1(config-if)# switchport mode trunk SW1(config-if)#channel-group 1 mode active 将接口加入到1号通道中,封装协议为LACP SW1(config)# int e0/1 同上 SW1(config-if)# switchport trunk encapsulation dot1q SW1(config-if)# switchport mode trunk SW1(config-if)#channel-group 1 mode active

SW2(config)# interface port-channel 1 创建一个通道,通道号为1,要和SW1相同 SW2(config)#int e0/0 SW2(config-if)# switchport trunk encapsulation dot1q SW2(config-if)# switchport mode trunk SW2(config-if)#channel-group 1 mode active SW2(config)# int e0/1 SW2(config-if)# switchport trunk encapsulation dot1q SW2(config-if)# switchport mode trunk SW2(config-if)#channel-group 1 mode active SW2#show etherchannel summary 查看链路状态

四、MSTP生成树

Switch(config)#spanning-tree mode mst 生成树模式改为mst Switch(config)#spanning-tree mst configuration 进入mst配置模式 Switch(config-mst)#revision 1 设置配置修订号,只有revision号相同的交换机才是在同一个mst域 Switch(config-mst)#instance 1 vlan 1,2,3,4,5 将vlan映射到实例1中 Switch(config-mst)#instance 2 vlan 10,20,30,40,50 将vlan映射到实例2中 Switch(config-mst)#exit 退出配置生效 Switch(config)#spanning-tree mst 1 priority 0 Switch(config)#spanning-tree mst 2 priority 4096 设置此交换机为MST1的根桥,MST2的备份根桥

Switch2(config)#spanning-tree mode mst 生成树模式改为mst Switch2(config)#spanning-tree mst configuration 进入mst配置模式 Switch2(config-mst)#revision 1 设置配置修订号,只有revision号相同的交换机才是在同一个mst域 Switch2(config-mst)#instance 1 vlan 1,2,3,4,5 将vlan映射到实例1中 Switch2(config-mst)#instance 2 vlan 10,20,30,40,50 将vlan映射到实例2中 Switch2(config-mst)#exit 退出配置生效 Switch2(config)#spanning-tree mst 1 priority 4096 Switch2(config)#spanning-tree mst 2 priority 0 设置此交换机为MST2的根桥,MST1的备份根桥 Switch#show spanning-tree 查看stp状态

五、MAC地址绑定

Switch(config)# interface e0/0 Switch(config-if)#switchport port-security mac-address 00:50:79:66:68:04 配置需要绑定低MAC地址 Switch(config-if)#switchport port-security maximum 1 限制次端口运行的MAC地址数为1 Switch(config-if)#switchport port-security violation shutdown 当发现与上述配置不符合时,吧端口down掉

六、单臂路由

R1(config)# interface e0/0 R1(config-if)#no shutdown 打开和交换机互联的接口 R1(config)#int e0/0.1 进入该接口的子接口 R1(config-subif)#encapsulation dot1Q 10 用于承载vlan10的流量 R1(config-subif)#ip address 192.168.10.1 255.255.255.0 给接口配置地址,为vlan的网关 R1(config-subif)# no shutdown 打开接口 R1(config)#int e0/0.2 进入该接口的子接口 R1(config-subif)#encapsulation dot1Q 20 用于承载vlan20的流量 R1(config-subif)#ip address 192.168.20.1 255.255.255.0 给接口配置地址,为vlan的网关 R1(config-subif)# no shutdown 打开接口

互联的交换机接口启用trunk Switch(config)# int e0/0 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭