交换机配置命令模式
交换机配置命令大全

交换机配置命令大全交换机是网络中非常重要的设备,它可以实现局域网内计算机之间的数据传输和通信。
在进行交换机的配置时,我们需要掌握一些基本的配置命令,以确保交换机能够正常运行并满足网络的需求。
下面将介绍一些常用的交换机配置命令,希望对大家有所帮助。
1. 设置交换机的主机名。
在配置交换机之前,我们首先需要设置交换机的主机名,以便在网络中进行识别和管理。
我们可以通过以下命令来设置交换机的主机名:```。
Switch(config)#hostname S1。
```。
这条命令将交换机的主机名设置为S1,您也可以根据实际情况进行修改。
2. 配置交换机的管理IP地址。
为了实现对交换机的远程管理,我们需要为交换机配置一个IP地址。
我们可以通过以下命令来配置交换机的管理IP地址:```。
Switch(config)#interface vlan 1。
Switch(config-if)#ip address 192.168.1.1 255.255.255.0。
Switch(config-if)#no shutdown。
```。
这条命令将VLAN 1接口的IP地址设置为192.168.1.1,子网掩码为255.255.255.0,并启用该接口。
3. 配置交换机端口。
在实际网络中,我们需要对交换机的端口进行配置,以满足不同设备的连接需求。
以下是一些常用的端口配置命令:```。
Switch(config)#interface fastethernet 0/1。
Switch(config-if)#switchport mode access。
Switch(config-if)#switchport access vlan 10。
```。
这条命令将FastEthernet 0/1端口设置为接入模式,并将该端口划分到VLAN 10中。
4. 配置交换机的VLAN。
VLAN是虚拟局域网的缩写,它可以将一个物理局域网划分成多个逻辑上的局域网。
交换机的几种配置模式的介绍

交换机的几种配置模式介绍2016-08-03弱电行业网交换机的几种配置模式简介1、普通用户模式开机直接进入普通用户模式•在该模式下我们只能查询交换机的一些基础信息.如版本号(ShoW VerSion )等。
2、特权用户模式在普通用户模式下输入enable命令即可进入特权用户模式.在该模式下我们可以查看交换机的配置信息和调试信息等等。
3、全局配置模式在特权用户模式下输入C terminal命令即可进入全局配置模式.在该模式下主要完成全局参数的配置.具体配置以后介绍。
4、接口配置模式在全局配置模式下输入in terface in terface-list 即可进入接口配置模式.在该模式下主要完成接口参数的配置.具体配置以后介绍。
5、vlan配置模式在全局配置模式下输入vlan vlan-number 即可进入vlan 配置模式.在该配置模式下可以完成vlan 的一些相关配置。
6、恢复交换机的缺省配置在实验开始时. 为了不让实验受交换机以前的配置影响. 常常需要先恢复交换机的缺省配置。
在特权用户模式下顺序使用erase.restet 命令即可恢复交换机的缺省配置。
交换机说明说明1:在实验环境中. 如果配置两个vlan :vlan1.vlan2. 注意其中vlan1 是交换机默认的vlan. 既不能创建也不能删除. 所有端口都属于vlan1. 所以应该首先创建vlan2. 然后为各个vlan 分配端口( switchport interface-list )。
说明2:① 在使用命令行进行配置的时候. 在任何模式下均可以使用“?” 来帮助我们完成配置。
② 使用“?”可以查询任何模式下可以使用的命令; 或者某参数后面可以输入的参数; 或者以某字母开始的命令。
例如在全局配置模式下输入“?”或“ ShoW ? ”或“ s?”.可以看看它们分别有什么帮助信息显示。
如果你不能确认当前模块所在的插槽的编号•可以通过命令行中的show命令来查看插槽以及插槽上的端口信息;也可以在路由器特权EXEC^式下执行show VerSiOn命令.在路由器版本信息中有每个模块所在插槽编号的信息。
交换机基本配置命令汇总大全

交换机基本配置命令汇总大全一、交换机基本操作:1.1进入特权模式Switch>enableSwitch#1.2返回用户模式Switch#exitPress RETURN to get started!Switch>二、配置模式:全局配置模式[主机名(config)#]:配置交换机的整体参数2.1子模式:1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数2.2进入、退出全局配置模式Switch#configure terminalSwitch(config)#exitSwitch#2.3进入、退出线路配置模式Switch(config)#line console0Switch(config-line)#exitSwitch(config)#2.4进入、退出接口配置模式Switch(config)#interface fastEthernet0/1Switch(config-if)#exitSwitch(config)#2.5从子模式下直接返回特权模式Switch(config-if)#endSwitch#三、交换机操作帮助:Ø支持命令简写(按TAB键将命令补充完整)Ø在每种操作模式下直接输入“?”显示该模式下所有的命令Ø命令空格“?”显示命令参数并对其解释说明Ø“字符?”显示以该字符开头的命令Ø命令历史缓存:(Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令Ø错误提示信息四、交换机显示命令:Ø显示交换机硬件及软件的信息Switch#show versionØ显示当前运行的配置参数Switch#show running-configØ显示保存的配置参数Switch#show configure五、常用交换机flash中的命令:5.1将当前运行的配置参数复制到flashSwitch#write memoryBuilding configuration...[OK]Switch#5.2清空flashSwitch#delete flash:config.textSwitch#5.3交换机重新启动:Switch#reloadSystem configuration has been modified.Save?[yes/no]:n Proceed with reload?[confirm]5.4配置交换机主机名:Switch(config)#hostname S2126G-1S2126G-1(config)#5.5配置交换机口令:1)配置交换机的登陆密码S2126G(config)#enable secret level10star“0”表示输入的是明文形式的口令2)配置交换机的特权密码S2126G(config)#enable secret level150star“0”表示输入的是明文形式的口令六、常用交换机配置命令:6.1为交换机分配管理IPS2126G(config)#interface vlan1S2126G(config-if)#ip address{IP address}{IP subnetmask}[secondary]6.2将接口启用S2126G(config-if)#no shutdown6.3将接口关闭S2126G(config-if)#shutdown6.4配置接口速率S2126G(config-if)#speed[10|100|auto]6.5配置接口双工模式S2126G(config-if)#duplex[auto|full|half]七、显示接口状态:S2126G#show interface八、测定目的端的可达性:S2126G>ping{IP address}九、从TFTP服务器下载配置参数:S2126G#copy tftp startup-config十、管理交换机MAC地址表:10.1查看MACS2126G#show mac-address-table10.2配置MACS2126G(config)#mac-address-table aging-time<10-1000000> 10.3查看MACS2126G#show mac-address-table aging-time十一、VLAN的配置:11.1添加一个VLANS2126G(config)#vlan<1-4094>S2126G(config-vlan)#11.2为VLANS2126G(config-vlan)#name名字十二、将交换机端口分配到VLAN12.1配置Port VLANSwitch(config-if)#switchport access vlan<1-4094>12.2配置Tag VLANSwitch(config-if)#switchport mode trunk1)配置本地(native)VLANSwitch(config-if)#switchport trunk native vlan<1-4094> Native VLAN即PVID,默认情况下每个trunk口的native VLAN是12)从主干链路中清除VLANSwitch(config-if)#switchport trunk allowed vlanexcept vlan-list注:VLAN1不可被清除3)在主干链路中允许所有VLANSwitch(config-if)#switchport trunk allowed vlan all4)向主干链路中加入VLANSwitch(config-if)#switchport trunk allowed vlanadd vlan-list12.3VLAN1.显示全部的VLAN:Switch#show vlan2.显示单独的VLAN:Switch#show vlan id<1-4094>十三、RSTP的配置:13.1启用生成树:S2126G(config)#spanning-tree13.2配置交换机优先级:S2126G(config)#spanning-tree priority<0-61440>“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)13.3配置交换机端口优先级:S2126G(config-if)#spanning-tree port-priority<0-240>“0”或“16”的倍数(RSTP BPDU该值后4bit全0)13.4生成树helloS2126G(config)#spanning-tree hello-time<1-10>13.5生成树的验证:Switch#show spanning-treeSwitch#show spanning-tree interface<接口名称><接口编号>十四、三层交换机路由功能:14.1开启三层交换机的路由功能Switch(config)#ip routing14.2开启端口的三层路由功能Switch(config)#interface fastethernet0/1Switch(config-if)#no switchport(这样就可以为某一端口配置IP)Switch(config-if)#ip address192.168.1.1255.255.255.0 Switch(config-if)#no shutdown。
交换机的配置与管理命令

交换机的配置与管理实验目标●掌握交换机基本信息的配置管理。
实验背景●某公司新进一批交换机,在投入网络以后要进行初始配置与管理,你作为网络管理员,对交换机进行基本的配置与管理。
技术原理●交换机的管理方式基本分为两种:带内管理和带外管理。
●通过交换机的Console端口管理交换机属于带外管理;这种管理方式不占用交换机的网络端口,第一次配置交换机必须利用Console端口进行配置。
●通过Telnet、拨号等方式属于带内管理。
●交换机的命令行操作模式主要包括:●用户模式Switch>●特权模式Switch#●全局配置模式Switch(config)#●端口模式Switch(config-if)#基本配置:实验步骤:●新建Packet Tracer拓扑图●了解交换机命令行1、模式切换命令:●进入特权模式(en)●进入全局配置模式(conf t)●进入交换机端口视图模式(int f0/1)●返回到上级模式(exit)●从全局以下模式返回到特权模式(end或者快捷键ctrl+z)2、常用快捷操作命令●帮助信息(如? 、co?、copy?)●命令简写(如conf t)●命令自动补全(Tab)●快捷键(ctrl+c中断测试,ctrl+z退回到特权视图)●Reload重启。
(在特权模式下)3、基本命令●查看交换机信息(show)●设置交换机名称(hostname X)●配置交换机的端口参数(speed 、duplex、优化和启用禁用)实验设备Switch_2960 1台;PC 1台;配置线;PC console端口Switch>enableSwitch#conf tSwitch(config)#hostname XSwitch(config)#interface fa 0/1Switch(config-if)#end使用tab键,命令简写,帮助命令?高级配置:实验步骤:●新建Packet Tracer拓扑图●了解交换机端口配置命令行●修改交换机名称(hostname X)●配置交换机端口参数(speed,duplex)●查看交换机版本信息(show version)●查看当前生效的配置信息(show running-config)●查看保存在NVRAM中的启动配置信息(show startup-config)●查看端口信息Switch#show interface●查看交换机的MAC地址表Switch#show mac-address-table●选择某个端口Switch(config)# interface type mod/port (type表示端口类型,通常有ethernet、Fastethernet、Gigabitethernet)(mod表示端口所在的模块,port表示在该模块中的编号)例如interface fastethernet0/1●选择多个端口Switch(config)#interface type mod/startport-endport●设置端口通信速度Switch(config-if)#speed [10/100/auto]●设置端口单双工模式Switch(config-if)#duplex [half/full/auto]●交换机、路由器中有很多密码,设置对这些密码可以有效的提高设备的安全性。
思科交换机配置命令

Cmd1. switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号" 全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息+ # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port- channel port-channel-number} 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口例:Switch(config)# interface gigabitethernet0/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN 号或旧的来进行修改。
HPN交换机简单配置命令

HPN交换机简单配置命令1,进入配置模式、查看全局配置、退出<HP>system-view[HP]display-cu[HP]quit2,配置VLAN,命名VLAN ,配置vlan ip[HP]vlan 10[HP-vlan10]description XXXXXX[HP]interface vlan10[HP-vlan-interface10]ip address 192.168.1.0 255.255.255.03,接口配置access vlan[HP]interface range g1/0/1 to g1/0/10 g1/0/18[HP-if-range]port link-type access[HP-if-range]port access vlan 10*老IOS没有RANGE命令可以进入vlan配置下加接口[HP]vlan 10[HP-vlan10]port g1/0/1 to g1/0/10 g1/0/184,接口配置trunk[HP]interface g1/0/1[HP -GigabitEthernet1/0/1]port link-type trunk[HP -GigabitEthernet1/0/1]port trunk permit vlan 1112022[HP -GigabitEthernet1/0/1]port trunk permit vlan all5,配置DHCP relay[HP]dhcp enable[HP]dhcp relay server-group 1 ip 192.168.1.10[HP]dhcp relay server-group 1 ip 192.168.1.20[HP]interface vlan10[HP-vlan-interface10]dhcp select relay[HP-vlan-interface10]dhcp relay server-select 16,配置stp[HP]stp enable[HP]stp mode stp/mstp/pvst/rstp[HP]stp instance 1 root/priority 0[HP]stp vlan 1 to 4094 root/priority 07,配置channel-group[HP]int Bridge-Aggregation 1[HP -Bridge-Aggregation1]port link-type trunk[HP -Bridge-Aggregation1]port trunk permit vlan 1112022[HP -Bridge-Aggregation1]link-aggregation mode dynamic[HP]interface g1/0/1[HP -GigabitEthernet1/0/1]port link-type trunk[HP -GigabitEthernet1/0/1]port trunk permit vlan 1112022[HP -GigabitEthernet1/0/1]port link-aggregation group 18,配置user,权限,以及登陆方式[HP]local-user 123[HP -luser - 123]password cipher 123[HP -luser - 123]authorization-attribute level 3[HP -luser - 123]service-type ssh telnet terminal[HP -luser - 123]service-type web[HP -luser - 123]quit[HP] user-interface vty 0 15[HP –ui -vty0-15] authentication-mode scheme9,配置静态路由[HP]ip route-static 0.0.0.0 0.0.0.0 192.168.1.25010,配置ACL[HP]acl number 3001[HP –acl –adv -3001]rule 10 permit ip source 192.168.158.0 0.0.1.255 [HP –acl –adv -3001]rule 20 deny tcp destination 192.168.156.0 0.0.1.255 destination-port eq 445[HP –acl –adv -3001]rule 30 deny tcp destination 192.168.156.0 0.0.1.255 destination-port eq 139[HP –acl –adv -3001]rule 40 permit ip[HP]interface vlan10[HP-vlan-interface10] packet-filter 3001 inbound[HP-vlan-interface10] packet-filter 3001 outbound11,配置端口安全接口下:loopback-detection enable =loop graudstp edged-port enable =portfaststp root-protection =root graudport-security max-mac-count 2port-security port-mode autolearndhcp snoopingdhcp snooping information enabledhcp snooping trust12,其他命令:ntp-service unicast-server 172.28.126.2snmp-agentsnmp-agent community read/write proacs!rosnmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 172.28.42.244 params securityname publicinfo-center loghost 172.28.42.245 facility local0sysname OKS-1A-5500telnet server enableip ttl-expires enableip unreachables enable13 IRFSw1:irf member 1 renumber 1irf member 1 priority 32interface Ten-GigabitEthernet 1/1/1shutdowninterface Ten-GigabitEthernet 1/1/2shutdownirf-port 1/2port group interface Ten-GigabitEthernet 1/1/1port group interface Ten-GigabitEthernet 1/1/2interface Ten-GigabitEthernet 1/1/1undo shutdowninterface Ten-GigabitEthernet 1/1/2undo shutdownSw2irf member 1 renumber 2rebootinterface Ten-GigabitEthernet 2/1/1shutdowninterface Ten-GigabitEthernet 2/1/2shutdownirf-port 2/1port group interface Ten-GigabitEthernet 2/1/1port group interface Ten-GigabitEthernet 2/1/2interface Ten-GigabitEthernet 2/1/1undo shutdowninterface Ten-GigabitEthernet 2/1/2undo shutdown。
二层交换机基本配置命令

二层交换机基本配置命令二层交换机是指只支持OSI第二层(数据链路层)交换技术的交换机,二层交换技术发展比较成熟,二层交换机属数据链路层设备,可以识别数据包中的MAC地址信息,根据MAC地址进行转发,并将这些MAC地址与对应的端口记录在自己内部的一个地址表中。
下面给大家介绍二层交换机基本配置命令,一起来了解一下吧!二层交换机基本配置命令1、进入特权模式switch> (用户模式)进入特权模式 enableswitch> enable 按回车键Enterswitch# (特权模式 )2、进入全局配置模式进入全局配置模式 configure terminalswitch#configure terminal 按回车键EnterSwitch(config)# (全局配置模式)3、交换机命名交换机命名 hostname CY3C_HTLZYQ_P6ZHSA (以CY3C_HTLZYQ_P6ZHSA为例)Switch(config)#hostname CY3C_HTLZYQ_P6ZHSA 按回车键EnterCY3C_HTLZYQ_P6ZHSA(config)#4、创建Vlan创建VlanCY3C_HTLZYQ_P6ZHSA(config)#Vlan +n (n代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字 (给Vlan创建个名字)5、创建管理Vlan和管理IP地址创建管理Vlan和管理IP地址CY3C_HTLZYQ_P6ZHSA(config)#Vlan +nCY3C_HTLZYQ_P6ZHSA(config-vlan)#name +名字 (根据自己想要的结果命名)按exit退出CY3C_HTLZYQ_P6ZHSA(config)#interface Vlan +n (n代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#ip address +管理ip地址 +子网掩码按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown (开启 Vlan)6、设定此交换端口为trunk口设定此交换端口为trunk口CY3C_HTLZYQ_P6ZHSA(config)#interface +端口(比如F0/1) 按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode trunk ( 设定此交换端口为trunk即中继端口)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if)#no shutdown7、把端口划分到Vlan内把端口划分到Vlan内CY3C_HTLZYQ_P6ZHSA(config)#interface +端口【(比如F0/5) ( 把单个端口划分到Vlan内)】CY3C_HTLZYQ_P6ZHSA(config-if)#switchport mode access (设定f 0/1端口的接入类型为接入端口即access ports.)CY3C_HTLZYQ_P6ZHSA(config-if)#switchport access vlan +n ((把此端口即接入端口划分到vlan n中,n为vlan 号)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown或者CY3C_HTLZYQ_P6ZHSA(config)#interface range +端口【(比如FO/5 - 10 ) 把多个端口同时划分到一个Vlan内】CY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport mode accessCY3C_HTLZYQ_P6ZHSA(config-if-range)#switchport access Vlan +n (n 代表Vlan编号正常范围2―1000)按回车键EnterCY3C_HTLZYQ_P6ZHSA(config-if-range)#no shutdown8、配置交换机远程密码配置交换机远程密码CY3C_HTLZYQ_P6ZHSA(config)#enable password cisco (配置使能密码:cisco)CY3C_HTLZYQ_P6ZHSA(config)#line vty 0 5CY3C_HTLZYQ_P6ZHSA(config-line)#password cisco (配置用户密码:cisco)CY3C_HTLZYQ_P6ZHSA(config-line)#loginCY3C_HTLZYQ_P6ZHSA#write (进行配置保存,避免交换机断电后配置消失)9、一些查看交换机的'简单命令一些查看交换机的简单命令(1):show run 查看交换机配置信息(2):show Vlan 查看Vlan详细信息(3):show ip interface brief 查看接口信息(4):show cdp nerghbors 显示直连的相邻cisco设备及其详细信息(5):show cdp neighbors detail 显示ip地址和IOS版本和类型,并且包括show cdp neighbor命令的所有信息。
思科交换机配置命令简写表

简写命令完整命令1)用户模式:switch> switch>2)特权模式:switch>en switch>enableswitch# switch#3)全局配置模式:switch#conf t switch#config terminalswitch(config)# switch(config)#4)接口配置模式:switch(config)#in f0/1 switch(config)#interface f0/1 switch(config-if)# switch(config-if)#5)line模式:switch(config)#lin c 0 switch(config)#line console 0switch(config-line)# switch(config-line)#6)更改交换机主机名:switch(config)#ho benet switch(config)#hostname benetbenet(config)# benet(config)#7)配置进入特权模式的明文口令:switch(config)#en pass 123 switch(config)#enable password 123 8)删除进入特权模式的明文口令:switch(config)#no ena pass switch(config)#no enable password9)配置进入特权模式的加密口令:switch(config)#en se 456 switch(config)#enable secret 45610)删除进入特权模式的加密口令switch(config)#no ena se switch(config)#no enable secret11)查看交换机配置:switch#sh run switch#show running-config12)配置console口令:switch(config)#lin cons 0 switch(config)#line console 0switch(config-line)#pass 123 switch(config-line)#password 123switch(config-line)#logi switch(config-line)#login13)配置交换机IP地址:switch(config)#in vl 1 switch(config)#interface vlan 1switch(config-if)#ip ad 192.168.0.2 255.255.255.0 switch(config-if)#ip address 192.168.0.2 255.255.255.0switch(config-if)#no sh switch(config-if)#no shutdown14)配置交换机默认网关:switch(config)#ip default-g 192.168.0.1 switch(config)#ip default-gateway 192.168.0.115)查看交换机的MAC地址表:switch#sh mac-a switch#show mac-address-table16)查看思科交换机相邻设备的详细信息:switch#sh cdp nei de switch#show cdp neighbors detail17)保存交换机配置:1:switch#cop run st 1:switch#copy running-config startup-config 2:switch#wr 2:switch#write18)恢复交换机出厂配置:switch#er st switch#erase startup-configswitch#relo switch#reload19)创建VLAN:1:switch#vl da switch#vlan databaseswitch(vlan)#vl 30 switch(vlan)#vlan 30switch(vlan)#e switch(vlan)#exit2:20)删除VLAN:switch(vlan)#n vl 20 switch(vlan)#no vlan 20Deleting VLAN 2... Deleting VLAN 2...switch(vlan)#e switch(vlan)#exit21)将端口加入到VLAN:switch(config)#in f0/2 switch(config)#interface f0/2switch(config-if)#sw a v 30 switch(config-if)#switchport access vlan 3022)验证VLAN配置信息:switch#sh vlan b switch#show vlan briefswitch#sh vlan-s switch#show vlan-switch23)删除VLAN中的端口:1:switch(config-if)#no sw a v 3 switch(config-if)#no switchport access vlan 3 switch(config-if)#end switch(config-if)#end2:switch(config-if)#def interface f0/2 switch(config-if)#default interface f0/2 Building configuration... Building configuration...Interface FastEthernet0/2 set to default configuration Interface FastEthernet0/2 set to default configurationswitch(config)#end switch(config)#end24)同时将多个端口加入VLAN并验证:switch(config)#in r f0/3 - 10 switch(config)#interface range f0/3 - 10switch(config-if-range)#sw a v 3 switch(config-if-range)#switchport access vlan 3switch(config)#end switch(config)#endswitch#sh vlan-s switch#show vlan-switch25)配置VLAN TRUHK:switch(config)#in f0/15 switch(config)#interface f0/15switch(config-if)#sw m t switch(config-if)#switchport mode trunk26)从TRUNK中添加某个VLAN:switch(config)#in f0/15 switch(config)#interface f0/15switch(config-if)#sw t a v ad 3 switch(config-if)#switchport trunk allowed vlan add 3switch(config-if)#end switch(config-if)#end27)从TRUNK中删除某个VLAN:switch(config)#in f0/15 switch(config)#interface f0/15switch(config-if)#sw t a v r 3 switch(config-if)#switchport trunk allowed vlan remove 3switch(config-if)#end switch(config-if)#end28)验证接口模式(检查中断端口允许的VLAN列表):switch#sh int f0/15 switchp switch#show interface f0/15 switchport29)查看用过的命令:switch#sh hi switch#show histor。
华为、H3C、锐捷三家交换机配置命令详解

华为、H3C、锐捷三家交换机配置命令详解一、华为交换机基础配置命令1<Quidway> //用户视图,也就是在Quidway模式下运行命令。
<Quidway>system-view //进入配置视图[Quidway] vlan 10 //创建vlan 10,并进入vlan10配置视图,如果vlan10存在就直接进入vlan10配置视图[Quidway-vlan10] quit //回到配置视图[Quidway] vlan 100 //创建vlan 100,并进入vlan100配置视图,如果vlan10存在就直接进入vlan100配置视图[Quidway-vlan100] quit //回到配置视图2[Quidway] interface GigabitEthernet2/0/1 (10G光口)[Quidway- GigabitEthernet2/0/1] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100 [Quidway- GigabitEthernet2/0/1] quit //回到配置视图[Quidway] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口配置视图中。
0代表1号口[Quidway- GigabitEthernet1/0/0] port link-type access //定义端口传输模式[Quidway- GigabitEthernet2/0/1] port default vlan 10 //将这个端口加入到vlan10中[Quidway- GigabitEthernet2/0/1] quit3<Quidway>system-view[Quidway]vlan 10[Quidway-vlan10]port GigabitEthernet 1/0/0 to 1/0/29 //将0到29号口加入到vlan10中[Quidway-vlan10]quit4[Quidway] interface Vlanif100 // 进入vlan100接口视图与vlan 100命令进入的地方不同[Quidway-Vlanif100] ip address 119.167.200.90 255.255.255.252 // 定义vlan100管理IP三层交换网关路由[Quidway-Vlanif100] quit //返回视图[Quidway] interface Vlanif10 // 进入vlan10接口视图与vlan 10命令进入的地方不同[Quidway-Vlanif10] ip address 119.167.206.129 255.255.255.128 // 定义vlan10管理IP三层交换网关路由[Quidway-Vlanif10] quit5[Quidway]ip route-static 0.0.0.0 0.0.0.0 119.167.200.89 //配置默认网关。
H3C华为交换机配置命令大全

H3C交换机配置命令大全1、system-view 进入系统视图模式2、sysname 为设备命名3、display current-configuration 当前配置情况4、language-mode Chinese|English 中英文切换5、interface Ethernet 1/0/1 进入以太网端口视图6、port link-type Access|Trunk|Hybrid 设置端口访问模式7、undo shutdown 翻开以太网端口8、shutdown 关闭以太网端口9、quit 退出当前视图模式10、vlan 10 创立VLAN 10并进入VLAN 10的视图模式11、port access vlan 10 在端口模式下将当前端口参加到vlan 10中12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口参加到当前vlan中13、port trunk permit vlan all 允许所有的vlan通过H3C路由器1、system-view 进入系统视图模式2、sysname R1 为设备命名为R13、display ip routing-table 显示当前路由表4、language-mode Chinese|English 中英文切换5、interface Ethernet 0/0 进入以太网端口视图6、ip address 192.168.1.1 255.255.255.0 配置IP地址和子网掩码7、undo shutdown 翻开以太网端口8、shutdown 关闭以太网端口9、quit 退出当前视图模式10、ip route-static 192.168.2.0 255.255.255.0 192.168.12.2 description To.R2 配置静态路由11、ip route-static .0 0.0.0.0 192.168.12.2 description To.R2 配置默认的路由H3C S3100 SwitchH3C S3600 SwitchH3C MSR 20-20 Router1、调整超级终端的显示字号;2、捕获超级终端操作命令行,以备日后查对;3、language-mode Chinese|English 中英文切换;4、复制命令到超级终端命令行,粘贴到主机;5、交换机去除配置:<H3C>reset save ;<H3C>reboot ;6、路由器、交换机配置时不能掉电,连通测试前一定要检查网络的连通性,不要犯最低级的错误。
H3C交换机基本配置命令大全介绍

H3C交换机基本配置命令大全介绍交换机工作于OSI参考模型的第二层,即数据链路层。
交换机内部的CPU会在每个端口成功连接时,通过将MAC地址和端口对应,形成一张MAC表,其中H3C交换机是比较常用的一种,那么有哪些配置命令呢?这篇文章主要介绍了H3C交换机基本配置命令明细一览,需要的朋友可以参考下1:配置登录用户,口令等//用户直行模式提示符,用户视图system-view //进入配置视图[H3C] //配置视图(配置密码后必须输入密码才可进入配置视图)[H3C] sysname xxx //设置主机名成为xxx这里使用修改特权用户密码system-view[H3C]super password level 3 cipher/simple xxxxx //设置本地登录交换机命令[H3C] aaa //进入aaa认证模式定义用户账户[H3C-aaa] local-user duowan password cipher duowan[H3C-aaa] local-user duowan level 15[H3C-aaa] local-user duowan service-type telnet terminal ssh //有时候这个命令是最先可以运 //行的,上边两个命令像password,level都是定义完vty 的 // authentication-mode aaa后才出现[H3C-aaa] quit[H3C] user-interface vty 0 4 //当时很奇怪这个命令就是找不到,最后尝试了几次才能运行[H3C-ui-vty0-4] authentication-mode aaa[H3C-ui-vty0-4] quit单独设置远程登录账户:system-view[H3C]user-interface vty 0 4[H3C-ui-vty0-4]authentication-mode password //设置登录模式[H3C-ui-vty0-4]user privilege level 3 //管理权限配置,3为管理级权限[H3C-ui-vty0-4]set authentication password cipher 123456 //设置登录密码以密文方式登录[H3C-ui-vty0-4]quit[H3C]2:H3C VLan设置创建vlan://用户直行模式提示符,用户视图system-view //进入配置视图[H3C] vlan 10 //创建vlan 10,并进入vlan10配置视图,如果vlan10存在就直接进入vlan10配置视图[H3C-vlan10] quit //回到配置视图[H3C] vlan 100 //创建vlan 100,并进入vlan100配置视图,如果vlan10存在就直接进入vlan100配置视图[H3C-vlan100] quit //回到配置视图将端口加入到vlan中:[H3C] interface GigabitEthernet2/0/1 (10G光口)[H3C- GigabitEthernet2/0/1] port link-type access //定义端口传输模式[H3C- GigabitEthernet2/0/1] port default vlan 100 //将端口加入vlan100[H3C- GigabitEthernet2/0/1] quit[H3C] interface GigabitEthernet1/0/0 //进入1号插槽上的第一个千兆网口配置视图中。
华为H3C交换机配置命令

华为H3C交换机配置命令华为H3C交换机配置命令华为交换机之间只能有一条通路,使得信息集中在一条通信链路上,不能进行动态分配,以平衡负载。
下面是店铺整理的关于华为H3C交换机配置命令,希望大家认真阅读!一、配置软件和硬件1、配置(Console)电缆连接配置电缆是一根8芯屏蔽电缆,一端是压接的RJ-45连接器,插入交换机的Console口里;另一端则同时带有一个DB-9(孔)和DB-25(孔)连接器2、配置软件及设置使用系统自带的“超级终端”,运行“hypertrm”程序,设置终端参数参数要求:波特率为9600,数据位为8,奇偶校验为无,停止位为1,流量控制为无,选择终端仿真为VT100。
二、常用命令1、用户模式:交换机启动后在控制台直接按回车就进入用户模式(远程管理telnet 交换机ip时需要口令)。
--帮助quit ――退出当前模式返回上一级ping ip-address --测试网络连通性telnet ip-address --从交换机登陆其它设备super --从用户模式进入特权模式2、特权模式:进入特权模式一般需要口令,可以防止非法登陆交换机display current --显示当前运行的`配置save --保存当前运行的配置reboot --重启交换机display mac ――显示mac地址表display inteface ethernet 0/1 ――查看以太网口状态system-view --从特权模式进入全局模式3、全局模式:更改配置a.进入以太网口配置模式及相关配置[switchone]interface ethernet 0/1[switchone-Ethernet0/1]shutdown/undo shutdown 关闭/打开接口[switchone-Ethernet0/1]port link-type access/trunk 接口类型设为untagged端口(默认)/tagged端口(用于上行口和级联口) access端口发出和接收的帧不带vlan标记,即untagged端口trunk端口发出和接收的帧一般要带vlan标记,即tagged端口设为tagged口后,还要做以下操作:[switchone-Ethernet0/1]port trunk permit vlan 225 to 250 这条命令是允许有vlan标记225到250的帧上传b.进入vlan配置模式(为了便于操作,不用在接口模式下配置access,而在vlan模式下进行相关操作)[switchone]vlan 225[switchone-vlan225] port Ethernet 1/1 将ethernet 1/1加入vlan225c.设置super口令[switchone]super password simple 2403h 特权口令为2403h。
几种交换机配置常见命令模式的深入介绍

⼏种交换机配置常见命令模式的深⼊介绍⼏种交换机配置常见命令模式的深⼊介绍Cisco IOS交换机配置常见命令需要在各⾃的命令模式下才能执⾏,因此,如果想执⾏某个命令,必须先进⼊相应的配置模式。
⼏种交换机配置常见命令模式的深⼊介绍,关于交换机配置常见命令的问题,下⾯将介绍到User EXEC模式、Privileged EXEC模式、VLAN dataBase模式、Global configuration 模式、Interface configuration模式和Line configuration模式等交换机配置常见命令模式。
在交换机配置常见命令中,通常是利⽤以上配置菜单中的”[K]Command Line“项进⾏的。
Cisco交换机所使⽤的软件系统为Catalyst IOS。
CLI的全称为”Command-Line Interface“,中⽂名称就称之为”命令⾏界⾯“,它是⼀个基于DOS命令⾏的软件系统模式,对⼤⼩写不敏感(即不区分⼤⼩写)。
有这种模式的不仅交换机有、路由器、防⽕墙都有,其实就是⼀系列相关命令,但它与DOS命令不同,CLI可以缩写命令与参数,只要它包含的字符⾜以与其他当前可⽤⾄的命令和参数区别开来即可。
虽然对交换机的配置和管理也可以通过多种⽅式实现,既可以使⽤纯字符形式的命令⾏和菜单(Menu),也可以使⽤图形界⾯的Web浏览器或专门的⽹管软件(如CiscoWorks 2000)。
相⽐较⽽⾔,命令⾏⽅式的功能更强⼤,但掌握起来难度也更⼤些。
下⾯把交换机配置常见命令介绍如下。
Cisco IOS共包括6种不同的交换机配置常见命令模式:User EXEC模式、Privileged EXEC模式、VLAN dataBase模式、Global configuration模式、Interface configuration 模式和Line configuration模式。
当在不同的模式下,CLI界⾯中会出现不同的提⽰符。
常见交换机配置命令

交换机常用命令及配置(cisco)switch> 用户模式1.进入特权模式enableswitch> enableswitch#2.进入Setup模式setupswitch> enableswitch#setup3.进入全局配置模式configure terminalswitch> enableswitch#configure terminalswitch(conf)#4.交换机命名hostname (以switch01 为例)switch> enableswitch#configure terminalswitch(conf)#hostname switch01switch01(conf)#5.配置密文密码enable secret (以123 为例)switch> enableswitch#configure terminalswitch(conf)# enable secret1236.配置明文密码enable password (以456 为例)switch> enableswitch#configure terminalswitch (conf)# enable password45611.设置虚拟端口的IP地址、网关等(以vlan 1为例)switch> enableswitch#configure terminalswitch(conf)# interface vlan 1switch(conf-if)# ip address192.168.1.254 255.255.255.0//配置交换机端口ip 和子网掩码switch (conf-if)#no shutdown //激活端口switch (conf-if)#exit //退出到上层配置模式switch (conf)#ip default-gateway192.168.1.254 //设置网关地址为什么要设置虚拟端口?虽然PC和交换机都可以配IP地址,但PC上的IP地址是绑定到以太网接口,交换机上的IP地址是绑定到VLAN。
思科交换机配置命令简写与完整对照版

Interface FastEthernet0/2 set to default configuration Interface FastEthernet0/2 set to default configuration
switch#sh vlan-s switch#show vlan-switch
25)配置VLAN TRUHK:
switch(config)#in f0/15 switch(config)#interface f0/15
switch#sh vlan-s switch#show vlan-switch
23)删除VLAN中的端口:
1:switch(config-if)#no sw a v 3 switch(config-if)#no switchport access vlan 3
6)更改交换机主机名:
switch(config)#ho benet switch(config)#hostname benet
benet(config)# benet(config)#
switch(vlan)#e switch(vlan)#exit
21)将端口加入到VLAN:
switch(config)#in f0/2 switch(config)#interface f0/2
switch(config-if)#sw a v 30 switch(config-if)#switchport access vlan 30
22)验证VLAN配置信息:
switch#sh vlan b switch#show vlan brief
华为路由器交换机配置命令大全

华为路由器交换机配置命令大全华为路由器交换机配置大全1XXX华为路由器交换机配置命令大全一、计算机命令#shutdown-hnow;关机#init 0;关机#logout;用户注销#login;用户登录#ifconfig;显示IP地址#ifconfig eth0 netmask;设置IP地址#ifconfig eht0 netmask down;禁用IP地址#route add 0.0.0.0 gw;设置网关#route del 0.0.0.0 gw;删除网关#route add default gw;设置网关#route del default gw;删除网关#route;显示网关#ping;发ECHO包#telnet;远程登录二、XXX路由器交换机配置命令:交换机命令[Quidway]dis cur;显示当前配置[Quidway]display current-configuration;表现当前配置[Quidway]display interfaces;显示接口信息[Quidway]display vlan;表现vlan信息[Quidway]display version;显示版本信息[Quidway]super password;修改特权用户密码[Quidway]sysname;交流机定名[Quidway]interface vlan x;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0;配置VLAN的IP地址[Quidway]Ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;静态路由=网关[Quidway]rip;rip协议[Quidway]local-user ftp[Quidway]user-interface vty 0 4;进入假造终端[S3026-ui-vty0-4]authentication-mode password;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222;设置口令[S3026-ui-vty0-4]user privilege level 3;用户级别[Quidway]vlan3;创建VLAN[Quidway]monitor-port;指定镜像端口[Quidway]port mirror;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num;指定镜像和被镜像[Quidway]description string;指定VLAN描述字符[Quidway]description;删除VLAN描述字符[Quidway]display vlan[vlan_id];检察VLAN设置[Quidway]stp{enable|disable};设置天生树,默许封闭[Quidway]stp priority 4096;设置交换机的优先级[Quidway]stp root{primary|secondary};设置为根或根的备份[SwitchA-vlanx]isolate-user-vlan enable;设置主vlan所以设置PVID为所属vlanid,设置可以互通的vlan为untagged.3、XXX路由器交流机配置敕令:路由器敕令[Quidway]display version;表现版本信息[Quidway]display current-configuration;表现当前配置[Quidway]display interfaces;显示接口信息[Quidway]display ip route;表现路由信息[Quidway]sysname aabbcc;变动主机名[Quidway]super password ;设置口令[Quidway]interface serial0;进入接口华为路由器交换机配置大全3[Quidway-serial0]ip address;配置端口IP地址[Quidway-serial0]undo shutdown;激活端口[Quidway]link-protocol hdlc;绑定hdlc协议[Quidway]user-interface vty 0 4[Quidway-ui-vty0-4]authentication-mode password[Quidway-ui-vty0-4]set authentication-mode password simple 222[Quidway-ui-vty0-4]user privilege level 3[Quidway-ui-vty0-4]quit[Quidway]debugging XXX;显示所有信息[Quidway]debugging XXX;调试事件信息[Quidway]debugging XXX;表现包的信息四、XXX路由器交换机配置命令:静态路由:[Quidway]ip route-static{interfacenumber|nexthop}[value][reject|blackhole]例如:[Quidway]ip route-static 129.1.0.0 16 10.0.0.2[Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2[Quidway]ip route-static 129.1.0.0 16 Serial2[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.0.0.25、XXX路由器交流机配置敕令:静态路由:[Quidway]rip;设置静态路由[Quidway]rip work;设置工作允许[Quidway]ri pinput;设置入口允许[Quidway]rip output;设置出口允许[Quidway-rip]network 1.0.0.0;设置交换路由网络[Quidway-rip]network all;设置与所有网络交换[Quidway-rip]peer ip-address;[Quidway-rip]summary;路由聚合[Quidway]rip version 1;设置事情在版本1[Quidway]rip version 2 multicast;设版本2,多播体式格局[Quidway-Ethernet0]rip split-horizon;水平分隔[Quidway]XXX;配置路由器的ID[Quidway]ospf enable;启动OSPF协议[Quidway-ospf]import-routedirect;引入直联路由[Quidway-Serial0]ospf enable area;配置OSPF地区六、XXX路由器交换机配置命令:标准访问列表命令格式如下:acl[match-orderconfig|auto];默许前者按次婚配。
交换机命令行配置与VLAN

交换机命令⾏配置与VLAN交换机的配置我们下⾯以Cisco公司的Catalyst2900交换机为例,介绍交换机的⼀般配置过程。
⼀、交换机配置⽅式1. 通过Console(控制台)端⼝连接终端或运⾏终端仿真软件的微机;第⼀次对交换机和路由器设置必须使⽤该⽅式。
波特率:9600;数据位8;奇偶校验⽆;停⽌位1。
2. 通过AUX端⼝连接MODEM,通过电话线与远⽅的终端或运⾏终端仿真软件的微机相连。
3. 通过TFTP服务器。
4. 通过TELNET程序。
5. 通过SNMP⽹管⼯作站(如Cisco Works 2000)6. 此外,在交换机中启⽤HTTP服务,还可通过浏览器来配置。
⼆、交换机、路由器的存储器和配置⽂件1、存储器分类1)RAM:随机存储器,相当于计算机的内存,掉电时所有信息都清空。
⽤于保存交换机和路由器的运⾏数据,如路由表、ARP表、各端⼝运⾏状态等。
2)ROM:只读存储器,⽤来存储系统引导软件和监控程序,其内容由⼚商在出⼚前固化,不能更改。
3)NVRAM:⾮易失性可读写存储器,其特点是断电后内容不丢失。
⽤来保存配置⽂件,启动时⽤这个配置⽂件作为初始化配置⽂件。
4)Flash:闪存,它也是断电内容不丢失的存储器,⽤来存储交换机和路由器操作系统IOS,⼀般不修改,当升级IOS版本时可以修改。
2、配置⽂件及其备份配置⽂件有两份:1)当前运⾏的配置(running-config):存储在RAM中的,可以修改,当关闭时,配置将全部丢失。
2)备份配置(startup-config):存储在NVRAM中,每次启动时会⾃动装⼊。
有以下⼏种备份⽅式:1)保存配置到NVRAM Switch#copy running-config startup-config2)保存配置到TFTP服务器中 Switch#copy running-config tftp3)覆盖当前配置⽂件 Switch#copy startup-config running-config Switch#config memory Switch#copy tftp running-config Switch#setup三、命令模式1、交换机的命令⾏(CLI)操作交换机和路由器的命令是按模式分组的,每种模式中都定义了⼀组命令集,所以想要使⽤某个命令,就必须先进⼊相应的模式。
中兴交换机配置流程和配置命令

中兴交换机配置流程和配置命令一、登录设备1. 首先,通过网线将电脑与中兴交换机的console端口相连。
2. 打开终端仿真软件,如SecureCRT、Putty等。
3.创建一个新的串口会话,选择正确的串口号和波特率,点击“打开”按钮连接设备。
4. 在终端仿真软件上输入交换机的IP地址和登录密码,按Enter键确认登录。
二、创建VLAN1.查看当前交换机上已有的VLAN信息,使用以下命令:show vlan2.创建一个新的VLAN,使用以下命令:vlan vlan-id [vlan-name]vlan-id为VLAN的编号,取值范围为1-4094;vlan-name为VLAN的名称,可选参数。
3.将端口添加到VLAN中,使用以下命令:port vlan vlan-id {port-string , all} [untagged]vlan-id为VLAN的编号;port-string为端口的范围,如1-10;all表示所有端口;untagged可选参数,表示将端口设置为不带Tag的访问端口。
4.在创建完VLAN后,可以使用以下命令查看已配置的VLAN信息:show vlan三、配置端口1.进入接口配置模式,使用以下命令:interface interface-type interface-numberinterface-type为接口类型,如Ethernet、GigabitEthernet等;interface-number为接口编号。
2.配置接口的模式,使用以下命令:[switchport mode {access , trunk}]access表示接口为访问模式,用于连接终端设备;trunk表示接口为Trunk模式,用于连接上层网络设备。
3.配置接口的访问模式下的VLAN信息,使用以下命令:switchport access vlan vlan-idvlan-id为所需的VLAN编号。
4. 配置Trunk模式下的VLAN信息,使用以下命令:switchport trunk vlan {add , remove} vlan-idadd表示添加一个新的VLAN,remove表示移除一个VLAN;vlan-id为VLAN的编号。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
交换机配置命令模式EXEC模式:用户模式switch>交换机信息的查看,简单测试命令特权模式switch#查看、管理交换机配置信息,测试、调试配置模式:全局配置模式switch(config)#配置交换机的整体参数接口配置模式switch(config-if)#配置交换机的接口参数进入全局配置模式Switch#configure terminalSwitch(config)#exitSwitch#进入接口配置模式Switch(config)#interface fastethernet 0/1 Switch(config-if)#exitSwitch(config)#从子模式下直接返回特权模式Switch(config-if)#endSwitch#命令行其他功能获得帮助switch#?switch#show ?命令简写全写:switch# configure terminal简写:Switch# config使用历史命令Switch# (向上键)Switch# (向下键)配置交换机Telnet功能配置远程登陆密码Switch(config)#enable secret level 10 ruijie配置进入特权模式密码Switch (config)#enable secret level 150 ruijie为交换机配置管理IPSwitch (config)#interface vlan 1Switch (config-if)#no shutdown Switch (config-if)#ip address 192.168.1.1255.255.255.0Switch (config-if)#end配置文件的管理保存配置将当前运行的参数保存到flash 中用于系统初始化时初始化参数Switch#copy running-config startup-config Switch#write memorySwitch#write删除配置永久性的删除flash 中不需要的文件使用命令delete flash:config.text删除当前的配置:在配置命令前加no例:switch(config-if)# no ip address查看配置文件内容Switch#show configure 查看保存在FLASH里的配置信息Switch#show running-config 查看RAM里当前生效的配置配置Port VLAN创建VLAN10,将它命名为test的例子Switch# configure terminalSwitch(config)# vlan 10Switch(config-vlan)# name testSwitch(config-vlan)# end把接口0/10加入VLAN10Switch# configure terminal Switch(config)# interface fastethernet 0/10 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan10Switch(config-if)# end将一组接口加入某一个VLAN Switch(config)#interface rangefastethernet 0/1-8,0/15,0/20 Switch(config-if-range)# switchport accessvlan 20注:连续接口0/1-8,不连续接口用逗号隔开,但一定要写明模块编号配置Tag VLAN-Trunk把Fa0/1配成Trunk口Switch# configure terminal Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode trunk 把端口Fa0/20 配置为Trunk端口,但是不包含VLAN 2:Switch(config)# interface fastethernet 0/20 Switch(config-if)# switchport trunk allowedvlan remove 2Switch(config-if)# endNative VLAN配置命令:Switch(config-if)# switchport trunk nativevlan 20Switch(config-if)# end注意:每个Trunk口的缺省native VLAN是VLAN1在配置Trunk链路时,请确保连接链路两端的Trunk口属于相同的native VLAN保存/清除VLAN信息将VLAN信息保存到flash中Switch#write memory从flash中只清除VLAN信息Switch#delete flash:vlan.dat从RAM中删除VLANSwitch(config)#no vlan VLAN-id生成树协议的配置开启生成树协议Switch(config)#Spanning-tree关闭生成树协议Switch(config)#no Spanning-tree配置生成树协议的类型Switch(config)#Spanning-tree modestp/rstp锐捷全系列交换机默认使用MSTP协议配置交换机优先级Switch(config)#spanning-tree priority<0-61440>(“0”或“4096”的倍数、共16个、缺省32768)恢复到缺省值Switch(config)# no spanning-tree priority 配置交换机端口的优先级Switch(config)#interfaceinterface-type interface-numberSwitch(config-if)#spanning-treeport-priority number配置STP、RSTPSpanning Tree 的缺省配置:关闭STPSTP Priority 是32768STP port Priority 是128STP port cost 根据端口速率自动判断Hello Time 2秒Forward-delay Time 15秒Max-age Time 20秒可通过spanning-tree reset 命令让spanning tree参数恢复到缺省配置查看生成树协议配置显示生成树状态Switch#show spanning-tree显示端口生成树协议的状态Switch#show spanning-tree interfacefastethernet <0-2/1-24>配置aggregate port将该接口加入一个APSwitch#configure terminalSwitch(config) # interface interface-typeinterface-idSwitch(config-if-range)#port-groupport-group-number如果这个AP不存在,可自动创建AG端口查看聚合端口的汇总信息Switch#show aggregateport summary 查看聚合端口的流量平衡方式Switch#show aggregateport load-balance路由器上配置telnet第一步: 配置端口地址RouterA# configure terminal !进入全局配置模式RouterA(config)# interfacefastethernet 1/0!进入路由器接口配置模式RouterA(config-if)# ip address 192.168.0.1 255.255.255.0!配置路由器管理接口IP地址RouterA(config-if)# no shutdown !开启路由器f 1/0接口第二步:配置远程登录密码RouterA(config)# line vty 0 4 !进入路由器线路配置模式RouterA(config-line)# login !配置远程登录RouterA(config-line)# password star !设置路由器远程登录密码为“star”RouterA(config-line)#end第三步:配置路由器特权模式密码RouterA(config)# enable secret star !设置路由器特权模式密码为“star”或者RouterA(config)# enable password star查看配置文件show version !查看版本及引导信息show running-config !查看运行配置show startup-config !查看用户保存在NVRAM中的配置文件保存配置文件Router#copy running-config startup-configRouter#write memoryRouter#write删除配置文件Router#delete flash:config.text !删除初始配置文件查看路由信息router#show ip routeCodes: C - connected,S – static,R –RIP,O- OSPFIA - OSPF inter area,E1-OSPF externaltype 1E2 - OSPF external type 2,* - candidatedefaultGateway of last resort is 10.5.5.5 tonetwork 0.0.0.0172.16.0.0/24 is subnetted, 1 subnetsC 172.16.11.0 is directly connected,serial1/2O E2 172.22.0.0/16 [110/20] via 10.3.3.3,01:03:01, Serial1/2S* 0.0.0.0/0 [1/0] via 10.5.5.5静态路由配置命令配置静态路由用命令ip route router(config)#ip route [网络编号] [子网掩码] [转发路由器的IP地址/本地接口]例:ip route 192.168.10.0255.255.255.0 serial 1/2例:ip route 192.168.10.0 255.255.255.0172.16.2.1静态路由描述转发路径的方式有两种指向本地接口(即从本地某接口发出)指向下一跳路由器直连接口的IP地址(即将数据包交给X.X.X.X)配置默认路由:router(config)#ip route 0.0.0.0 0.0.0.0 [转发路由器的IP地址/本地接口]RIP路由协议的版本RIPv1有类路由协议,不支持VLSM以广播的形式发送更新报文不支持认证RIPv2无类路由协议,支持VLSM以组播的形式发送更新报文支持明文和MD5的认证配置RIP协议配置步骤1、开启RIP路由协议进程Router(config)#router rip2、申请本路由器参与RIP协议的直连网段信息Router(config-router)#network192.168.1.03、指定RIP协议的版本2(默认是version1)Router(config-router)#version 24、在RIPv2版本中关闭自动汇总Router(config-router)#no auto-summary查看RIP配置信息验证RIP的配置Router#show ip protocols显示路由表的信息Router#show ip route清除IP路由表的信息Router#clear ip route在控制台显示RIP的工作状态Router#debug ip ripOSPF协议OSPF配置如下:1、创建loopback接口,定义ROUTE ID routerA(config)#interface loopback 10 routerA(config)#ip address 192.168.100.1255.255.255.02、开启OSPF进程routerA(config)#router ospf 1010代表进程编号,只具有本地意义3、申请直连网段routerA(config-router)#network 10.1.1.00.0.0.255 area 0注意反掩码和区域号查看OSPF配置信息验证OSPF的配置Router#show ip ospf显示路由表的信息Router#show ip route清除IP路由表的信息Router#clear ip route在控制台显示OSPF的工作状态Router#debug ip ospf三层交换的路由功能三层交换机默认开启路由功能Switch(config)#ip routing (开启三层交换机路由功能)三层交换机配置路由接口的两种方法开启三层交换机物理接口的路由功能Switch(config)#interface fastethernet 0/5 Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.1.1255.255.255.0Switch(config-if)#no shutdown关闭物理接口路由功能Switch(config-if)# switchport采用SVI方式(switch virtual interface)Switch(config)#interface vlan 10Switch(config-if)#ip address192.168.1.1.255 255.255.0Switch(config-if)#no shutdown三层交换机和路由器相连的网络方法一(SVI):Switch(config)#interface f0/10 Switch(config-if)#switchport access vlan10Switch(config-if)#exitSwitch(config)#interface vlan 10 switch(config-if)#ip address 192.168.10.1255.255.255.0Switch(config-if)#no shutdown方法二(路由接口):Switch(config)#interface f0/10Switch(config-if)#no switchport Switch(config-if)#ip address 192.168.10.1255.255.255.0Switch(config-if)#no shutdown三层交换机路由协议的配置静态路由Switch(config)#ip route x.x.x.x x.x.x.x[x.x.x.x/interface]RIPSwitch(config)#router ripSwitch(config-router)#network X.X.X.XSwitch(config-router)#version 2注:三层交换机不支持no auto-summaryOSPFSwitch(config)#router ospf Switch(config)#network X.X.X.X X.X.X.Xarea x查看三层交换机路由配置查看路由接口信息Switch#show ip interface查看路由表Switch#show ip route查看动态路由协议Switch#show ip ripSwitch#show ip ospfPPP的配置路由器上的配置RA(config)#interface seriel 1/2RA(config-if)# encapsulation ppp 注:路由器广域网默认封装方式为HDLCPAP验证的配置客户端(被验证方)RA(config)#interface seril 0RA(config-if)# encapsulation pppRA(config-if)#ppp pap sent-usernameruijie password 123服务端(验证方)RB(config)#username ruijie password 123 RB(config)#interface seril 0RB(config-if)# encapsulation pppRB(config-if)#ppp authentication papCHAP认证配置客户端(被验证方)RA(config)#username RB password 123 RA(config)#interface serial 0RA(config-if)#encapsulation ppp服务端(验证方)RB(config)#username RA password 123 RB(config)#interface serial 0RB(config-if)#encapsulation pppRB(config-if)#ppp authentication chapPPP认证的调试特权模式下输入:Router#show interfaces serial 1/2Router#debug ppp authentication交换机端口安全安全违例产生于以下情况:如果一个端口被配置为一个安全端口,当其安全地址的数目已经达到允许的最大个数如果该端口收到一个源地址不属于端口上的安全地址的包当安全违例产生时,你可以选择多种方式来处理违例:Protect:当安全地址个数满后,安全端口将丢弃未知名地址(不是该端口的安全地址中的任何一个)的包Restrict:当违例产生时,将发送一个Trap通知Shutdown:当违例产生时,将关闭端口并发送一个Trap通知配置安全端口端口安全最大连接数配置switchport port-security !打开该接口的端口安全功能switchport port-security maximum!设置接口上安全地址的最大个数,范围是1-128,缺省值为128switchport port-securityviolation{protect|restrict |shutdown}!设置处理违例的方式注意:1、端口安全功能只能在access端口上进行配置。