cisco交换机配置及安全防护全解

合集下载

思科交换机安全端口配置

思科交换机安全端口配置

令,或者你可以手动的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

思科交换机端口安全(Port-Security)

思科交换机端口安全(Port-Security)

思科交换机端口安全(Port-Security)Cisco Catalyst交换机端口安全(Port-Security)1、Cisco29系列交换机可以做基于2层的端口安全,即mac地址与端口进行绑定。

2、Cisco3550以上交换机均可做基于2层和3层的端口安全,即mac 地址与端口绑定以及mac地址与ip地址绑定。

3、以cisco3550交换机为例做mac地址与端口绑定的可以实现两种应用:a、设定一端口只接受第一次连接该端口的计算机mac地址,当该端口第一次获得某计算机mac地址后,其他计算机接入到此端口所发送的数据包则认为非法,做丢弃处理。

b、设定一端口只接受某一特定计算机mac地址,其他计算机均无法接入到此端口。

4、破解方法:网上前辈所讲的破解方法有很多,主要是通过更改新接入计算机网卡的mac地址来实现,但本人认为,此方法实际应用中基本没有什么作用,原因很简单,如果不是网管,其他一般人员平时根本不可能去注意合法计算机的mac地址,一般情况也无法进入合法计算机去获得mac地址,除非其本身就是该局域网的用户。

5、实现方法:针对第3条的两种应用,分别不同的实现方法a、接受第一次接入该端口计算机的mac地址:Switch#config terminalSwitch(config)#inte**ce inte**ce-id 进入需要配置的端口Switch(config-if)#switchport mode access 设置为交换模式Switch(config-if)#switchport port-security 打开端口安全模式Switch(config-if)#switchport port-security violation {protect |restrict | shutdown }//针对非法接入计算机,端口处理模式{丢弃数据包,不发警告| 丢弃数据包,在console发警告| 关闭端口为err-disable状态,除非管理员手工激活,否则该端口失效。

CISCO交换机基本配置和使用概述

CISCO交换机基本配置和使用概述

CISCO交换机基本配置和使用概述CISCO交换机是一种常用的网络设备,用于构建局域网(Local Area Network,LAN)。

它可以通过物理线路的连接,将多台计算机或其他网络设备连接到同一个网络中,实现数据的传输和共享。

CISCO交换机的基本配置包括IP地址的配置、VLAN的配置、端口配置、安全性配置等。

接下来,我们将对这些配置进行详细说明。

首先,IP地址的配置是CISCO交换机的基本操作之一。

通过配置IP地址,我们可以对交换机进行管理和监控。

具体的配置步骤如下:1. 进入交换机的配置模式。

在命令行界面输入"enable"命令,进入特权模式。

2. 进入全局配置模式。

在特权模式下输入"configure terminal"命令,进入全局配置模式。

3. 配置交换机的IP地址。

在全局配置模式下输入"interfacevlan 1"命令,进入虚拟局域网1的接口配置模式。

然后输入"ip address 192.168.1.1 255.255.255.0"命令,配置交换机的IP地址和子网掩码。

4. 保存配置并退出。

在接口配置模式下输入"exit"命令,返回到全局配置模式。

然后输入"exit"命令,返回到特权模式。

最后输入"copy running-config startup-config"命令,保存配置到闪存中。

其次,VLAN的配置是CISCO交换机的关键配置之一。

通过配置VLAN,我们可以将交换机的端口划分为不同的虚拟局域网,实现数据的隔离和安全。

1. 进入交换机的配置模式。

同样,在特权模式下输入"configure terminal"命令,进入全局配置模式。

2. 创建VLAN。

在全局配置模式下输入"vlan 10"命令,创建一个编号为10的VLAN。

2024年度Cisco交换机配置教程

2024年度Cisco交换机配置教程
交换机可以通过控制台线连接计算机进行配置,也可以通过 Telnet或SSH远程登录进行配置。
VLAN可以将交换机上的端口划分成不同的虚拟局域网,实现广 播域的隔离和不同部门之间的安全通信。
通过配置访问控制列表(ACL)、端口安全等功能,可以提高交 换机的安全性,防止未经授权的访问和网络攻击。
33
拓展学习资源推荐(书籍、网站等)
4
交换机工作原理
交换机根据收到数据帧中的源 MAC地址建立该地址同交换机 端口的映射,并将其写入MAC
地址表中。
交换机将数据帧中的目的MAC 地址同已建立的MAC地址表进 行比较,以决定由哪个端口进
行转发。
2024/3/23
如数据帧中的目的MAC地址不 在MAC地址表中,则向所有端 口转发。这一过程称为泛洪( Flood)。
2024/3/23
查看MAC地址表
使用“show mac-address-table” 命令查看交换机的MAC地址表,包 括MAC地址、接口、VLAN等信息。
查看路由表
如果交换机配置了路由功能,可使用 “show ip route”命令查看路由表 信息。
14
04
端口配置与VLAN划分
Chapter
01
02
03
04
书籍推荐
《Cisco交换机配置与管 理》、《网络工程师必读 ——交换机/路由器配置 与管理》等。
网站推荐
Cisco官方网站、华为企 业网络学院、网络技术论 坛等。
在线课程推荐
Coursera、网易云课堂 、51CTO学院等在线教 育平台上提供的相关课程 。
实验环境推荐
GNS3、EVE-NG等网络 模拟器可以在个人计算机 上搭建虚拟实验环境,进 行交换机配置的实践操作 。

cisco交换机配置及安全防护全解29页

cisco交换机配置及安全防护全解29页
更改特权密码 1234(config)#enable password 123 1234(config)#
1234(config)#enable secret 234 1234(config)#
查看全局配置 Switch#show running-config
保存当前配置 Switch#copy running-config startup-config
当一个端口允许多个vlan通过时,trunk allowed vlan中要添加各条vlan信息
Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)# switchport trunk allowed vlan all Switch(config-if)#switchport trunk allowed vlan 10,50,60 Switch(config-if)#switchport trunk allowed vlan add 20 (remove 删除) Switch(config-if)#switchport trunk allowed vlan add 30 Switch(config-if)#switchport trunk allowed vlan add 40 Switch(config-if)#switchport trunk native vlan 1 Switch(config-if)#no shutdown Switch(config-if)#end Switch#copy running-config startup-config
10 Force 10 Mbps operation 100 Force 100 Mbps operation 1000 Force 1000 Mbps operation auto Enable AUTO speed configuration Switch(config-if)#speed auto Switch(config-if)#

思科cisco交换机端口安全配置(宝典)

思科cisco交换机端口安全配置(宝典)

思科cisco 交换机端口安全配置你可以使用端口安全特性来约束进入一个端口的访问,基于识别站点的mac 地址的方法。

当你绑定了mac 地址给一个端口,这个口不会转发限制以外的mac 地址为源的包。

如果你限制安全mac 地址的数目为1,并且把这个唯一的源地址绑定了,那么连接在这个接口的主机将独自占有这个端口的全部带宽。

如果一个端口已经达到了配置的最大数量的安全mac 地址,当这个时候又有另一个mac 地址要通过这个端口连接的时候就发生了安全违规,(security violation).同样地,如果一个站点配置了mac 地址安全的或者是从一个安全端口试图连接到另一个安全端口,就打上了违规标志了。

理解端口安全:当你给一个端口配置了最大安全mac 地址数量,安全地址是以一下方式包括在一个地址表中的:·你可以配置所有的mac 地址使用switchport port-security mac-address,这个接口命令。

·你也可以允许动态配置安全mac 地址,使用已连接的设备的mac 地址。

·你可以配置一个地址的数目且允许保持动态配置。

注意:如果这个端口shutdown 了,所有的动态学的mac 地址都会被移除。

一旦达到配置的最大的mac 地址的数量,地址们就会被存在一个地址表中。

设置最大mac 地址数量为1,并且配置连接到设备的地址确保这个设备独占这个端口的带宽。

当以下情况发生时就是一个安全违规:·最大安全数目mac 地址表外的一个mac 地址试图访问这个端口。

·一个mac 地址被配置为其他的接口的安全mac 地址的站点试图访问这个端口。

你可以配置接口的三种违规模式,这三种模式基于违规发生后的动作:·protect-当mac 地址的数量达到了这个端口所最大允许的数量,带有未知的源地址的包就会被丢弃,直到删除了足够数量的mac 地址,来降下最大数值之后才会不丢弃。

思科交换机端口安全(Port-Security)配置方法详解

思科交换机端口安全(Port-Security)配置方法详解

思科交换机端口安全(Port-Security)Cisco Catalyst交换机端口安全(Port-Security)1、 Cisco29系列交换机可以做基于2层的端口安全,即mac地址与端口进行绑定。

2、 Cisco3550以上交换机均可做基于2层和3层的端口安全,即mac地址与端口绑定以及mac地址与ip地址绑定。

3、以cisco3550交换机为例做mac地址与端口绑定的可以实现两种应用:a、设定一端口只接受第一次连接该端口的计算机mac地址,当该端口第一次获得某计算机mac地址后,其他计算机接入到此端口所发送的数据包则认为非法,做丢弃处理。

b、设定一端口只接受某一特定计算机mac地址,其他计算机均无法接入到此端口。

4、破解方法:网上前辈所讲的破解方法有很多,主要是通过更改新接入计算机网卡的mac地址来实现,但本人认为,此方法实际应用中基本没有什么作用,原因很简单,如果不是网管,其他一般人员平时根本不可能去注意合法计算机的mac地址,一般情况也无法进入合法计算机去获得mac地址,除非其本身就是该局域网的用户。

5、实现方法:针对第3条的两种应用,分别不同的实现方法a、接受第一次接入该端口计算机的mac地址:Switch#config terminalSwitch(config)#inte**ce inte**ce-id 进入需要配置的端口Switch(config-if)#switchport mode access 设置为交换模式Switch(config-if)#switchport port-security 打开端口安全模式Switch(config-if)#switchport port-security violation {protect | restrict | shutdown }//针对非法接入计算机,端口处理模式{丢弃数据包,不发警告 | 丢弃数据包,在console发警告 | 关闭端口为err-disable状态,除非管理员手工激活,否则该端口失效。

Cisco路由器交换机安全配置

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以上均已经配置。

交换机端口安全防护与配置方法技巧

交换机端口安全防护与配置方法技巧

交换机端口安全防护与配置方法技巧交换机的主要功能包括物理编址、网络拓扑结构、错误校验、帧序列以及流控。

交换机还具备了一些新的功能,如对VLAN虚拟局域网的支持、对链路汇聚的支持,甚至有的还具有防火墙的功能。

今天我们来介绍一下交换机端口安全的配置内容,主要防止公司内部的网络攻击和破坏行为,详细的教程,请看下文介绍,需要的朋友可以参考下方法步骤1、配置交换机端口的最大连接数限制。

Switch#configure terminalSwitchconfig#interface range fastethernet 0/3 进行0模块第3端口的配置模式 Switchconfig-if#switchport port-security 开启交换机的端口安全功能Switchconfig-if#switchport port-secruity maximum 1 配置端口的最大连接数为1Switchconfig-if#switchport port-secruity violation shutdown 配置安全违例的处理方式为shutdown2、验证测试:查看交换机的端口安全配置。

Switch#show port-security3、配置交换机端口的地址绑定Switch#configure terminalSwitchconfig#interface f astethernet 0/3Switchconfig-if#switchport port-securitySwitchconfig-if#switchport port-security mac-address 00 06.1bde.13b4 ip-address 172.16.1.55 配置IP 地址和MAC 地址的绑定4、验证测试:查看地址安全绑定配置。

Switch#show port-security address5、查看主机的IP 和MAC 地址信息。

cisco交换机安全配置设定方法.doc

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状态的端口才可以发送数据。

思科交换机的基本配置

思科交换机的基本配置

思科交换机的基本配置思科交换机的基本配置 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 ;设置虚拟终端登录⼝令csico6 switch#exit ;返回命令 交换机VLAN创建,删除,端⼝属性的设置,配置trunk端⼝,将某端⼝加⼊vlan中,配置VTP: switch#vlan database ;进⼊VLAN设置 switch(vlan)#vlan 2 ;建VLAN 2 switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3 switch(vlan)#no vlan 2 ;删vlan 2 switch(config)#int f0/1 ;进⼊端⼝1 switch(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 2 switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式) switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlan switch(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 1 switch(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 设置超时时间为100ms switch(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)#end switch#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 设置控制台会话超时为0 service 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 保存信息到NVRAM erase startup-config 清除NVRAM中的配置信息 show ip interface brief 查看接⼝的谪要信息 banner motd # +信息 + # 配置路由器或交换机的描素信息 description+信息配置接⼝听描素信息 vlan database 进⼊VLAN数据库模式 vlan +vlan号+ 名称创建VLAN switchport 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号删除VLAN show 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-ID encapsulation+封装格式更改封装格式 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/2 Switch(config-if)# no switchport Switch(config-if)# ip address 192.20.135.21 255.255.255.0 Switch(config-if)# no shutdown 配置VLAN configure terminal 进⼊配置状态 vlan vlan-id 输⼊⼀个VLAN号, 然后进⼊vlan配态,可以输⼊⼀个新的VLAN号或旧的来进⾏修改 。

Cisco交换机详细配置及命令说明

Cisco交换机详细配置及命令说明

Cisco交换机的概述交换机根据OSI层次通常可分为第2层交换机和多层交换机。

通常所说的交换机指第2层交换机也叫LAN交换机(第二层MAC地址进行交换);多层交换机与第2层交换机工作方式类似,除了使用第二层MAC地址进行交换之外,还使用第3层网络地址。

交换机的基本配置3、电缆连接及终端配置如图11-8所示,接好PC机和交换机各自的电源线,在未开机的条件下,把PC机的串口1(COM1)通过控制台电缆线与交换机的Console端口相连,即完成设备连接工作。

交换机Console端口的默认参数如下:端口速率:9600b/s;数据位:8;奇偶校验:无;停止位:1;流控:无。

3、交换机的启动启动过程未用户提供了丰富的信息,我们可以对交换机的硬件结构和软件加载过程有直观的认识,这些信息对我们了解该交换机以及对她做相应的配置很有帮助,另外部件号、序列号、版本号等信息再产品验货时都是非常重要的信息。

3、交换机的基本配置在默认情况下,所有接口处于可用状态并且都属于VLAN1,这种情况下交换机就可用正常工作了,为了方便管理和使用,首先应对交换机做基本的配置,最基本的配置可以通过启动时的对话框配置模式完成,也可以在交换机启动后再进行配置。

(1)配置Enable口令和主机名。

在交换机中可以配置使能口令(Enable password)和使能密码(Enable secret),一般情况下只需配置一个就可以,当两者同时配置时,后者生效。

这两者的区别是使能口令以明文显示而使能密码以密文形式显示。

Switch> (用户执行模式提示符)Switch>enable (进入特权模式)Switch # (特权模式提示符)Switch # config termianal (进入配置模式)Switch (config) # (配置模式提示符)Switch (config) # enable password cisco 设置enable password 为cisco)Switch (config) # enable secret cisco1 (设置enable secret 为cisco1)Switch (config) # hostname C2950 (设置主机名为C2950)C2950 (config) # end (退回到特权模式)C2950 #(2)配置交换机IP地址、默认网关、域名、域名服务器。

【cisco交换机安全配置设定】 cisco交换机配置教程

【cisco交换机安全配置设定】 cisco交换机配置教程

【cisco交换机安全配置设定】 cisco交换机配置教程你还在为不知道cisco交换机安全配置设定而烦恼么?接下来是为大家收集的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 5pass_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级用户设置用户名和密码,Ciscoprivilege 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,bpdufilter VLAN,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状态的端口才可以发送数据。

cisco交换机的端口安全配置

cisco交换机的端口安全配置

【官方提供】【实验文档】【实验0021】【交换机的端口安全配置】【实验名称】交换机的端口安全配置。

【实验目的】掌握交换机的端口安全功能,控制用户的安全接入。

【背景描述】你是一个公司的网络管理员,公司要求对网络进行严格控制。

为了防止公司内部用户的IP 地址冲突,防止公司内部的网络攻击和破坏行为。

为每一位员工分配了固定的IP地址,并且限制只允许公司员工主机可以使用网络,不得随意连接其他主机。

例如:某员工分配的IP地址是172.16.1.55/24,主机MAC地址是00-06-1B-DE-13-B4。

该主机连接在1台2126G 上边。

【技术原理】交换机端口安全功能,是指针对交换机的端口进行安全属性的配置,从而控制用户的安全接入。

交换机端口安全主要有两种类项:一是限制交换机端口的最大连接数,二是针对交换机端口进行MAC地址、IP地址的绑定。

限制交换机端口的最大连接数可以控制交换机端口下连的主机数,并防止用户进行恶意的ARP欺骗。

交换机端口的地址绑定,可以针对IP地址、MAC地址、IP+MAC进行灵活的绑定。

可以实现对用户进行严格的控制。

保证用户的安全接入和防止常见的内网的网络攻击。

如ARP欺骗、IP、MAC地址欺骗,IP地址攻击等。

配置了交换机的端口安全功能后,当实际应用超出配置的要求,将产生一个安全违例,产生安全违例的处理方式有3种:⌝ protect 当安全地址个数满后,安全端口将丢弃未知名地址(不是该端口的安全地址中的任何一个)的包。

⌝ restrict 当违例产生时,将发送一个Trap通知。

⌝ shutdown 当违例产生时,将关闭端口并发送一个Trap通知。

当端口因为违例而被关闭后,在全局配置模式下使用命令errdisable recovery来将接口从错误状态中恢复过来。

【实现功能】针对交换机的所有端口,配置最大连接数为1,针对PC1主机的接口进行IP+MAC地址绑定。

【实验设备】S2126G交换机(1台),PC(1台)、直连网线(1条)【实验拓扑】图 26【实验步骤】步骤1. 配置交换机端口的最大连接数限制。

思科交换机安全配置基线

思科交换机安全配置基线

《思科交换机安全配置基线》目录1概述 (1)1.1适用范围 (1)1.2术语和定义 (1)1.3符号和缩略语 (1)2思科交换机设备安全配置要求 (2)2.1账号管理、认证授权 (2)2.1.1账户 (2)2.1.2口令 (3)2.1.3认证 (4)2.2日志安全要求 (5)2.3IP协议安全要求 (7)2.3.1基本协议安全 (7)2.3.2SNMP协议安全 (9)2.4访问控制安全要求 (10)2.5V LAN安全要求 (14)2.6其他安全要求 (16)页号: 1 of 191概述1.1 适用范围本规范适用于思科交换机。

本规范明确了思科交换机安全配置方面的基本要求。

基线配置项中的“可选”项,可以根据具体系统和应用环境,选择是否遵守。

1.2 术语和定义BGP Route flap damping:由RFC2439定义,当BGP接口翻转后,其他BGP系统就会在一段可配置的时间内不接受从这个问题网络发出的路由信息。

1.3 符号和缩略语2思科交换机设备安全配置要求2.1账号管理、认证授权2.1.1账户编号:安全要求-设备-思科交换机-配置-1-可选编号:安全要求-设备-思科交换机-配置-22.1.2口令编号: 安全要求-设备-思科交换机-配置-3编号:安全要求-设备-思科交换机-配置-42.1.3认证编号:安全要求-设备-思科交换机-配置-5-可选2.2日志安全要求编号:安全要求-设备-思科交换机-配置-6-可选编号:安全要求-设备-思科交换机-配置-7-可选2.3IP协议安全要求2.3.1基本协议安全编号:安全要求-设备-思科交换机-配置-8-可选编号:安全要求-设备-思科交换机-配置-9-可选2.3.2SNMP协议安全编号:安全要求-设备-思科交换机-配置-10-可选2.4访问控制安全要求编号:安全要求-设备-思科交换机-配置-11编号:安全要求-设备-思科交换机-配置-12-可选编号:安全要求-设备-思科交换机-配置-13编号:安全要求-设备-思科交换机-配置-14编号:安全要求-设备-思科交换机-配置-15-可选安全要求-设备-思科交换机-配置-16-可选2.5Vlan安全要求安全要求-设备-思科交换机-配置-17-可选安全要求-设备-思科交换机-配置-18-可选2.6其他安全要求编号:安全要求-设备-思科交换机-配置-19安全要求-设备-思科交换机-配置-20。

思科交换机安全配置(包括AAA,端口安全,ARP安全,DHCP侦听,日志审计流量限制)

思科交换机安全配置(包括AAA,端口安全,ARP安全,DHCP侦听,日志审计流量限制)

思科交换机安全配置(包括AAA,端口安全,ARP安全,DHCP侦听,日志审计流量限制)网络拓扑图如下:根据图示连接设备。

在本次试验中,具体端口情况如上图数字标出。

核心交换机(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模式为client SW1(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 10 SW2(config)#int port-channel 10SW2(config-if)#ip arp inspection trust注意:配置静态arp防护(用户主机静态配置地址,不是通过DHCP获取地址),需要新建ip与mac映射表,不然pc1无法ping 通svi口4、OSPF与DHCP全网起OSPF协议,使pc1可以ping通路由器。

cisco路由器的安全防护-电脑资料

cisco路由器的安全防护-电脑资料

cisco路由器的安全防护-电脑资料cisco路由器的安全防护!客户需要一个自己也说不清的需求:保障网络的安全,。

于是本人收集整理了一个所谓的网络安全方案,结果客户很满意,决定把他当作模板来部署他们的网络。

与大家共享,并希望大家都来补充完善。

一、路由器访问控制的安全配置1,严格控制可以访问路由器的管理员。

任何一次维护都需要记录备案。

2,对于远程访问路由器,建议使用访问控制列表和高强度的密码控制。

3,严格控制CON端口的访问,给CON口设置高强度的密码。

4,如果不使用AUX端口,则禁止这个端口。

默认是未被启用。

禁止命令为:Router(Config)#line aux 0Router(Config-line)#transport input noneRouter(Config-line)#no exec5,建议采用权限分级策略。

如:Router(Config)#username BluShin privilege 10 G00dPa55w0rdRouter(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 BluShinRouter(Config)#ip ftp password 4tppa55w0rdRouter#copy startup-config ftp:9,及时的升级和修补IOS软件。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

cisco交换机的安全策略典型配置
1.设备管理
1.1远程管理服务 配置域名 switch(config)#ip domain-name switch.domin-name 生成RSA密钥对 switch(config)#crypto key generate rsa ! How many bits in the modulus [512]:2048 Generating RSA keys [ok] 配置仅允许ssh远程登录 switch(config)#line vty 0 4 switch(config-line)#transport input ssh switch(config-line)#exit

Vlan名称可以自行定义
在全局模式下加入VTP域example Switch(config)#vtp mode client Switch(config)#vtp domain example

Switch#show vlan
查看vlan配置信息

vlan10配置192.168.10.1/24的ip地址
2.2 enable密码
采用secret对密码进行加密,使用不可逆加密算法加密。 switch(config)#enable secret 2-pwd-rouT switch(config)#no enable password
2.3 账户登录空闲时间 设置consloe口登录超时时间5分钟 switch(config)#line console 0 switch(config-line)#exec-timeout 5 switch(config)#line vty 0 4 switch(config-line)#exec-timeout 5

双工模式: Switch(config-if)#duplex ? auto Enable AUTO duplex configuration full Force full duplex operation half Force half-duplex operation

Switch(config-if)#duplex auto Switch(config-if)# 端口描述 Switch(config-if)#description vlan 10 trunk Switch(config-if)#
switch(config-line)#password password
switch(config-line)#login
2.用户 账号与口令安全
2.1 Service password 密码
采用service password-encryption,使口令加密方式得到增强 switch(config)#service password-encryption

恢复出厂默认 Switch#erase startup-config Switch#reload

明文密码和密文密码 Password 1234#show running-config

hostname 1234 enable password 123
Secret 1234#show running-config
2.4密码长度
密码长度至少8位,并包括数字、小写字母、大写字母、和特殊 符号4类中至少2类 switch(config)#username user password
2.5 用户账号管理
按照用户分配账号,避免不同用户账号共享 switch(config)#username user1 password Aa_12345 switch(config)#username user1 privilege 1 switch(config)#username user2 password Aa_abcd5 switch(config)#username user2 privilege 1
3.日志与审计
3.1 SNMP协议安全
修改SNMP的团体串默认通行字,通行字符串应符合口令强度要求, 使用ACL限制只与特定主机进行SNMP协议交互 switch(config)#access-list 75 permit host 14.2.6.60
switch(config)#access-list 75 deny any log 2

Vlan设置范围:1---4094 在全局模式下配置vlan Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#name vlan10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name vlan20
配置ip地址的命令格式: ip address {ip-address} {netmask}
测试常用端口类型
Access / trunk
将此端口设置为vlan10 的access口 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)# 将此端口设置为vlan10 的trunk口 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10
当一个端口允许多个vlan通过时,trunk allowed vlan中要添加各条vlan信息 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)# switchport trunk allowed vlan all Switch(config-if)#switchport trunk allowed vlan 10,50,60 Switch(config-if)#switchport trunk allowed vlan add 20 (remove 删除) Switch(config-if)#switchport trunk allowed vlan add 30 Switch(config-if)#switchport trunk allowed vlan add 40 Switch(config-if)#switchport trunk native vlan 1 Switch(config-if)#no shutdown Switch(config-if)#end Switch#copy running-config startup-config
switch(config)#line vty 0 4 switch(config-line)#access-class 12 in
1.4 console端口管理 console需配置口令认证信息,防止无权限用户通过console 口登录设备,设置登录时间限制。 switch(config)#line console 0 switch(config-line)#exec-timeout 5

hostname 1234 enable secret 5 $1$CCFV$0DTd3rSPZNycrVDjn1rKv/ (MD5 加密的字符串) enable password 123 当明文和密文同时存在时,密文优先级高。
全局模式下进入端口后,可以对端口进行配置。 Switch#conf t Switch(config)#interface gigabitEthernet 0/1 Switch(config-if)# 批量修改端口 range命令 Switch(config)#interface range gigabitEthernet 0/1 - 48 Switch(config-if-range)# 端口速率: Switch(config-if)#speed ? 10 Force 10 Mbps operation 100 Force 100 Mbps operation 1000 Force 1000 Mbps operation auto Enable AUTO speed configuration Switch(config-if)#speed auto Switch(config-if)#
交换机典型配置
内容提要:
交换机的基本功能典型配置
交换机的安全策略典型配置
CISCO交换机的基本功能配置
计算机连接到控制台接口

用户模式 特权模式
Switch> Switch>enable Switch# Switch#configure terminal Switch(config)#


全局模式
此端口为vlan10 vlan20 vlan30 vlan40的trunk口,default vlan 1经过

光端口配置
Switch(config)#interface gigabitEthernet 0/25 Switch(config-if)# switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#no shutdown Switch(config-if)#end Switch#copy running-config startup-config 注意: 由于思科的交换机只自动识别自己品牌的光模块,所以如果用其他 品牌的光模块,需在配置模式下输入一下两条命令,开启兼容性。 service unsupported-transceiver no errdisable detect cause gbic-invalid 命令输入完成后保存设置重启设备
相关文档
最新文档