Cisco路由器交换机的常规安全配置模版
Cisco网络设备安全配置
Cisco⽹络设备安全配置Cisco⽹络设备安全检查和配置列表前⾔:本⽂档简单描述关于Cisco⽹络设备(路由器和交换机)的常规安全配置,旨在提⽰⽤户加强⽹络设备的安全配置。
在开始本⽂档前,有⼏点需要说明:如果条件允许的话,所有的设备都应该采⽤最新的IOS或者COS。
如果能够采⽤静态路由的话,尽量采⽤静态路由;动态路由⽅⾯的安全配置未在本⽂档之内。
⼀、路由器检查列表:□路由器的安全策略是否有备案,核查并且实施□路由器的IOS版本是否是最新□路由的配置⽂件是否有离线备份,并且对备份⽂件的访问有所限制□路由器的配置是否有清晰的说明和描述□路由器的登陆⽤户和密码是否已经配置□密码是否加密,并且使⽤secret密码□ secret密码是否有⾜够的长度和复杂度,难以猜测□通过Console,Aux,vty的访问是否有所限制□不需要的⽹络服务和特性是否已关闭□确实需要的⽹络服务是否已经正确安全的配置□未使⽤的接⼝和vty是否已经配置shutdown□有风险的接⼝服务是否已经禁⽤□⽹络中需要使⽤的协议和端⼝是否标识正确□访问控制列表是否配置正确□访问列表是否禁⽤了Internet保留地址和其他不适当的地址□是否采⽤静态路由□路由协议是否配置了正确的算法□是否启⽤⽇志功能,并且⽇志内容清晰可查□路由器的时间和⽇期是否配置正确□⽇志内容是否保持统⼀的时间和格式□⽇志核查是否符合安全策略⼆、IOS安全配置1、服务最⼩化关闭所有不需要的服务,可以使⽤show proc命令来查看运⾏了那些服务。
通常来说以下服务不需要启动。
Small services (echo, discard, chargen, etc.)- no service tcp-small-servers- no service udp-small-servers_ BOOTP - no ip bootp server_ Finger - no service finger_ HTTP - no ip http server_ SNMP - no snmp-server2、登陆控制Router(config)#line console 0Router(config-line)#password xxxRouter(config-line)#exec-timeout 5 0Router(config-line)#loginRouter(config)#line aux 0Router(config-line)#password xxxRouter(config-line)#exec-timeout 0 10Router(config-line)#loginRouter(config)#line vty 0 4Router(config-line)#password xxxRouter(config-line)#exec-timeout 5 0Router(config-line)#login注:如果路由器⽀持的话,请使⽤ssh替代telnet;3、密码设置Router(config)#service password-encryptionRouter(config)#enable secret4、⽇志功能Central(config)# logging onCentral(config)# logging IP(SYSLOG SERVER)Central(config)# logging bufferedCentral(config)# logging console criticalCentral(config)# logging trap informationalCentral(config)# logging facility local1Router(config)# service timestamps log datetime localtime show-timezone msec5、SNMP的设置Router(config)# no snmp community public roRouter(config)# no snmp community private rwRouter(config)# no access-list 50Router(config)# access-list 50 permit 10.1.1.1Router(config)# snmp community xxx ro 50Router(config)# snmp community yyy rw 50注:xxx,yyy是你需要设置的community string,越是复杂越好,并且两都绝对不能⼀致。
思科交换机安全(很全的详细配置、讲解)
cisco所有局域网缓解技术交换机安全802.1X、port-security、DHCP SNOOP、DAI、VACL、SPAN RSPAN端口和MAC绑定:port-security基于DHCP的端口和IP,MAC绑定:ip source guard基于DHCP的防止ARP攻击:DAI防止DHCP攻击:DHCP Snooping常用的方式:1、802.1X,端口认证,dot1x,也称为IBNS(注:IBNS包括port-security):基于身份的网络安全;很多名字,有些烦当流量来到某个端口,需要和ACS交互,认证之后得到授权,才可以访问网络,前提是CLIENT 必须支持802.1X方式,如安装某个软件Extensible Authentication Protocol Over Lan(EAPOL)使用这个协议来传递认证授权信息示例配置:Router#configure terminalRouter(config)#aaa new-modelRouter(config)#aaa authentication dot1x default group radiusRouter(config)#radius-server host 10.200.200.1 auth-port 1633 key radkeyRouter(config)#dot1x system-auth-control 起用DOT1X功能Router(config)#interface fa0/0Router(config-if)#dot1x port-control autoAUTO是常用的方式,正常的通过认证和授权过程强制授权方式:不通过认证,总是可用状态强制不授权方式:实质上类似关闭了该接口,总是不可用可选配置:Switch(config)#interface fa0/3Switch(config-if)#dot1x reauthenticationSwitch(config-if)#dot1x timeout reauth-period 7200//2小时后重新认证Switch#dot1x re-authenticate interface fa0/3//现在重新认证,注意:如果会话已经建立,此方式不断开会话Switch#dot1x initialize interface fa0/3 //初始化认证,此时断开会话Switch(config)#interface fa0/3Switch(config-if)#dot1x timeout quiet-period 45 //45秒之后才能发起下一次认证请求Switch(config)#interface fa0/3Switch(config-if)#dot1x timeout tx-period 90 //默认是30SSwitch(config-if)#dot1x max-req count 4//客户端需要输入认证信息,通过该端口应答AAA服务器,如果交换机没有收到用户的这个信息,交换机发给客户端的重传信息,30S发一次,共4次Switch#configure terminalSwitch(config)#interface fastethernet0/3Switch(config-if)#dot1x port-control autoSwitch(config-if)#dot1x host-mode multi-host//默认是一个主机,当使用多个主机模式,必须使用AUTO方式授权,当一个主机成功授权,其他主机都可以访问网络;当授权失败,例如重认证失败或LOG OFF,所有主机都不可以使用该端口Switch#configure terminalSwitch(config)#dot1x guest-vlan supplicantSwitch(config)#interface fa0/3Switch(config-if)#dot1x guest-vlan 2 //未得到授权的进入VLAN2,提供了灵活性//注意:1、VLAN2必须是在本交换机激活的,计划分配给游客使用;2、VLAN2信息不会被VTP传递出去Switch(config)#interface fa0/3Switch(config-if)#dot1x default //回到默认设置show dot1x [all] | [interface interface-id] | [statistics interface interface-id] [{ | begin | exclude | include} expression]Switch#sho dot1x allDot1x Info for interface FastEthernet0/3----------------------------------------------------Supplicant MAC 0040.4513.075bAuthSM State = AUTHENTICATEDBendSM State = IDLEPortStatus = AUTHORIZEDMaxReq = 2HostMode = SinglePort Control = AutoQuietPeriod = 60 SecondsRe-authentication = EnabledReAuthPeriod = 120 SecondsServerTimeout = 30 SecondsSuppTimeout = 30 SecondsTxPeriod = 30 SecondsGuest-Vlan = 0debug dot1x {errors | events | packets | registry | state-machine | all}2、端口安全,解决CAM表溢出攻击(有种MACOF的工具,每分钟可以产生155000个MAC地址,去轰击CAM 表,从而使合法主机的要求都必须被FLOOD)示例配置:Switch#configure terminalSwitch(config)#interface fastethernet0/0Switch(config-if)#switchport mode accessSwitch(config-if)#switchport port-securitySwitch(config-if)#switchport port-security maximum 20 //这里默认是1Switch(config-if)#switchport port-security mac-address sticky//保存学习到的地址到RUN CONFIG文件中,避免手动配置的麻烦,并省去动态学习所消耗的资源switchport port-security violation {protect | restrict | shutdown}三个参数解释:protect(保护):当达到某个设定的MAC数量,后来的未知MAC不再解析,直接丢弃,且不产生通知restrict(限制):当达到某个设定的MAC数量,后来的未知MAC不再解析,直接丢弃,产生通知,如SNMP TRAP、SYSLOG信息,并增加违反记数;这里有个问题,恶意攻击会产生大量的类似信息,给网络带来不利。
Cisco路由器安全配置方案
Cisco路由器安全配置方案一、路由器网络服务安全配置1禁止CDP(CiscoDiscoveryProtocol)。
如:Router(Config)#nocdprunRouter(Config-if)#nocdpenable2禁止其他的TCP、UDPSmall服务。
Router(Config)#noservicetcp-small-serversRouter(Config)#noserviceudp-samll-servers3禁止Finger服务。
Router(Config)#noipfingerRouter(Config)#noservicefinger4建议禁止HTTP服务。
Router(Config)#noiphttpserver如果启用了HTTP服务则需要对其进行安全配置:设置用户名和密码;采用访问列表进行控制。
5禁止BOOTp服务。
Router(Config)#noipbootpserver6禁止IPSourceRouting。
Router(Config)#noipsource-route7建议如果不需要ARP-Proxy服务则禁止它,路由器默认识开启的。
Router(Config)#noipproxy-arpRouter(Config-if)#noipproxy-arp8禁止IPDirectedBroadcast。
Router(Config)#noipdirected-broadcast9禁止IPClassless。
Router(Config)#noipclassless10禁止ICMP协议的IPUnreachables,Redirects,MaskReplies。
Router(Config-if)#noipunreacheablesRouter(Config-if)#noipredirectsRouter(Config-if)#noipmask-reply11建议禁止SNMP协议服务。
交换机路由防火墙配置实例
在网络中,防火墙、交换机和路由器通常是网络安全的重要组成部分。
以下是一个简单的示例,演示如何配置一个具有防火墙功能的路由器和交换机。
请注意,实际配置可能会根据您的网络架构和设备型号而有所不同。
设备列表:路由器:使用Cisco设备作为示例,实际上可以是其他厂商的路由器。
路由器IP地址:192.168.1.1交换机:同样,使用Cisco设备作为示例。
交换机IP地址:192.168.1.2防火墙规则:允许内部网络向外部网络发出的通信。
阻止外部网络对内部网络的未经请求的通信。
配置示例:1. 配置路由器:Router(config)# interface GigabitEthernet0/0Router(config-if)# ip address 192.168.1.1 255.255.255.0Router(config-if)# no shutdownRouter(config)# interface GigabitEthernet0/1Router(config-if)# ip address [外部IP地址] [外部子网掩码]Router(config-if)# no shutdownRouter(config)# ip route 0.0.0.0 0.0.0.0 [外部网关]2. 配置防火墙规则:Router(config)# access-list 101 permit ip 192.168.1.0 0.0.0.255 anyRouter(config)# access-list 101 deny ip any 192.168.1.0 0.0.0.255Router(config)# access-list 101 permit ip any anyRouter(config)# interface GigabitEthernet0/1Router(config-if)# ip access-group 101 in3. 配置交换机:Switch(config)# interface Vlan1Switch(config-if)# ip address 192.168.1.2 255.255.255.0Switch(config-if)# no shutdown配置说明:路由器通过两个接口连接内部网络(192.168.1.0/24)和外部网络。
Cisco路由器和交换机的安全设置
Cisco路由器和交换机的安全设置1、禁用不需要的服务:no ip http server //这玩意儿的安全漏洞很多的no ip source-route //禁用IP源路由,防止路由欺骗no service finger //禁用finger服务no ip bootp server //禁用bootp服务no service udp-small-s //小的udp服务no service tcp-small-s //禁用小的tcp服务2、关闭CDPno cdp run //禁用cdp3、配置强加密与启用密码加密:service password-encryption //对password密码进行加密enable secret asdfajkls //配置强加密的特权密码no enable password //禁用弱加密的特权密码4、配置log server、时间服务及与用于带内管理的ACL等,便于进行安全审计service timestamp log datetime localtime //配置时间戳为dateti me方式,使用本地时间logging 192.168.0.1 //向192.168.0.1发送loglogging 192.168.0.2 //向192.168.0.2发送logaccess-list 98的主机进行通讯no access-list 99 //在配置一个新的acl前先清空该ACLaccess-list 99 permit 192.168.0.0 0.0.0.255access-list 99 deny any log //log参数说明在有符合该条件的条目时产生一条logo信息no access-list 98 //在配置一个新的acl前先清空该ACLaccess-list 98 permit host 192.168.0.1access-list 98 deny any log //log参数说明在有符合该条件的条目时产生一条logo信息clock timezone PST-8 //设置时区ntp authenticate //启用NTP认证ntp authentication-key 1 md5 uadsf //设置NTP认证用的密码,使用MD5加密。
Cisco路由器安全配置方案
Cisco路由器安全配置方案一、路由器网络服务安全配置1 禁止CDP(Cisco Discovery Protocol)。
如:Router(Config)#no cdp run Router(Config-if)# no cdp enable2 禁止其他的TCP、UDP Small服务。
Router(Config)# no service tcp-small-serversRouter(Config)# no service udp-samll-servers3 禁止Finger服务。
Router(Config)# no ip fingerRouter(Config)# no service finger4 建议禁止HTTP服务。
Router(Config)# no ip http server 如果启用了HTTP服务则需要对其进行安全配置:设置用户名和密码;采用访问列表进行控制。
5 禁止BOOTp服务。
Router(Config)# no ip bootp server6 禁止IP Source Routing。
Router(Config)# no ip source-route7 建议如果不需要ARP-Proxy 服务则禁止它,路由器默认识开启的。
Router(Config)# no ip proxy-arpRouter(Config-if)# no ip proxy-arp8禁止IP Directed Broadcast。
Router(Config)# no ip directed-broadcast9 禁止IP Classless。
Router(Config)# no ip classless10 禁止ICMP协议的IP Unreachables, Redirects, Mask Replies。
Router(Config-if)# no ip unreacheablesRouter(Config-if)# no ip redirectsRouter(Config-if)# no ip mask-reply11 建议禁止SNMP协议服务。
思科路由、交换、安全设置实战手册(精讲)
思科路由、交换、安全设置实战手册一、使网络能上网配通步骤:1、进入端口内:(config-if)# ip add XXX.XXX.XXX.XXX 255.255.255.0 (可以是vlan)(config-if)# ip nat inside(config-if)# no sh外:(config-if)# ip add XXX.XXX.XXX.XXX 255.255.255.0(config-if)# ip nat outside(config-if)# no sh2、设置DNS、网关、路由、DHCP、控制列表和地址转换DNS:(config)# ip name-server 203.196.0.6 (可连续写6个)网关:(config)# ip default-gateway XXX.XXX.XXX.XXX (可写可不写)路由:(config)# ip route 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX(IP或者端口---静态路由) (config)# router rip (动态)(config-router)# network XXX.XXX.XXX.XXXDHCP(动态分配IP):(可以为多个vlan做dhcp)(config)#ip dhcp pool + 名字(DHCP名)(dhcp-config)# network 192.168.2.0 255.255.255.0(要分配的IP池—注意:A、B类私网IP 一定要加子网掩码,C类不需要)(dhcp-config)# dns-server 203.196.0.6 202.106.0.20(DNS)(dhcp-config)# default-router 192.168.2.1 (网关)(dhcp-config)# lease 3 (租用时间)(config)#ip dhcp excluded-address 192.168.2.1 192.168.2.100(排除要分配的IP段)(config)#ip dhcp excluded-address 192.168.2.199 192.168.2.255(排除要分配IP段)3、控制列表:(config)# access-list 1 permit(deny)192.168.0.0 0.0.255.255 (允许或者拒绝的IP段)4、地址转换:(config)# ip nat inside source list 1 interface FastEthernet4 overload (指定端口-根据实际情况来定)5、如果用池的方式:先建立一个动态池(config)# ip nat pool 871 211.99.151.208 211.99.151.208 netmask 255.255.255.0(config)# ip nat inside source list 1 pool 871 overload (指定要将转换主机的IP和池联系起来)6、静态IP转换(主要应用于服务器)(config)#ip nat inside source static 10.1.1.4 80.1.1.10 (内网主机IP在前,公网IP在后)(config)#ip nat inside source static tcp 192.168.0.5 80 171.68.1.1 80 extendable (如果要带协议的话---static tcp;内网主机后则必须要端口号;同样外网主机也需要端口号;extendable—可选)7、常用的清除配置命令:2950#erase startup-config (和路由一样)1900#delete nvram#show processes cpu (查看CPU使用率)测试端口是否丢包!#pingProtocol [ip]: (回车)Target IP address: 211.99.151.193 (IP地址)Repeat count [5]: 10000 (设置默认包是数量)Datagram size [100]: 10000 (包的大小)Timeout in seconds [2]: (回车)Extended commands [n]: (回车)Sweep range of sizes [n]: (回车)Type escape sequence to abort.ping 192.168.1.11 source 192.168.1.23 repeat 1000 size 1000停止:#ctrl+shift+6交换机升级成E 的步骤:Switch#archive download-sw/ imageonly /overwrite/ reload tftp: //10.1.1.2/c3550-i5q3l2-tar.122-25.SEA.tar (此仅是IOS软件的升级,还需要改号、改E等)trace命令提供路由器到目的地址的每一跳的信息#trace 171.144.1.39(目的IP)#ctrl+shift+6 停止telnet 设置(config)#line vty 0 4(config-if-line)#password XXXXXX(config-if-line)#loginenable 密码设置(config)# enable password XXXXX(不加密密码)(config)# enable set XXXXX(加密密码)问题备注:1、现象:从路由能ping 外网,也能ping 电脑。
Cisco安全配置标准
XXX网安技术有限公司Cisco安全配置标准文件编号:发布日期:XXX网安技术有限公司目录B1. 目的 (4)2. 范围 (4)3. 术语定义 (4)4. 参考文件 (4)5. 角色与职责 (4)6. 内容 (4)6.1 设置加密口令 (4)6.2 配置文件的离线备份 (4)6.3 远程维护安全 (4)6.4 关闭不活动的链接 (6)6.5 Con终端和vty终端配置登录超时10分钟 (6)6.6 配置时间同步服务 (6)6.7 关闭维护网络管理的所有端口 (6)6.8 在日志中记录完整时间 (6)6.9 关闭源路由 (7)6.10 关闭ICMP重定向 (7)6.11 禁止ARP-Proxy (7)6.12 禁止IP Directed Broadcast (7)6.13 禁止网络启动和下载配置 (7)6.14 关闭PAD服务 (7)6.15 关闭DNS服务 (8)6.16 交互机选项 (8)6.17 路由器选项 (8)6.18 设备命名规则 (9)6.19 附录- 默认开放的服务 (9)7. 附件 (13)XXX网安技术有限公司1. 目的通过建立系统的安全基线标准,规范网安公司网络环境Cisco路由器和交换机的安全配置,并提出相应的指导;降低系统存在的风险,确保Cisco路由器和交换器可靠的运行。
2. 范围适合网安公司网络环境的所有Cisco路由器和交换机。
3. 术语定义ICMP:Internet Control Message Protocol)Internet控制报文协议SNMP:Simple Network Management Protocol,简单网络管理协议SSH:Secure Shell Protocol加密通道配置代理服务器安全外壳协议4. 参考文件无5. 角色与职责6. 内容6.1 设置加密口令(config)# enable secret XXX(config)# service password-encryption6.2 配置文件的离线备份6.3 远程维护安全1)关闭AUX端口。
Cisco路由器安全配置方案word参考模板
一、路由器网络服务安全配置1 禁止CDP(Cisco Discovery Protocol)。
如:Router(Config)#no cdp runRouter(Config-if)# no cdp enable2 禁止其他的TCP、UDP Small服务。
Router(Config)# no service tcp-small-serversRouter(Config)# no service udp-samll-servers3 禁止Finger服务。
Router(Config)# no ip fingerRouter(Config)# no service finger4 建议禁止HTTP服务。
Router(Config)# no ip http server如果启用了HTTP服务则需要对其进行安全配置:设置用户名和密码;采用访问列表进行控制。
5 禁止BOOTp服务。
Router(Config)# no ip bootp server6 禁止IP Source Routing。
Router(Config)# no ip source-route7 建议如果不需要ARP-Proxy服务则禁止它,路由器默认识开启的。
Router(Config)# no ip proxy-arpRouter(Config-if)# no ip proxy-arp8禁止IP Directed Broadcast。
Router(Config)# no ip directed-broadcast9 禁止IP Classless。
Router(Config)# no ip classless10 禁止ICMP协议的IP Unreachables, Redirects, Mask Replies。
Router(Config-if)# no ip unreacheablesRouter(Config-if)# no ip redirectsRouter(Config-if)# no ip mask-reply11 建议禁止SNMP协议服务。
Cisco路由器安全配置方案
THANKS
谢谢您的观看
Cisco路由器安全配置方案
汇报人: 2024-01-08
目录
• Cisco路由器安全概述 • 用户与设备安全 • 网络服务安全 • 安全协议配置 • 安全审计与日志记录
01
Cisco路由器安全概述
路由器安全的重要性
保护网络核心设备
路由器作为网络核心设备,其安全性直接关系到 整个网络的安全稳定运行。
VS
SSL/TLS是一种常用的网络安全协议 ,用于保护数据在Web浏览器和服务 器之间的传输。通过在路由器上配置 SSL/TLS,可以确保用户与服务器之 间的数据传输不会被窃取或篡改。 SSL/TLS提供了数据加密和完整性校 验功能,支持多种加密算法和协议模 式,可以根据实际需求进行灵活配置 。
/TLS配置
配置日志级别
根据需要设置日志级别,以便记录关键或非关 键事件。
配置日志目标
将日志发送到本地存储或远程日志服务器,以便进行集中管理和分析。
安全审计策略配置
配置审计规则
根据安全需求,定义审计规则以监视关键系统活动。
配置审计日志
将审计日志记录发送到本地存储或远程日志服务器,以便进行分 析和审计。
配置审计报警
04
安全协议配置
IPSec配置
IPSec协议提供了一种端到端的安全性,可以保护数据在公共网络上的传输。
IPSec是一种标准的网络安全协议,用于保护IP数据包的安全。通过在路由器上配置IPSec,可以确保数据在公共网络上的传 输过程中不会被窃取或篡改。IPSec提供了数据加密和完整性校验功能,支持多种加密算法和协议模式,可以根据实际需求进 行灵活配置。
Cisco路由器交换机安全配置
Cisco路由器交换机安全配置一、网络结构及安全脆弱性为了使设备配置简单或易于用户使用,Router 或Switch初始状态并没有配置安全措施,所以网络具有许多安全脆弱性,因此网络中常面临如下威胁: 1. DDOS攻击 2. 非法授权 ...一、网络结构及安全脆弱性为了使设备配置简单或易于用户使用,Router或Switch初始状态并没有配置安全措施,所以网络具有许多安全脆弱性,因此网络中常面临如下威胁:1. DDOS攻击2. 非法授权访问攻击。
口令过于简单,口令长期不变,口令明文创送,缺乏强认证机制。
3.IP地址欺骗攻击….利用Cisco Router和Switch可以有效防止上述攻击。
二、保护路由器2.1 防止来自其它各省、市用户Ddos攻击最大的威胁:Ddos, hacker控制其他主机,共同向Router访问提供的某种服务,导致Router利用率升高。
Ddos是最容易实施的攻击手段,不要求黑客有高深的网络知识就可以做到。
如SMURF DDOS 攻击就是用最简单的命令ping做到的。
利用IP 地址欺骗,结合ping就可以实现DDOS攻击。
防范措施:应关闭某些缺省状态下开启的服务,以节省内存并防止安全破坏行为/攻击。
以下是引用片段:Router(config-t)#no service fingerRouter(config-t)#no service padRouter(config-t)#no service udp-small-serversRouter(config-t)#no service tcp-small-serversRouter(config-t)#no ip http serverRouter(config-t)#no service ftpRouter(config-t)#no ip bootp server以上均已经配置。
防止ICMP-flooging攻击。
以下是引用片段:Router(config-t)#int e0Router(config-if)#no ip redirectsRouter(config-if)#no ip directed-broadcastRouter(config-if)#no ip proxy-arpRouter(config-t)#int s0Router(config-if)#no ip redirectsRouter(config-if)#no ip directed-broadcastRouter(config-if)#no ip proxy-arp以上均已经配置。
Cisco路由器配置手册(大全)【范本模板】
Cisco路由器配置手册(大全)第一章路由器配置基础一、基本设置方式一般来说,可以用5种方式来设置路由器:1.Console口接终端或运行终端仿真软件的微机;2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP服务器;4.通过Ethernet上的TELNET程序;5.通过Ethernet上的SNMP网管工作站。
但路由器的第一次设置必须通过第一种方式进行,此时终端的硬件设置如下:波特率:9600数据位:8停止位:1奇偶校验:无二、命令状态1. router〉路由器处于用户命令状态,这时用户可以看路由器的连接状态,访问其它网络和主机,但不能看到和更改路由器的设置内容.2。
router#在router>提示符下键入enable,路由器进入特权命令状态router#,这时不但可以执行所有的用户命令,还可以看到和更改路由器的设置内容。
3. router(config)#在router#提示符下键入configure terminal,出现提示符router(config)#,此时路由器处于全局设置状态,这时可以设置路由器的全局参数。
4。
router(config-if)#; router(config-line)#;router(config—router)#;…路由器处于局部设置状态,这时可以设置路由器某个局部的参数。
5. >路由器处于RXBOOT状态,在开机后60秒内按ctrl—break可进入此状态,这时路由器不能完成正常的功能,只能进行软件升级和手工引导。
6. 设置对话状态这是一台新路由器开机时自动进入的状态,在特权命令状态使用SETUP命令也可进入此状态,这时可通过对话方式对路由器进行设置。
三、设置对话过程1。
显示提示信息2. 全局参数的设置3. 接口参数的设置4. 显示结果利用设置对话过程可以避免手工输入命令的烦琐,但它还不能完全代替手工设置,一些特殊的设置还必须通过手工输入的方式完成。
dot1xcisco交换机配置模板
dot1xcisco交换机配置模板1.1 配置模板1.1.1 Cisco交换机配置模板(生产&办公)1)Radius配置:aaa new-model---------配置AAA认证参数aaa authentication login default lineaaa authentication dot1x default group radius------设置dot1x默认的认证服务器是RADIUS服务器组aaa authorization network default group radius--------配置授权服务器为Radius服务器aaa accounting update periodic 3aaa accounting dot1x default start-stop group radius---配置dot1x认证时发送计费开始/结束报文,计费服务器为RADIUS服务器组aaa accounting network default start-stop group radiusradius-server attribute nas-port format c-----配置交换机以C 类格式发送描述端口号的Radius属性radius-server host X.X.X.X auth-port 1812 acct-port 1813 key key_cisco----配置主用Radius服务器(IP地址是总行生产/办公认证服务器地址)radius-server host X.X.X.X auth-port 1812 acct-port 1813 key key_cisco-----配置备用Radius服务器(IP地址是分行生产/办公逃生服务器地址)radius-server source-ports 1645-1646radius-server retransmit 1radius-server timeout 3snmp-server community NM_CITICIB RO--------SNMP配置ip radius source-interface vlan X-------------3560等多地址的交换机必须配置,“X”是管理地址的vlan编号。
cisco交换机安全配置设定方法.doc
cisco交换机安全配置设定方法cisco交换机安全配置设定方法一、交换机访问控制安全配置1、对交换机特权模式设置密码尽量采用加密和md5 hash方式switch(config)#enable secret 5 pass_string其中0 Specifies an UNENCRYPTED password will follow5 Specifies an ENCRYPTED secret will follow建议不要采用enable password pass_sting密码,破解及其容易!2、设置对交换机明文密码自动进行加密隐藏switch(config)#service password-encryption3、为提高交换机管理的灵活性,建议权限分级管理并建立多用户switch(config)#enable secret level 7 5 pass_string7 /7级用户进入特权模式的密码switch(config)#enable secret 5 pass_string15 /15级用户进入特权模式的密码switch(config)#username userA privilege 7 secret 5 pass_userAswitch(config)#username userB privilege 15 secret 5 pass_userB/为7级,15级用户设置用户名和密码,Cisco privilege level分为0-15级,级别越高权限越大switch(config)#privilege exec level 7 commands /为7级用户设置可执行的命令,其中commands可以根据分配给用户的权限自行定义4、本地console口访问安全配置switch(config)#line console 0switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒switch(config-line)#logging synchronous /强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见设置登录console口进行密码验证方式(1):本地认证switch(config-line)#password 7 pass_sting /设置加密密码switch(config-line)#login /启用登录验证方式(2):本地AAA认证switch(config)#aaa new-model /启用AAA认证switch(config)#aaa authentication login console-in group acsserver local enable/设置认证列表console-in优先依次为ACS Server,local用户名和密码,enable特权密码switch(config)#line console 0switch(config-line)# login authentication console-in /调用authentication设置的console-in列表5、远程vty访问控制安全配置switch(config)#access-list 18 permit host x.x.x.x /设置标准访问控制列表定义可远程访问的PC主机switch(config)#aaa authentication login vty-in group acsserver local enable/设置认证列表vty-in, 优先依次为ACS Server,local用户名和密码,enable特权密码switch(config)#aaa authorization commands 7 vty-in group acsserver local if-authenticated/为7级用户定义vty-in授权列表,优先依次为ACS Server,local 授权switch(config)#aaa authorization commands 15 vty-in group acsserver local if-authenticated/为15级用户定义vty-in授权列表,优先依次为ACS Server,local 授权switch(config)#line vty 0 15switch(config-line)#access-class 18 in /在线路模式下调用前面定义的标准ACL 18switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒switch(config-line)#authorization commands 7 vty-in /调用设置的授权列表vty-inswitch(config-line)#authorization commands 15 vty-inswitch(config-line)#logging synchronous /强制对弹出的干扰日志信息进行回车换行,使用户输入的命令连续可见switch(config-line)#login authentication vty-in /调用authentication 设置的vty-in列表switch(config-line)#transport input ssh /有Telnet协议不安全,仅允许通过ssh协议进行远程登录管理6、AAA安全配置switch(config)#aaa group server tacacs+ acsserver /设置AAA服务器组名switch(config-sg-tacacs+)#server x.x.x.x /设置AAA服务器组成员服务器ipswitch(config-sg-tacacs+)#server x.x.x.xswitch(config-sg-tacacs+)#exitswitch(config)# tacacs-server key paa_string /设置同tacacs-server 服务器通信的密钥二、交换机网络服务安全配置禁用不需要的各种服务协议switch(config)#no service padswitch(config)#no service fingerswitch(config)#no service tcp-small-serversswitch(config)#no service udp-small-serversswitch(config)#no service configswitch(config)#no service ftpswitch(config)#no ip http serverswitch(config)#no ip http secure-server/关闭http,https远程web管理服务,默认cisco交换机是启用的三、交换机防攻击安全加固配置MAC Flooding(泛洪)和Spoofing(欺骗)攻击预防方法:有效配置交换机port-securitySTP攻击预防方法:有效配置root guard,bpduguard,bpdufilterVLAN,DTP攻击预防方法:设置专用的native vlan;不要的接口shut或将端口模式改为accessDHCP攻击预防方法:设置dhcp snoopingARP攻击预防方法:在启用dhcp snooping功能下配置DAI和port-security 在级联上层交换机的trunk下switch(config)#int gi x/x/xswitch(config-if)#sw mode trunkswitch(config-if)#sw trunk encaps dot1qswitch(config-if)#sw trunk allowed vlan x-xswitch(config-if)#spanning-tree guard loop/启用环路保护功能,启用loop guard时自动关闭root guard接终端用户的端口上设定switch(config)#int gi x/x/xswitch(config-if)#spanning-tree portfast/在STP中交换机端口有5个状态:disable、blocking、listening、learning、forwarding,只有处于forwarding状态的端口才可以发送数据。
思科交换机配置模板
思科交换机配置模板switch1#sho runBuilding configuration...Current configuration : 2442 bytes!version 12.1no service padservice timestamps debug datetimemseclocaltime service timestamps log datetimemseclocaltime no service password-encryption!hostname switch1!enable password netbro08!clocktimezonebeijing 8ip subnet-zero!noip domain-lookup!no setup expressspanning-tree mode pvstno spanning-tree optimize bpdu transmission spanning-tree extend system-id!!!!interface FastEthernet0/1switchport mode trunk!interface FastEthernet0/2switchport mode trunk!interface FastEthernet0/3switchport mode trunk!interface FastEthernet0/4switchport access vlan 101switchport mode access!interface FastEthernet0/5switchport access vlan 101switchport mode accessinterface FastEthernet0/6 switchport access vlan 101 switchport mode access ! interface FastEthernet0/7 switchport access vlan 101 switchport mode access ! interface FastEthernet0/8 switchport access vlan 101 switchport mode access ! interface FastEthernet0/9 switchport access vlan 101 switchport mode access ! interface FastEthernet0/10 switchport access vlan 101 switchport mode access ! interface FastEthernet0/11 switchport access vlan 101 switchport mode access ! interface FastEthernet0/12 switchport access vlan 101 switchport mode access ! interface FastEthernet0/13 switchport access vlan 100 switchport mode access ! interface FastEthernet0/14 switchport access vlan 100 switchport mode access ! interface FastEthernet0/15 switchport access vlan 100 switchport mode access ! interface FastEthernet0/16 switchport access vlan 100 switchport mode access interface FastEthernet0/17switchport access vlan 100switchport mode access!interface FastEthernet0/18switchport access vlan 100switchport mode access!interface FastEthernet0/19switchport access vlan 100switchport mode access!interface FastEthernet0/20switchport access vlan 100switchport mode access!interface FastEthernet0/21switchport access vlan 100switchport mode access!interface FastEthernet0/22switchport access vlan 100switchport mode access!interface FastEthernet0/23switchport access vlan 100!interface FastEthernet0/24switchport mode trunk!interface Vlan1ip address 192.168.88.2 255.255.255.192 noip route-cache !ip default-gateway 192.168.88.1noip http server!line con 0linevty 0 4password netbro08loginlinevty 5 15password netbro08login!ntp server 192.43.244.18 !end。
思科交换机安全配置(包括AAA、端口安全、ARP安全、DHCP侦听、日志审计流量限制)说课讲解
思科交换机安全配置(包括A A A、端口安全、A R P安全、D H C P 侦听、日志审计流量限制)网络拓扑图如下:根据图示连接设备。
在本次试验中,具体端口情况如上图数字标出。
核心交换机(core )设置为s1或者SW1,汇聚层交换机(access)设置为s2或者SW2。
IP 地址分配:Router:e0: 192.168.1.1Core:f0/1: 192.168.1.2Svi接口:Core vlan10: 172.16.10.254Vlan20: 172.16.20.254Vlan30: 172.16.30.254Access vlan10: 172.16.10.253Vlan20: 172.16.20.253Vlan30: 172.16.30.253服务器IP地址:192.168.30.1Office区域网段地址:PC1:192.168.10.1PC2:192.168.10.2路由器清空配置命令:enerase startup-configReload交换机清空配置命令:enerase startup-configdelete vlan.datReload加速命令:enconf tno ip domain lookupline con 0exec-timeout 0 0logging synhostname一、OFFICE 区域地址静态分配,防止 OFFICE 网络发生 ARP 攻击,不允许OFFICE 网段 PC 互访;STUDENTS 区域主机输入正确的学号和密码后接入网络,自动获取地址,阻止STUDENTS网段地址发生ARP攻击;1、基本配置SW1的配置:SW1(config)#vtp domain cisco //SW1配置vtp,模式为server,SW2模式为clientSW1(config)#vtp password sovandSW1(config)#vtp mode serverSW1(config)#vlan 10SW1(config)#int range f0/3,f0/4 //链路捆绑SW1(config-if-range)#Channel-protocol pagpSW1(config-if-range)#Channel-group 10 mode onSW1(config)#int port-channel 10 //链路设置为trunk模式,封装802.1q协议,三层交换机默认没有封装该协议SW1(config-if)#switchport trunk encapsulation dot1qSW1(config-if)#switchport mode trunkSW2配置:SW2(config)#vtp domain ciscoSW2(config)#vtp password sovandSW2(config)#vtp mode clientSW2(config)#int range f0/3,f0/4SW2(config-if-range)#Channel-protocol pagpSW2(config-if-range)#Channel-group 10 mode onCreating a port-channel interface Port-channel 10SW2(config)#int port-channel 10SW2(config-if)#switchport trunk encapsulation dot1qSW2(config-if)#switchport mode trunkSW2(config)#int f0/1 //把f0/1,f0/2划入vlan10SW2(config-if)#switchport mode accessSW2(config-if)#switchport access vlan 10SW2(config-if)#int f0/2SW2(config-if)#switchport mode accessSW2(config-if)#switchport access vlan 102、vlan aclOffice区域禁止PC机互访:使用show int e0/0命令查看mac地址SW2(config)#mac access-list extended macaclSW2(config-ext-macl)#permit host 0007.8562.9de0 host 0007.8562.9c20 //要禁止双向通信SW2(config-ext-macl)#permit host 0007.8562.9c20 host 0007.8562.9de0SW2(config)#vlan access-map vmap 10 //禁止pc间的通信SW2(config-access-map)#match mac add macaclSW2(config-access-map)#action dropSW2(config)#vlan access-map vmap 20 //对其他数据放行,不然pc机无法ping 通svi口、网关SW2(config-access-map)#action forwardSW2(config)#vlan filter vmap vlan-list 10未使用VLAN ACL时pc1可以ping通pc2,如下图:使用VLAN ACL时pc1可以无法ping通pc2,如下图:3、Office区域静态配置ip地址时采用的ARP防护:配置如下:SW2(config)#ip arp inspection vlan 10SW2(config)#arp access-list arplistSW2(config-arp-nacl)#permit ip host 192.168.10.1 mac host 0007.8562.9de0 //ip地址与mac地址对应表SW2(config-arp-nacl)#permit ip host 192.168.10.2 mac host 0007.8562.9c20SW2(config-arp-nacl)#ip arp inspection filter arplist vlan 10SW2(config)#int port-channel 10SW2(config-if)#ip arp inspection trust注意:配置静态arp防护(用户主机静态配置地址,不是通过DHCP获取地址),需要新建ip与mac映射表,不然pc1无法ping通svi口4、OSPF与DHCP全网起OSPF协议,使pc1可以ping通路由器。
思科交换机配置模板
switch1#sho runBuilding configuration...Current configuration : 2442 bytes!version 12.1no service padservice timestamps debug datetimemseclocaltime service timestamps log datetimemseclocaltime no service password-encryption!hostname switch1!enable password netbro08!clocktimezonebeijing 8ip subnet-zero!noip domain-lookup!no setup expressspanning-tree mode pvstno spanning-tree optimize bpdu transmission spanning-tree extend system-id!!!!interface FastEthernet0/1switchport mode trunk!interface FastEthernet0/2switchport mode trunk!interface FastEthernet0/3switchport mode trunk!interface FastEthernet0/4switchport access vlan 101switchport mode access!interface FastEthernet0/5switchport access vlan 101switchport mode accessinterface FastEthernet0/6 switchport access vlan 101 switchport mode access !interface FastEthernet0/7 switchport access vlan 101 switchport mode access !interface FastEthernet0/8 switchport access vlan 101 switchport mode access !interface FastEthernet0/9 switchport access vlan 101 switchport mode access !interface FastEthernet0/10 switchport access vlan 101 switchport mode access !interface FastEthernet0/11 switchport access vlan 101 switchport mode access !interface FastEthernet0/12 switchport access vlan 101 switchport mode access !interface FastEthernet0/13 switchport access vlan 100 switchport mode access !interface FastEthernet0/14 switchport access vlan 100 switchport mode access !interface FastEthernet0/15 switchport access vlan 100 switchport mode access !interface FastEthernet0/16 switchport access vlan 100 switchport mode accessinterface FastEthernet0/17switchport access vlan 100switchport mode access!interface FastEthernet0/18switchport access vlan 100switchport mode access!interface FastEthernet0/19switchport access vlan 100switchport mode access!interface FastEthernet0/20switchport access vlan 100switchport mode access!interface FastEthernet0/21switchport access vlan 100switchport mode access!interface FastEthernet0/22switchport access vlan 100switchport mode access!interface FastEthernet0/23switchport access vlan 100!interface FastEthernet0/24switchport mode trunk!interface Vlan1ip address 192.168.88.2 255.255.255.192 noip route-cache!ip default-gateway 192.168.88.1noip http server!line con 0linevty 0 4password netbro08loginlinevty 5 15password netbro08login!ntp server 192.43.244.18 !end。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Cisco路由器和交换机的安全配置模板一、设备命名规范为统一网络设备命名,方便今后网络项目实施和运维管理,拟对网络设备进行统一命名,详细命名规则如下:设备名称组成部分网络系统中具体一台设备的命名由如下五个部分组成:Hostname: AABBCCDDEEAA:表示各分行的地区名称简写,如:上海:SHBB:表示功能区域名称CC:表示设备所在的网络层次DD:表示设备类型EE:表示设备的序列号,01表示第一台,02为第二台。
设备名称中的英文字母全部采用大写,各部分之间使用下划线连接。
每个字母具体范围如下:各分行地区名称如下表示(AA):功能区域或地域名称规则表如下所示(BB):网络设备所在层命名规则表如下所示(CC):网络设备类型命名规则表如下所示(DD):网络设备序列号编号规则表如下所示(EE):二、路由器配置一,路由器访问控制的安全配置1,严格控制可以访问路由器的管理员。
任何一次维护都需要记录备案。
2,建议不要远程访问路由器。
即使需要远程访问路由器,建议使用访问控制列表和高强度的密码控制。
3,严格控制CON端口的访问。
具体的措施有:A,如果可以开机箱的,则可以切断与CON口互联的物理线路。
B,可以改变默认的连接属性,例如修改波特率(默认是96000,可以改为其他的)。
C,配合使用访问控制列表控制对CON口的访问。
如:Router(Config)#Access-list 1 permit 192.168.0.1Router(Config)#line con 0Router(Config-line)#Transport input noneRouter(Config-line)#Login localRouter(Config-line)#Exec-timeoute 5 0Router(Config-line)#access-class 1 inRouter(Config-line)#endD,给CON口设置高强度的密码。
4,如果不使用AUX端口,则禁止这个端口。
默认是未被启用。
禁止如:Router(Config)#line aux 0Router(Config-line)#transport input noneRouter(Config-line)#no exec5,建议采用权限分级策略。
如:Router(Config)#username lanstar privilege 10 lanstarRouter(Config)#privilege EXEC level 10 telnetRouter(Config)#privilege EXEC level 10 show ip access-list6,为特权模式的进入设置强壮的密码。
不要采用enable password设置密码。
而要采用enable secret命令设置。
并且要启用Service password-encryption。
7,控制对VTY的访问。
如果不需要远程访问则禁止它。
如果需要则一定要设置强壮的密码。
由于VTY在网络的传输过程中为加密,所以需要对其进行严格的控制。
如:设置强壮的密码;控制连接的并发数目;采用访问列表严格控制访问的地址;可以采用AAA设置用户的访问控制等。
8,IOS的升级和备份,以及配置文件的备份建议使用FTP代替TFTP。
如:Router(Config)#ip ftp username lanstarRouter(Config)#ip ftp password lanstarRouter#copy startup-config ftp:9,及时的升级和修补IOS软件。
二,路由器网络服务安全配置1,禁止CDP(Cisco Discovery Protocol)。
如:Router(Config)#no cdp runRouter(Config-if)# no cdp enable2,禁止其他的TCP、UDP Small服务。
Router(Config)# no service tcp-small-serversRouter(Config)# no service udp-samll-servers3,禁止Finger服务。
Router(Config)# no ip fingerRouter(Config)# no service finger4,建议禁止HTTP服务。
Router(Config)# no ip http server如果启用了HTTP服务则需要对其进行安全配置:设置用户名和密码;采用访问列表进行控制。
如:Router(Config)# username lanstar privilege 10 lanstarRouter(Config)# ip http auth localRouter(Config)# no access-list 10Router(Config)# access-list 10 permit 192.168.0.1Router(Config)# access-list 10 deny anyRouter(Config)# ip http access-class 10Router(Config)# ip http serverRouter(Config)# exit5,禁止BOOTp服务。
Router(Config)# no ip bootp server禁止从网络启动和自动从网络下载初始配置文件。
Router(Config)# no boot networkRouter(Config)# no servic config6,禁止IP Source Routing。
Router(Config)# no ip source-route7,建议如果不需要ARP-Proxy服务则禁止它,路由器默认识开启的。
Router(Config)# no ip proxy-arpRouter(Config-if)# no ip proxy-arp8,明确的禁止IP Directed Broadcast。
Router(Config)# no ip directed-broadcast9,禁止IP Classless。
Router(Config)# no ip classless10,禁止ICMP协议的IP Unreachables,Redirects,Mask Replies。
Router(Config-if)# no ip unreacheablesRouter(Config-if)# no ip redirectsRouter(Config-if)# no ip mask-reply11,建议禁止SNMP协议服务。
在禁止时必须删除一些SNMP服务的默认配置。
或者需要访问列表来过滤。
如:Router(Config)# no snmp-server community public RoRouter(Config)# no snmp-server community admin RWRouter(Config)# no access-list 70Router(Config)# access-list 70 deny anyRouter(Config)# snmp-server community MoreHardPublic Ro 70Router(Config)# no snmp-server enable trapsRouter(Config)# no snmp-server system-shutdownRouter(Config)# no snmp-server trap-anthRouter(Config)# no snmp-serverRouter(Config)# end12,如果没必要则禁止WINS和DNS服务。
Router(Config)# no ip domain-lookup如果需要则需要配置:Router(Config)# hostname RouterRouter(Config)# ip name-server 202.96.209.513,明确禁止不使用的端口。
Router(Config)# interface eth0/3Router(Config)# shutdown三,路由器路由协议安全配置1,首先禁止默认启用的ARP-Proxy,它容易引起路由表的混乱。
Router(Config)# no ip proxy-arp 或者Router(Config-if)# no ip proxy-arp2,启用OSPF路由协议的认证。
默认的OSPF认证密码是明文传输的,建议启用MD5认证。
并设置一定强度密钥(key,相对的路由器必须有相同的Key)。
Router(Config)# router ospf 100Router(Config-router)# network 192.168.100.0 0.0.0.255 area 100! 启用MD5认证。
! area area-id authentication 启用认证,是明文密码认证。
!area area-id authentication message-digestRouter(Config-router)# area 100 authentication message-digestRouter(Config)# exitRouter(Config)# interface eth0/1!启用MD5密钥Key为routerospfkey。
!ip ospf authentication-key key 启用认证密钥,但会是明文传输。
!ip ospf message-digest-key key-id(1-255) md5 keyRouter(Config-if)# ip ospf message-digest-key 1 md5 routerospfkey3,RIP协议的认证。
只有RIP-V2支持,RIP-1不支持。
建议启用RIP-V2。
并且采用MD5认证。
普通认证同样是明文传输的。
Router(Config)# config terminal! 启用设置密钥链Router(Config)# key chain mykeychainnameRouter(Config-keychain)# key 1!设置密钥字串Router(Config-leychain-key)# key-string MyFirstKeyStringRouter(Config-keyschain)# key 2Router(Config-keychain-key)# key-string MySecondKeyString!启用RIP-V2Router(Config)# router ripRouter(Config-router)# version 2Router(Config-router)# network 192.168.100.0Router(Config)# interface eth0/1! 采用MD5模式认证,并选择已配置的密钥链Router(Config-if)# ip rip authentication mode md5Router(Config-if)# ip rip anthentication key-chain mykeychainname4,启用passive-interface命令可以禁用一些不需要接收和转发路由信息的端口。