




已阅读5页,还剩9页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
3.3 实验2:交换机端和MAC地址表的设置本实验是对Cisco Catalyst 1900系列交换机的端口和MAC地址表相关的项目进行设置。1.实验目的通过本实验,读者可以掌握以下技能:设置交涣机端口属性;查看交换机端口配置和统计信息;设置静态MAC地址和查看MAC地址表。2. 设备需求本实验需要以下设备:Cisco Catalyst 1900系列交换机1台,型号不限,企业版软件,本实验中使用了1912交换机;带网卡的PC机2台,网线2条;PC机1台,操作系统为Windows系列,装有超级终端程序;Console电缆1条及相应的接口转换器。3. 线缆连接及配置说明如图3.2所示,把PC机连接在交换机的EO/9和EO/11两个端口上。连接PC机的目的是为了进行MAC地址表方面的实验,当然此处的PC机也可以便用路由器来代替。图示中略去了作为超级终端的PC机及控制电缆。 4. 实验配置及监测结果按实验2的图示把设备连接好后,给所有设备加电,开始实验。监测清单3-2记录了本实验的操作。监测清单3-2配置端口属性及MAC地址表第1段:配置端口属性及MAC地址表SW1912#conf tEnter configuration commands, one per line. End with CNTL/ZSW1912(config)#mterface ethernet 0/1SW1912(config-if)#?Interface configuration commands:cdp Cdp interface subcommandsdescription Interface specific descriptionduplex Con-figureduplexoperationexit Exit from interface configuration modehelp Description of the interactive help systemno Negate a conanaand or set its defaultsport Perform switch port configurationshutdown Shutdown the selected interfacespantree Spanning tree subsystemvlan-membership VLAN membership configurationSW1912(config-if)#description PC_1SW1912(config-if)#duplex ?auto Enable auto duplex-configurationfull Force full duplex operationfull-flow-control Force full duplex with flow contro1half ForcehalfduplexoperationSW 1912(config-if)#duplex fullSW1912(config-if)#port secure ?max-mac-count Maxirnum number of addresses allowed on the portSW1912(config-if)#port secure max-mac-couist 1SW1912(config-if)#endSW1912#sh mac-address-table ?address MAC addressaging-time Show aging time of dynamic entriesdynamic Show 802.1 d dynamic addressinterface Interface namepermanent Show 802.1 d permanent addressrestricted Show 802. 1 d restricted static addressessecurity Show addressing security informationSW1912#sh mac-address-table securityAction upon address violation : SuspendInterface Addressing Security Address Table Size Clear AddressEthernet 0/1 Enabled 1 NoEthernet 0/2 Disabled N/A NoEthernet 0/3 Disabled N/A NoEthernet 0/4 Disabled N/A NoEthernet 0/5 Disabled N/A NoEthernet 0/6 Disabled N/A NoEthernet 0/7 Disabled N/A NoEthernet 0/8 Disabled N/A NoEthernet 0/9 Disabled N/A NoEthernet 0/10 Disabled N/A NoEthernet 0/11 Disabled N/A NoEthernet 0/12 Disabled N/A NoEthernet 0/25 Disabled N/A NoFastEthernet 0/26 Disabled N/A NoFastEthernet 0/27 Disabled N/A NoSW1912#第2段:配置和查看MAC地址表SW1912(config)#mac-address-table ?aging-time Aging time of dynamic addressespermanent Configure a permanent addressrestricted Configure a restricted static addressSW1912(config)#mac-address-table aging-time ?SW1912(config)#mac-address-table permanent ?H.H.H 48 bit hardware addressSW1912(config)#macaddress-tabae permanent 0000.0c10.aabb ?Ethernet IEEE 802.3FastEthernet FastEthernet IEEE 802.3SW1912(config)#mac-address-table permanent 0000.0cl0.aabb e0/3SW1912(config)#mac-address-table restricted static OOOO.Oc11.aacc e0/6 e0/7SW1912(config)#endSW1912#sh mac-address-tableNumber of permanent addresses : 1Number of restricted static addresses : 1Number of dynamic addresses : 2Address Dest Interface Type Source Interface List-0000.0C10.AABB Ethernet0/3 Permanent All0000.0C11.AACC Ethernet0/6 Static Et0/70000.0C8E.CDD2 Ethernet0/11 Dynamic All0000.0C76.F737 Ethernet0/9 Dynamic AllSW1912#clear mac-addr restric staticSW1912#sh mac-addrNumber of permanent addresses:1Number of restricted static add resses:0Number of dynamic addresses:2Address Dest Interface Type Source Interface List-0000.0C10.AABB Ethernet0/3 Permanent All0000.0C8E.CDD2 Ethernet0/11 Dynamic All0000.0C76.F737 Ethernet0/9 Dynamic All(1)进入接口配置模式。键入问号,列出所有此接口下可以进行的设置命令和简短的说明。(2)使用description PC_1命令设置了EO/1接口的描述为PC_1,这样在交换机上就可以方便地查到与对应端口相连的设备是什么。(3)一个端口的双工模式可以分为由duplex?命令所列出的几种:auto:自动匹配双工模式;full:强制为全双工模式;full-flow-control:带流量控制的全双工模式;half:强制为半双工模式。(4)端口安全性命令ponsecufe启动了端口安全特性。缺省情况下,可最多有132个目的MAC地址与设置了port secure命令的端口相对应。该端口所对应的MAC地址在MAC地址中(MAC Address Table)不会以动态类型出现,而是自动转换成为静态类型,直到达到所设定的最大值(缺省为132)时为止。到达最大值之后,新的MAC地址不再被接收。(5)在接口配置模式下发出的port sccure max-mac-count命令限定对应本端口的MAC地址的最大数量,实验中设置为1,即只允许1个MAC地址通过此端口连入网络。(6)使用show mac-address-table security命令可以查看被设置了安全性的端口的状态,可以看到端口EO/1己经被设置为安全端口,其地址表大小为1。(7)在第2段中,演示了对MAC地址表的有关配置。在全局配置模式下,有关MAC地址表的配置有3个:即超时时间、永久地址和限制性地址。(8)使用mac、address-table aging-time命令可以设置MAC地址表超时时间,交换机学习到的动态MAC地址的超时时间缺省为300s,可以通过命令更改这一数值。(9)mac、address-table permanent 0000.0c10.aabbe0/3命令对于端口e0/3设置了1个静态MAC地址,这个地址永久存在于MAC地址表中。不会超时,所有的端口均可转发以太网帧给e0/3端口。(10)所谓限制性静态(restricted static)地址是在永久地址的基础上,同时限制了源端口,其安全性更高。通过mac-address-table restricted static 0000.0c11.aacc e0/6e0/7命令设置对于E0/6端口的静态MAC地址为0000.0c11.aacc,其限制性端口为E0/7,即只有E0/7端口可以转发以太网帧给这个MAC地址。(1l)show mac-address-table命令用来查看整个MAC地址表。可以看到,永久地址有1个,设置在E0/3端口上;限定性静态地址有1个,设置的目标端口为E0/6,源端口为E0/7;动态类型的MAC地址有2个。分别是PC1和PC2网卡上的MAC地址。(12)用clear mac-address restric static命令清除了限定性静态地址之后,show mac-address-table显示限定性静态地址已不在MAC地址表中出现。Cisco3524交换机配置VLAN实例Cisco 3548(3524) 交换机: 第一次连接交换机,配置终端参数为: 波特率:9600;数据位:8;停止位:1;奇偶校验:无;流控制:无。 通过串口线连上路由器后,按回车,即可看到配置向导: (如果不是第一次配置,可以进入超级用户模式后用命令setup调用以下过程) - System Configuration Dial og - At any point you may enter a question mark ? for help.任何时候可以打?取得帮助 Use ctrl-c to abort configuration dialog at any prompt.按Ctrl-C可以取消并退出 Default settings are in square brackets .默认参数在中 Continue with configuration dialog? yes/no: y继续交互配置吗?回答:y Enter IP address: 49ip地址 Enter IP netmask: 子网掩码 Would you like to enter a default gateway address? yes: y设置默认网关?y IP address of default gateway: 54默认网关 Enter host name 3548_9A: The enable secret is a one-way cryptographic secret used instead of the enable password when it exists. Enter enable secret: _password输入超级用户密码 Would you like to configure a Telnet password? yes: y Enter Telnet password: _password输入telnet密码 Would you like to enable as a cluster command switch? yes/no: n集群模式?n The following configuration command script was created:已建立以下配置信息 ip subnet-zero interface VLAN1 ip address 49 ip default-gateway 54 enable secret 5 $1$biZ3$AOLb9cMTtBwMtGB9lyBzr. line vty 0 15 password _domainwlzx snmp community private rw snmp community public ro ! end Use this configuration? yes/no:使用该配置信息吗? y 修改配置: 禁止通过snmp管理: 3548enable password: 3548#config term 3548(config)#no snmp community private 3548(config)#no snmp community public 接着配置干道:(确定上级交换机对应端口已设为干道模式) 3548(config)#inter g0/1 选择第一个千兆口 3548(config if)# switchport mode trunk设为干道模式 如果g0/2用于连接另一台3548,也设为干道 3548(config)#inter g0/2 3548(config if)# switchport mode trunk 返回 3548(config if)# exit 3548(config)# exit 3548# 验证: ping 54 配置Vlan数据: 3548#vlan database 3548(vlan)#reset清除以前的配置 3548(vlan)#vtp client设为vtp客户模式 3548(vlan)#vtp domain _domainvtp域是_domain 3548(vlan)#vtp password *设定vtp域密码 3548(vlan)#exit 3548# 验证:show vtp status显示vlan 数据 show vtp counters show vlan 同步后看到的vlan数目和名称应与6506上的一致 指定端口到Vlan、配置端口为portfast方式(快速建立连接): 方法1:命令方式 3548#config term 3548(config)#inter f0/1配置1号快速以太网端口 3548(config if)# switchport access vlan 2指定端口到Vlan 2 3548(config if)# spanning-tree portfast配置端口为portfast方式 3548(config)#inter f0/2配置1号快速以太网端口 3548(config if)# switchport access vlan 2指定端口到Vlan 2 3548(config if)# spanning-tree portfast配置端口为portfast方式 .对每个要设定的端口重复上述步骤。 3548(config if)# exit 3548(config)# exit 3548# 方法1:Web 方式 (预先要安装插件:jre-1-2-2-005-win-i-09-mar-2000.exe) 打开浏览器连接设备:在地址栏输入设备的管理页面url,如3548_9a(48)为:49/basiccfg.html 选中菜单port - port configure - 设port fast 为Enable 选中菜单vlan - vlan membership - 指定端口所属的Vlan号 可同时指定多个端口 ! 注意: 如果把一个端口指定到不存在的VLAN上,3548交换机的VLAN同步会异常,此时应该为正确VLAN并重新“配置Vlan数据” 保存配置信息: 方法1:命令方式 3548# write ( 或 copy running-config startup-config ) 方法1:Web 方式 选中设备(而不是单个端口),点击save configure按钮。 3548_9A#show run Building configuration. Current configuration: ! version 12.0#软件版本 no service pad service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname 3548_9A#系统名称 ! enable secret 5 $1$4ZMs$rfC.g/nN.owt3eW2uoCL/0#加密后的enable密码 ! ! ! ! ! ! ip subnet-zero ! ! ! interface FastEthernet0/1#模块0的1号快速以太网接口 switchport access vlan 5#指定端口0/1到vlan 5 spanning-tree portfast#如果接的是工作站,指定端口为portfast方式(不运行生成树协议,加快建立连接速度) ! interface FastEthernet0/2 spanning-tree portfast#默认情况下端口属vlan 1 ! interface FastEthernet0/3 spanning-tree portfast ! interface FastEthernet0/4 spanning-tree portfast ! interface FastEthernet0/5 spanning-tree portfast ! interface FastEthernet0/6 spanning-tree portfast ! interface FastEthernet0/7 spanning-tree portfast ! interface FastEthernet0/8 spanning-tree portfast ! interface FastEthernet0/9 spanning-tree portfast ! interface FastEthernet0/10 spanning-tree portfast ! interface FastEthernet0/11 spanning-tree portfast ! interface FastEthernet0/12 spanning-tree portfast ! interface FastEthernet0/13 spanning-tree portfast ! interface FastEthernet0/14 spanning-tree portfast ! interface FastEthernet0/15 spanning-tree portfast ! interface FastEthernet0/16 spanning-tree portfast ! interface FastEthernet0/17 spanning-tree portfast ! interface FastEthernet0/18 spanning-tree portfast ! interface FastEthernet0/19 spanning-tree portfast ! interface FastEthernet0/20 spanning-tree portfast ! interface FastEthernet0/21 spanning-tree portfast ! interface FastEthernet0/22 spanning-tree portfast ! interface FastEthernet0/23 spanning-tree portfast ! interface FastEthernet0/24 spanning-tree portfast ! interface FastEthernet0/25 spanning-tree portfast ! interface FastEthernet0/26 spanning-tree portfast ! interface FastEthernet0/27 spanning-tree portfast ! interface FastEthernet0/28 spanning-tree portfast ! interface FastEthernet0/29 spanning-tree portfast ! interface FastEthernet0/30 spanning-tree portfast ! interface FastEthernet0/31 spanning-tree portfast ! interface FastEthernet0/32 spanning-tree portfast ! interface FastEthernet0/33 spanning-tree portfast ! interface FastEthernet0/34 spanning-tree portfast ! interface FastEthernet0/35 spanning-tree portfast ! interface FastEthernet0/36 spanning-tree portfast ! interface FastEthernet0/37 spanning-tree portfast ! interface FastEthernet0/38 spanning-tree portfast ! interface FastEthernet0/39 spanning-tree portfast ! interface FastEthernet0/40 spanning-tree portfast ! interface FastEthernet0/41 spanning关于IP-MAC地址绑定的交换机设置1.方案1基于端口的MAC地址绑定思科2950交换机为例,登录进入交换机,输入管理口令进入配置模式,敲入命令:Switch#config terminal进入配置模式Switch(config)# Interface fastethernet 0/1进入具体端口配置模式Switch(config-if )#Switchport port-secruity配置端口安全模式Switch(config-if )switchport port-security mac-address MAC(主机的MAC地址)配置该端口要绑定的主机的MAC地址Switch(config-if )no switchport port-security mac-address MAC(主机的MAC地址)删除绑定主机的MAC地址注意:以上命令设置交换机上某个端口绑定一个具体的MAC地址,这样只有这个主机可以使用网络,如果对该主机的网卡进行了更换或者其他PC机想通过这个端口使用网络都不可用,除非删除或修改该端口上绑定的MAC地址,才能正常使用。注意:以上功能适用于思科2950、3550、4500、6500系列交换机2.方案2基于MAC地址的扩展访问列表Switch(config)Mac access-list extended MAC10定义一个MAC地址访问控制列表并且命名该列表名为MAC10Switch(config)permit host 0009.6bc4.d4bf any定义MAC地址为0009.6bc4.d4bf的主机可以访问任意主机Switch(config)permit any host 0009.6bc4.d4bf定义所有主机可以访问MAC地址为0009.6bc4.d4bf的主机Switch(config-if )interface Fa0/20#进入配置具体端口的模式Switch(config-if )mac access-group MAC10 in在该端口上应用名为MAC10的访问列表(即前面我们定义的访问策略)Switch(config)no mac access-list extended MAC10清除名为MAC10的访问列表此功能与应用一大体相同,但它是基于端口做的MAC地址访问控制列表限制,可以限定特定源MAC地址与目的地址范围。注意:以上功能在思科2950、3550、4500、6500系列交换机上可以实现,但是需要注意的是2950、3550需要交换机运行增强的软件镜像(Enhanced Image)。3.方案3IP地址的MAC地址绑定只能将应用1或2与基于IP的访问控制列表组合来使用才能达到IP-MAC 绑定功能。Switch(config)Mac access-list extended MAC10定义一个MAC地址访问控制列表并且命名该列表名为MAC10Switch(config)permit host 0009.6bc4.d4bf any定义MAC地址为0009.6bc4.d4bf的主机可以访问任意主机Switch(config)permit any host 0009.6bc4.d4bf定义所有主机可以访问MAC地址为0009.6bc4.d4bf的主机Switch(config)Ip access-list extended IP10定义一个IP地址访问控制列表并且命名该列表名为IP10Switch(config)Permit any定义IP地址为的主机可以访问任意主机Permit any 定义所有主机可以访问IP地址为的主机Switch(config-if )interface Fa0/20#进入配置具体端口的模式Switch(config-if )mac access-group MAC10 in在该端口上应用名为MAC10的访问列表(即前面我们定义的访问策略)Switch(config-if )Ip access-group IP10 in在该端口上应用名为IP10的访问列表(即前面我们定义的访问策略)Switch(config)no mac access-list extended MAC10清除名为MAC10的访问列表Switch(config)no Ip access-group IP10 in清除名为IP10的访问列表上述所提到的应用1是基于主机MAC地址与交换机端口的绑定,方案2是基于MAC地址的访问控制列表,前两种方案所能实现的功能大体一样。如果要做到IP与MAC地址的绑定只能按照方案3来实现,可根据需求将方案1或方案2与IP访问控制列表结合起来使用以达到自己想要的效果。注意:以上功能在思科2950、3550、4500、6500系列交换机上可以实现,但是需要注意的是2950、3550需要交换机运行增强的软件镜像(Enhance
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 混凝土施工过程中质量监督与检查方案
- 建筑工程建筑物电气接地施工方案
- 胎膜早破47课件
- 跨境电子商务双语教程 课件 第5章 跨境电商物流与海外仓
- 混凝土浇筑后的钢筋保护方案
- 文库发布:水电站课件
- 正确认识人的本质37课件
- 直线回归与相关的区别和联系王万荣65课件
- 2025版汽车配件品牌区域总经销服务合同
- 2025版离婚协议书及财产分割及子女抚养及赡养费及共同债务及共同债权及子女教育协议
- 原发性系统性淀粉样变性的护理措施课件
- 《阿房宫赋》课件 统编版高中语文必修下册
- DB54T 0498.3-2025 生态系统碳汇计量与监测体系建设技术规范 第3部分:湿地碳汇计量与监测方法
- 桥小脑角肿瘤护理查房
- 2025小学教师招聘考试试题及答案
- 2025年纪律作风测试题及答案
- 2025江苏苏州昆山国创投资集团有限公司第一期招聘17人笔试参考题库附带答案详解版
- 安全生产网格化管理工作实施方案
- 入场安全教育培训
- 艺术设计专业教学标准(高等职业教育专科)2025修订
- QGDW11970.1-2023输变电工程水土保持技术规程第1部分水土保持方案
评论
0/150
提交评论