思科交换机端口配置
思科交换机安全端口配置

令,或者你可以手动的shut再no shut端口。这个是端口安全违规的默认动作。
默认的端口安全配置:
以下是端口安全在接口下的配置-
特性:port-sercurity 默认设置:关闭的。
特性:最大安全mac地址数目 默认设置:1
特性:违规模式 默认配置:shutdown,这端口在最大安全mac地址数量达到的时候会shutdown,并发
足够数量的mac地址,来降下最大数值之后才会不丢弃。
?restrict:
一个**数据和并引起"安全违规"计数器的增加的端口安全违规动作。
?shutdown:
一个导致接口马上shutdown,并且发送SNMP陷阱的端口安全违规动作。当一个安全端口处在error-
disable状态,你要恢复正常必须得 敲入全局下的errdisable recovery cause psecure-violation 命
switch(config-if)#end
switch#show port-sec add
Secure Mac Address Table
------------------------------------------------------------
Vlan Mac Address Type Ports
switch(config-if)#end
switch#show port-sec int f0/12
Security Enabled:Yes, Port Status:SecureUp
Violation Mode:Shutdown
Max. Addrs:5, Current Addrs:0, Configure Addrs:0
思科交换机路由器常规配置命令

Neighbor 相邻网络号 remote-as 自治域号 /* 自治域间的网络 */
四、流量控制
1)被动端口
passive interface 端口号
2)缺省路由
ip default 网络号/端口网络
3)静态路由
ip route 目标网络号 掩码 端口号
rl(config)# enable password cisco 配置进入enable模式的密码, 区分大小写
rl(config)# enable secret ciscocisco 配置进入enable模式的密码,是加密的密码,show run是看不见的
rl(config)# line console 0
rl# show cdp neighbors 查看CDP邻居信息
rl(config-if)# ip add 10.0.0.1 255.0.0.0 进入相应的接口,配置相应的IP地址
rl# ping 10.0.0.2 使用ping命令查看邻居的连通性
Ppp chap password
2)X.25
encapsulation x25 [dce]
x25 address
x25 map 协议地址 /*SVC */
x25 pvc pvc号 ip地址 x25地址 /*PVC */
思科交换机的基本配置

思科交换机的基本配置随着Internet的高速发展,网络规模不断膨胀,对于从事网络专业的学生熟练掌握路由器和交换机的配置已显得十分重要。
接下来是小编为大家收集的思科交换机的基本配置方法,希望能帮到大家。
思科交换机的基本配置的方法一、交换机的基本配置Author:chenchao in ZJNU从本篇文章开始,将连载大概8-9篇自己学习交换与路由的实验报告,但是怕自己能力不行,会出现错误,所以,先载两篇文章,依次为:交换机的基本配置;路由器基本配置。
本篇为交换机的基本配置,使用的仿真软件是Cisco的一款免费软件:Cisco Packet Tracer。
想学习的可以在百度自行下载。
下面开始附上实验过程:实验环境:Cisco 2950交换机1台,Console电缆1根,PC机一台,网线1根。
连接如下图所示:实验步骤:一、交换机的带外配置;1、在用户模式、特权模式、全局模式、接口模式之间转换;Switch>enableSwitch#configure terminalEnter configuration commands, one perline. End with CNTL/Z.Switch(config)#interface FastEthernet 0/1Switch(config-if)#exitSwitch(config)#exitSwitch#%SYS-5-CONFIG_I: Configured from console byconsoleSwitch#exitSwitch con0 is now availablePress RETURN to get started.Switch>2、将交换机的名称改为“student”;Switch(config)#hostname studentstudent(config)#3、为交换机各个模式设置密码“cisco”;特权模式下的密码保护student#enablestudent#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#enable password ciscostudent(config)#enable secret cisco1远程登录口令设置student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#line console 0student(config-line)#line vty 0 4student(config-line)#password cisco2student(config-line)#loginstudent(config-line)#student#4、为交换机制定一个IP地址10.10.10.X/24;student#configConfiguring from terminal, memory, ornetwork [terminal]?Enter configuration commands, one perline. End with CNTL/Z.student(config)#interface vlan 1student(config-if)#ip address 10.10.10.1255.0.0.05、开启交换机的Telnet服务功能,建立Telnet用户admin,口令cisco,并制定只能从10.10.10.y/24登录Telnet服务器;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#user admin password 0 ciscostudent(config)#6、查看配置情况;student>enablePassword:student#show running-cBuilding configuration...hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i.enable password cisco!!username admin password 0 ciscointerface Vlan1ipaddress 10.10.10.1 255.0.0.0!!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!End二、交换机的端口配置:1、配置接口的描述、关闭借口、启动接口、配置接口的速度为100Mbps、配置接口工作模式为全双工、配置接口的流程控制;student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/1student(config-if)#shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to administratively down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#student(config-if)#exitstudent(config)#interface FastEthernet0/1student(config-if)#no shutdown%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to upstudent(config-if)#speed 100student(config-if)#duplex full%LINK-5-CHANGED: Interface FastEthernet0/1,changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface FastEthernet0/1, changed state to down%LINEPROTO-5-UPDOWN: Line protocol onInterface Vlan1, changed state to downstudent(config-if)#2、配置接口FastEthernet0/10为Access口;student#student#configure terminalEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface FastEthernet0/10student(config-if)#switchport mode accessstudent(config-if)#3、配置接口FastEthernet0/12为Trunk口;student#student#configure tEnter configuration commands, one perline. End with CNTL/Z.student(config)#interface fastethernet0/12student(config-if)#switchport mode Trunkstudent(config-if)#end4、查看配置情况;!interface FastEthernet0/1duplex fullspeed100!!interface FastEthernet0/9!interface FastEthernet0/10switchport mode access!interface FastEthernet0/11!interface FastEthernet0/12switchport mode trunk!student#show running-cBuilding configuration...Current configuration : 1275 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msec no service password-encryption!hostname student!enable secret 5$1$mERr$q.MA2tj.WFptzvbifq/1i. enable password cisco!!username admin password 0 cisco!!duplex fullspeed 100!interface FastEthernet0/2 !interface FastEthernet0/3 !interface FastEthernet0/4 !interface FastEthernet0/5 !interface FastEthernet0/6 !interface FastEthernet0/7 !interface FastEthernet0/8 !interface FastEthernet0/9 !interface FastEthernet0/10 switchport mode access !interface FastEthernet0/11 !interface FastEthernet0/12 switchport mode trunk!interface FastEthernet0/13 !!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet1/1 !interface GigabitEthernet1/2 !interface Vlan1ipaddress 10.10.10.1 255.0.0.0 !!line con 0!line vty 0 4password cisco2loginline vty 5 15login!!end看了“思科交换机的基本配置”还想看:。
思科交换机基本配置[非常详细]
![思科交换机基本配置[非常详细]](https://img.taocdn.com/s3/m/799d5c4b27d3240c8547ef12.png)
cisco交换机基本配置1.Cisco IOS简介Cisco Catalyst系列交换机所使用的操作系统是IOS(Internetwork Operating System,互联网际操作系统)或COS (Catalyst Operating System),其中以IOS使用最为广泛,该操作系统和路由器所使用的操作系统都基于相同的内核和shell。
IOS的优点在于命令体系比较易用。
利用操作系统所提供的命令,可实现对交换机的配置和管理。
Cisco IOS操作系统具有以下特点:(1)支持通过命令行(Command-Line Interface,简称CLI)或Web界面,来对交换机进行配置和管理。
(2)支持通过交换机的控制端口(Console)或Telnet会话来登录连接访问交换机。
(3)提供有用户模式(user level)和特权模式(privileged level)两种命令执行级别,并提供有全局配置、接口配置、子接口配置和vlan数据库配置等多种级别的配置模式,以允许用户对交换机的资源进行配置。
(4)在用户模式,仅能运行少数的命令,允许查看当前配置信息,但不能对交换机进行配置。
特权模式允许运行提供的所有命令。
(5)IOS命令不区分大小写。
(6)在不引起混淆的情况下,支持命令简写。
比如enable通常可简约表达为en。
(7)可随时使用?来获得命令行帮助,支持命令行编辑功能,并可将执行过的命令保存下来,供进行历史命令查询。
1.搭建交换机配置环境在对交换机进行配置之前,首先应登录连接到交换机,这可通过交换机的控制端口(Console)连接或通过Telnet登录来实现。
(1)通过Console口连接交换机对于首次配置交换机,必须采用该方式。
对交换机设置管理IP地址后,就可采用Telnet登录方式来配置交换机。
对于可管理的交换机一般都提供有一个名为Console的控制台端口(或称配置口),该端口采用RJ-45接口,是一个符合EIA/TIA-232异步串行规范的配置口,通过该控制端口,可实现对交换机的本地配置。
【最新】思科交换机up端口配置-范文模板 (17页)

#在特权模式下输入configure terminal进入全局配置模式(global configuration mode),在这之下输入的命令叫做全局命令,一旦输入,将对整个router产生即时影响。
*Mar 1 00:44:26.491: %SYS-5-CONFIG_I: Configured from console by console t # 在输入命令的过程中,IOS会出现一些即时提示。
4.2 接入交换机的相关配置 ............................................................................................................... 8
5、配置交换机的路由功能 .................................................................................................................... 9
Router>
# 显示稳定后,出现最初的提示符,提示符“>”表示目前所处的状态为用户模式。 Router>
Router>en
# 如果在当前状态下没有重复的命令,可以用“TAB”键来补齐命令
Router>enable
# 从用户模式(user mode)进入到特权模式(exec mode),提示符变为“#”
1、基本概念介绍
IOS: 互联网操作系统,交换机和路由器常用操作系统 VLAN: 虚拟lan VTP: VLAN TRUNK PROTOCOL DHCP: 动态主机配置协议 ACL: 访问控制列表 三层交换机:具有三层路由转发能力的交换机
Cisco交换机端口聚合(EtherChannel)

Cisco交换机端口聚合(EtherChannel)端口聚合,英文简称EtherChannel(以太通道)是由Cisco研发的,应用于交换机之间的多链路捆绑技术。
它的基本原理是:将两个设备间多条物理链路捆绑在一起组成一条逻辑链路,从而达到带宽倍增的目的(这条逻辑链路带宽相当于物理链路带宽之和)。
除了增加带宽外,端口聚合还可以在多条链路上均衡分配流量,起到负载分担的作用;当一条或多条链路故障时,只要还有链路正常,流量将转移到其它的链路上,整个过程在几毫秒内完成,从而起到冗余的作用,增强了网络的稳定性和安全性。
两台交换机之间是否形成EtherChannel也可以用协议自动协商。
目前有两个协商协议:PAgP和LACP,PAgP(端口汇聚协议Port Aggregation Protocol)是Cisco私有的协议,而LACP(链路汇聚控制协议Link Aggregation Control Protocol)是基于IEEE 802.3ad的国际标准,是一种实现链路动态聚合的协议。
Switch(config-if-range)#channel-group 1 mode ? #通过此命令在交换机查看端口聚合可以使用的协议active Enable LACP unconditionally #主动发送LACP报文auto Enable PAgP only if a PAgP device is detected #被动发送PAgP报文desirable Enable PAgP unconditionally #主动发送PAgP报文on Enable Etherchannel only #手动设置,需要两边都设置成onpassive Enable LACP only if a LACP device is detected #被动接收LACP报文端口聚合说明:1、Cisco最多允许EtherChannel绑定8个端口;(1)、如果是百兆网络,总带宽可达1.6Gbit/s;(2)、如果是千兆网络,总带宽可达16Gbit/s。
2024版思科网络交换机配置命令详细总结归纳

VLAN间路由配置
01 02 03 04
使用`interface`命令进入三层接口配置模式,如`interface vlan 10`进入 VLAN 10的三层接口。
源端口和目的端口散列
同时考虑数据包的源端口和目的端口进行负载均衡。
配置负载均衡策略
在全局配置模式下使用`port-channel load-balance`命令进行配置。
端口聚合故障排除技巧
01
检查物理连接
确保所有参与聚合的物理端口都已 正确连接。
03
检查交换机配置
确认交换机的配置是否正确,包括 聚合模式、聚合组号等。
限制登录用户
指定允许通过SSH远程登录的用户或用户组。
交换机日志与审计功能启用
启用日志功能
将交换机操作记录到日志文件中,方便后续 审计和分析。
远程日志服务器
将日志文件发送到远程日志服务器进行集中 存储和管理。
配置日志级别
根据需要设置日志记录的详细程度(如信息、 警告、错误等)。
审计功能
启用审计功能,对特定操作进行实时监控和 记录。
思科网络交换机配置命令详细 总结归纳
目 录
• 交换机基本配置 • VLAN配置与管理 • 生成树协议(STP)配置与优化 • 端口聚合(EtherChannel)配置与应用 • 交换机安全性设置与加固 • 交换机性能监控与故障排除
01
交换机基本配置
交换机登录与访问控制
1 2
通过控制台端口登录 使用终端仿真软件通过控制台端口连接到交换机, 输入用户名和密码进行登录。
思科交换机的基本配置

思科交换机的基本配置思科交换机的基本配置H3C每年将销售额的15%以上用于研发投入,在中国的北京、杭州和深圳设有研发机构,在北京和杭州设有可靠性试验室以及产品鉴定测试中心。
下面店铺整理一些思科交换机的基本配置,希望大家认真阅读!CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名switch(config)#enable secret csico1 ;设置特权加密口令switch(config)#enable password csico8 ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;虚拟终端允许登录switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6switch#exit ;返回命令交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1 switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table 的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7 switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存Cisco路由器配置命令大全网络2010-06-26 06:43:44 阅读657 评论0 字号:大中小订阅 .(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 保存信息到NVRAM write 保存信息到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号或旧的来进行修改。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
---------------------------------------------------------------最新资料推荐------------------------------------------------------
思科交换机端口配置
Cisco 交换机配置新手篇之端口配置在 IOS 输入命令时只要
缩写的程度不会引起混淆,使用配置命令的时候都可以使用缩写的
形式。
比如:
Switchenable,在用户模式下以en 开头的命令就只有
enable,所以可以缩写成 Switchen。
也可以用 TAB 键把命令自动补全,如 Switchen,按键盘 TAB
后自动补全为 Switchenable。
快捷键: 1.Ctrl+A:把光标快速移动到整行的最开始
2.Ctrl+E:把光标快速移动到整行的最末尾
3.Esc+B:后退 1 个单词
4.Ctrl+B:后退 1 个字符
5.Esc+F:前进 1 个单词
6.Ctrl+F:前进
1 个字符 7.Ctrl+D:删除单独 1 个字符 8.Backspace:删除单独 1
个字符 9.Ctrl+R:重新显示 1 行 10.Ctrl+U:擦除 1 整行 11.
Ctrl+W:删除 1 个单词 12. Ctrl+Z 从全局模式退出到特权模式
13. Up arrow 或者 Ctrl+P:显示之前最后输入过的命令 14. Down
arrow 或者 Ctrl+N: 显示之前刚刚输入过的命令配置 enable 口
令以及主机名字,交换机中可以配置两种口令 (一) 使能口令
(enable password),口令以明文显示 (二) 使能密码(enbale
secret),口令以密文显示两者一般只需要配置其中一个,如果
两者同时配置时,只有使能密码生效. Switch.
1 / 5
/*用户直行模式提示符Switch. enable /*进入特权模式Switch. # /*特权模式提示符Switch. # config terminal /*进入配置模式Switch. (config) # /*配置模式提示符Switch. (config) # hostname Pconline
/*设置主机名Pconline Pconline(config) # enable password
pconline /*设置使能口令为 pconline Pconline(config) # enable
secret network /*设置使能密码为 network Pconline(config)
# line vty 0 15 /*设置虚拟终端线
Pconline(config-line) # login /*设置登陆验证
Pconline(config-line) # password skill /*设置虚拟终端登
陆密码注意:
默认情况下如果没有设置虚拟终端密码是无法从远端进行
telnet 的,远端进行 telnet时候会提示设置 login 密码。
许多新手会认为 no login 是无法从远端登陆,其实 no login
是代表不需要验证密码就可以从远端 telnet 到交换机,任何人都
能 telnet 到交换机这样是很危险的,千万要注意。
配置交换机 IP 地址,默认网关,域名,域名服务器:
应该注意的是在交换机设置的 IP 地址,网关,域名等信
息是为用于管理交换机而设置,与连接在该交换机上的网络设备无
关,也就是说你就算不配置 IP 信息,把网线缆插进端口,照样可
以工作。
---------------------------------------------------------------最新资料推荐------------------------------------------------------
Pconline(config) # ip address 192. 169. 1. 1 255. 255.
255. 0 /*设置交换机IP 地址/ Pconline(config) # ip
default-gateway 192. 169. 1. 254 /*设置默认网关
Pconline(config) # ip domain-name pconline. com /*
设置域名Pconline(config) # ip name-server 200. 0. 0. 1 /*设置域名服务器配置交换机端口属性:
交换机默认端口设置自动检测端口速度和双工状态,也就是
Auto-speed, Auto-duplex,一般情况下不需要对每个端口进行设置。
但根据 Cisco 的技术白皮书,接入改端口的网络设备的信息情
况下,建议直接配置相应的速度以及双工信息。
speed 命令可以选择搭配 10, 100 和 auto,分别代表
10Mb/s, 100Mb/s 和自动协商速度。
duplex 命令也可以选择 full, half 和 auto,分别代表全双
工,半双工和自动协商双工状态。
description 命令用于描述特定端口名字,建议对特殊端口进行
描述:
假设现在接入端口 1 的设备速度为 100Mb/s,双工状态为全
双工:
Pconline(config) # interface fastethernet 0/1 /*进入
接口0/1 的配置模式Pconline(config-if) # speed 100 /*设置该端口的速率为 100Mb/s Pconline(config-if) # duplex
3 / 5
full /*设置该端口为全双工 Pconline(config-if) # description up_to_mis /*设置该端口描述为up_to_mis Pconline(config-if) # end /*退回到特权模式 Pconline# show interface fastethernet 0/1 /*查询端口 0/1 的配置结果配置交换机端口模式:
交换机的端口工作模式一般可以分为三种:
Access, Multi, Trunk。
trunk 模式的端口用于交换机与交换机,交换机与路由器,大多用于级联网络设备所以也叫干道模式。
Access多用于接入层也叫接入模式。
暂时我们先介绍 Trunk 模式和 Access 模式, Multi 模式等以后我们介绍 VLAN 设置的时候再一并介绍。
interface range 可以对一组端口进行统一配置,如果已知端口是直接与 PC 机连接不会接路由交换机和集线器的情况下可以用 spanning-tree portfast 命令设置快速端口,快速端口不再经历生成树的四个状态,直接进入转发状态,提高接入速度。
Pconline1(config) # interface range fastethernet 0/1-20 /*对1-20 端口进行配置Pconline1(config-if-range) # switchport mode access /*设置端口为接入模式Pconline1(config-if-range) # spanning-tree portfast /*设置 1-20 端口为快速端口交换机可以通过自动协商工作在干道模式,但是按照要求如果该端口属于主干道应该明确标明该端口
---------------------------------------------------------------最新资料推荐------------------------------------------------------
属于 Trunk 模式:
Pconline1(config) # interface fastethernet 0/24 /*对端口 24 进行配置 Pconline1(config-if) # switchport mode
trunk /*端口为干道模式
5 / 5。