版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、交换机典型配置内容提要:交换机的基本功能典型配置交换机的安全策略典型配置CISCO交换机的基本功能配置计算机连接到控制台接口n用户模式 Switchn特权模式 Switchenable Switch#n全局模式 Switch#configure terminal Switch(config)# 每次进入交换机时,首先会进入到用户模式下每次进入交换机时,首先会进入到用户模式下 ,在此模式下不能对交换机进,在此模式下不能对交换机进行修改、甚至有些信息都无法查看,为了更进一步的对交换机进行操作,我们必行修改、甚至有些信息都无法查看,为了更进一步的对交换机进行操作,我们必须进入到特权模式或全局模式,而
2、从用户模式下只能进入特权模式,再从特权模须进入到特权模式或全局模式,而从用户模式下只能进入特权模式,再从特权模式进入全局模式,也就是说之中不能跨级。式进入全局模式,也就是说之中不能跨级。 n更改主机名更改主机名SwitchenSwitch#conf tSwitch(config)#hostname 12341234(config)#n更改特权密码更改特权密码1234(config)#enable password 1231234(config)#1234(config)#enable secret 2341234(config)#n查看全局配置Switch#show running-confi
3、gn保存当前配置Switch#copy running-config startup-confign恢复出厂默认Switch#erase startup-configSwitch#reloadn明文密码和密文密码nPassword1234#show running-config hostname 1234 enable password 123nSecret 1234#show running-confighostname 1234enable secret 5 $1$CCFV$0DTd3rSPZNycrVDjn1rKv/ (MD5 加密的字符串) enable password 123当明文
4、和密文同时存在时,密文优先级高。当明文和密文同时存在时,密文优先级高。n全局模式下进入端口后,可以对端口进行配置。全局模式下进入端口后,可以对端口进行配置。Switch#conf tSwitch(config)#interface gigabitEthernet 0/1Switch(config-if)#批量修改端口批量修改端口 range命令命令Switch(config)#interface range gigabitEthernet 0/1 - 48Switch(config-if-range)#端口速率:端口速率:Switch(config-if)#speed ? 10 Force 1
5、0 Mbps operation 100 Force 100 Mbps operation 1000 Force 1000 Mbps operation auto Enable AUTO speed configurationSwitch(config-if)#speed autoSwitch(config-if)#n双工模式:Switch(config-if)#duplex ? auto Enable AUTO duplex configuration full Force full duplex operation half Force half-duplex operationSwitc
6、h(config-if)#duplex auto Switch(config-if)#n端口描述Switch(config-if)#description vlan 10 trunkSwitch(config-if)#nVlan设置范围:1-4094n在全局模式下配置vlanSwitch#conf tSwitch(config)#vlan 10Switch(config-vlan)#name vlan10Switch(config-vlan)#vlan 20Switch(config-vlan)#name vlan20Vlan名称可以自行定义n在全局模式下加入VTP域exampleSwitch
7、(config)#vtp mode clientSwitch(config)#vtp domain exampleSwitch#show vlan 查看vlan配置信息nvlan10配置192.168.10.1/24的ip地址Switch#conf tSwitch(config)#vlan 10Switch(config-vlan)#name vlan10Switch(config-vlan)#exitSwitch(config)#interface vlan 10Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(con
8、fig-if)#endSwitch#copy running-config startup-config配置ip地址的命令格式: ip address ip-address netmask测试常用端口类型 Access / trunk将此端口设置为vlan10 的access口Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10Switch(config-if)#将此端口设置为vlan10 的trunk口Switch(config-if)#switchport trunk enc
9、apsulation dot1qSwitch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10当一个端口允许多个vlan通过时,trunk allowed vlan中要添加各条vlan信息Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunk Switch(config-if)# switchport trunk allowed vlan all
10、Switch(config-if)#switchport trunk allowed vlan 10,50,60Switch(config-if)#switchport trunk allowed vlan add 20 (remove 删除)Switch(config-if)#switchport trunk allowed vlan add 30Switch(config-if)#switchport trunk allowed vlan add 40Switch(config-if)#switchport trunk native vlan 1Switch(config-if)#no s
11、hutdownSwitch(config-if)#endSwitch#copy running-config startup-config 此端口为vlan10 vlan20 vlan30 vlan40的trunk口,default vlan 1经过此端口时不会带上标签。n光端口配置Switch(config)#interface gigabitEthernet 0/25Switch(config-if)# switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#no shutdown
12、 Switch(config-if)#endSwitch#copy running-config startup-config注意: 由于思科的交换机只自动识别自己品牌的光模块,所以如果用其他品牌的光模块,需在配置模式下输入一下两条命令,开启兼容性。service unsupported-transceiverno errdisable detect cause gbic-invalid命令输入完成后保存设置重启设备 cisco交换机的安全策略典型配置1.设备管理1.1远程管理服务配置域名switch(config)#ip domain-name switch.domin-name生成RSA密
13、钥对switch(config)#crypto key generate rsa!How many bits in the modulus 512:2048Generating RSA keysok配置仅允许ssh远程登录switch(config)#line vty 0 4switch(config-line)#transport input sshswitch(config-line)#exit1.2认证方式启用AAA,并配置登录验证为loacl本地认证switch(config)#aaa new-modelswitch(config)#aaa authentication login d
14、efault local1.3管理IP地址控制配置访问控制列表switch(config)#access-list 12 permit host 1.1.1.1switch(config)#line vty 0 4switch(config-line)#access-class 12 in1.4 console端口管理console需配置口令认证信息,防止无权限用户通过console口登录设备,设置登录时间限制。switch(config)#line console 0switch(config-line)#exec-timeout 5switch(config-line)#password
15、passwordswitch(config-line)#login2.1 Service password 密码采用service password-encryption,使口令加密方式得到增强switch(config)#service password-encryption2.2 enable密码采用secret对密码进行加密,使用不可逆加密算法加密。switch(config)#enable secret 2-pwd-rouTswitch(config)#no enable password2.用户 账号与口令安全2.3 账户登录空闲时间设置consloe口登录超时时间5分钟switch
16、(config)#line console 0switch(config-line)#exec-timeout 5switch(config)#line vty 0 4switch(config-line)#exec-timeout 52.4密码长度密码长度至少8位,并包括数字、小写字母、大写字母、和特殊符号4类中至少2类switch(config)#username user password2.5 用户账号管理按照用户分配账号,避免不同用户账号共享switch(config)#username user1 password Aa_12345switch(config)#username u
17、ser1 privilege 1switch(config)#username user2 password Aa_abcd5switch(config)#username user2 privilege 1 3.1 SNMP协议安全修改SNMP的团体串默认通行字,通行字符串应符合口令强度要求,使用ACL限制只与特定主机进行SNMP协议交互switch(config)#access-list 75 permit host 14.2.6.60switch(config)#access-list 75 deny any log 2switch(config)#snmp-server community switch_readonly RO 753.日志与审计3.2 转存日志通过远程日志功能将日志传输到日志服务器switch(config)#logging onswitch(config)#logging trap informationswitch(config)#logging 192.168.0.100switch(config)#logging facility local6switch(config)#logging source-interface vlan 14.1 禁用不必要的服务禁用tcp/udp小服务switch(config)# no se
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 移动应用程序用户授权协议2025
- 医疗废物处理合同协议2025年技术标准
- 销售合同2025年进口商品销售条款
- 无人机矿用勘探协议2025年
- 委托代理合同2025年代理权限协议
- 室内环境治理工程监理合同
- 分布式光伏发电工程监理合同
- 2026年福州工商学院单招职业技能测试题库带答案详解
- 2026年青海高等职业技术学院单招职业适应性测试题库及完整答案详解1套
- 2026年上饶职业技术学院单招职业倾向性测试题库及参考答案详解
- 耳穴压豆教学课件
- 大学成长规划计划
- 坚持立足中国又面向世界讲解
- 国外惯性技术发展与回顾
- 2023年佛山市南海区散装水泥办公室招考公益一类事业编制工作人员考前自测高频考点模拟试题(共500题)含答案详解
- 集成运算放大器及应用-集成运算放大器(电子技术课件)
- 大学英语四级单词表(高中没学过)
- 内蒙古平煤阿鲁科尔沁旗煤业有限责任公司爱民温都煤矿采矿权出让收益评估报告
- 电气接线工艺培训
- 回族上坟怎么念
- 反洗钱远程培训终结性测试题
评论
0/150
提交评论