思科交换机怎么配置?

发布时间:2024-10-03 10:28:08 来源:君肯网

1、首先将一台PC和一台交换机用线缆连接起来。

2、打开PC,规范好PC的网络配置,如下图所示,记住PC的网关就是交换机的IP地址。

3、进入交换机的中端里面进行配置。

4、先给交换机起一个名字,命令是:Switch#conf tEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#hostname s1s1(config)#

5、在小型或中型甚至大型企业,不可能只有一台交换机连接一台电脑,以下就是交换机的端口。

6、交换机还可以创建wlan模式。

扩展资料

交换机的主要功能包括物理编址、网络拓扑结构、错误校验、帧序列以及流控。交换机还具备了一些新的功能,如对VLAN(虚拟局域网)的支持、对链路汇聚的支持,甚至有的还具有防火墙的功能。

学习:以太网交换机了解每一端口相连设备的MAC地址,并将地址同相应的端口映射起来存放在交换机缓存中的MAC地址表中。

转发/过滤:当一个数据帧的目的地址在MAC地址表中有映射时,它被转发到连接目的节点的端口而不是所有端口(如该数据帧为广播/组播帧则转发至所有端口)。

消除回路:当交换机包括一个冗余回路时,以太网交换机通过生成树协议避免回路的产生,同时允许存在后备路径。

交换机除了能够连接同种类型的网络之外,还可以在不同类型的网络(如以太网和快速以太网)之间起到互连作用。如今许多交换机都能够提供支持快速以太网或FDDI等的高速连接端口,用于连接网络中的其它交换机或者为带宽占用量大的关键服务器提供附加带宽。

一般来说,交换机的每个端口都用来连接一个独立的网段,但是有时为了提供更快的接入速度,我们可以把一些重要的网络计算机直接连接到交换机的端口上。这样,网络的关键服务器和重要用户就拥有更快的接入速度,支持更大的信息流量。

最后简略的概括一下交换机的基本功能:

1. 像集线器一样,交换机提供了大量可供线缆连接的端口,这样可以采用星型拓扑布线。

2. 像中继器、集线器和网桥那样,当它转发帧时,交换机会重新产生一个不失真的方形电信号。

3. 像网桥那样,交换机在每个端口上都使用相同的转发或过滤逻辑。

4. 像网桥那样,交换机将局域网分为多个冲突域,每个冲突域都是有独立的宽带,因此大大提高了局域网的带宽。

5. 除了具有网桥、集线器和中继器的功能以外,交换机还提供了更先进的功能,如虚拟局域网(VLAN)和更高的性能。

参考资料:

百度百科-交换机

Cisco常用的路由器交换机配置命令

cisco交换机安全配置设定命令大全

思科交换机的安全怎么设置,下面为大家分交换机安全设置的配置命令,希望对同学们学习思科交换机有所帮助!

一、交换机访问控制安全配置

1、对交换机特权模式设置密码尽量采用加密和md5 hash方式

switch(config)#enable secret 5 pass_string

其中 0 Specifies an UNENCRYPTED password will follow

5 Specifies an ENCRYPTED secret will follow

建议不要采用enable password pass_sting密码,pj及其容易!

2、设置对交换机明文密码自动进行加密隐藏

switch(config)#service password-encryption

3、为提高交换机管理的灵活性,建议权限分级管理并建立多用户

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_userA

switch(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 0

switch(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 0

switch(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 15

switch(config-line)#access-class 18 in /在线路模式下调用前面定义的标准ACL 18

switch(config-line)#exec-timeout 5 0 /设置不执行命令操作的超时时间,单位为分钟和秒

switch(config-line)#authorization commands 7 vty-in /调用设置的授权列表vty-in

switch(config-line)#authorization commands 15 vty-in

switch(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服务器组成员服务器ip

switch(config-sg-tacacs+)#server x.x.x.x

switch(config-sg-tacacs+)#exit

switch(config)# tacacs-server key paa_string /设置同tacacs-server服务器通信的密钥

二、交换机网络服务安全配置

禁用不需要的各种服务协议

switch(config)#no service pad

switch(config)#no service finger

switch(config)#no service tcp-small-servers

switch(config)#no service udp-small-servers

switch(config)#no service config

switch(config)#no service ftp

switch(config)#no ip http server

switch(config)#no ip http secure-server

/关闭http,https远程web管理服务,默认cisco交换机是启用的

三、交换机防攻击安全加固配置

MAC Flooding(泛洪)和Spoofing(欺骗)攻击

预防方法:有效配置交换机port-security

STP攻击

预防方法:有效配置root guard,bpduguard,bpdufilter

VLAN,DTP攻击

预防方法:设置专用的native vlan不要的接口shut或将端口模式改为access

DHCP攻击

预防方法:设置dhcp snooping

ARP攻击

预防方法:在启用dhcp snooping功能下配置DAI和port-security在级联上层交换机的trunk下

switch(config)#int gi x/x/x

switch(config-if)#sw mode trunk

switch(config-if)#sw trunk encaps dot1q

switch(config-if)#sw trunk allowed vlan x-x

switch(config-if)#spanning-tree guard loop

/启用环路保护功能,启用loop guard时自动关闭root guard

接终端用户的端口上设定

switch(config)#int gi x/x/x

switch(config-if)#spanning-tree portfast

/在STP中交换机端口有5个状态:disable、blocking、listening、learning、forwarding,只有处于forwarding状态的端口才可以发送数据。但需经过从blocking–&gtlistening

15s,listening–&gtlearning 15s,learning–&gtforwarding 20s

共计50s的时间,启用portfast后将直接从blocking–&gtforwarding状态,这样大大缩短了等待的时间。

说明:portfast仅适用于连接终端或服务器的交换机端口,不能在连接交换机的端口上使用!

switch(config-if)#spanning-tree guard root

/当一端口启用了root

guard功能后,当它收到了一个比根网桥优先值更优的.BPDU包,则它会立即阻塞该端口,使之不能形成环路等情况。这个端口特性是动态的,当没有收到更优的包时,则此端口又会自己变成转发状态了。

switch(config-if)#spanning-tree bpdufilter enable

/当启用bpdufilter功能时,该端口将丢弃所有的bpdu包,可能影响网络拓扑的稳定性并造成网络环路

switch(config-if)#spanning-tree bpduguard enable

/当启用bpduguard功能的交换机端口接收到bpdu时,会立即将该端口置为error-disabled状态而无法转发数据,进而避免了网络环路!

注意:同时启用bpduguard与bpdufilter时,bpdufilter优先级较高,bpduguard将失效!

广播、组播风暴控制设定

switch(config-if)#storm-control broadcast level 10 /设定广播的阀值为10%

switch(config-if)#storm-control multicast level 10 /设定组播的阀值为10%

switch(config-if)#storm-control action shutdown / Shutdown this interface

if a storm occurs

or switch(config-if)#storm-control action trap / Send SNMP trap if a storm

思科交换机常用命令

cisco制造的路由器设备、交换机和其他设备承载了全世界80%的互联网通信,成为硅谷中新经济的传奇,那么你了解Cisco常用的路由器交换机配置命令吗?下面是我整理的一些关于Cisco常用的路由器交换机配置命令的相关资料,供你参考。

Cisco常用的路由器支持的命令:

路由器显示命令:

router#show run 显示配置信息

router#show interface 显示接口信息

router#show ip route 显示路由信息

router#show cdp nei 显示邻居信息

router#reload 重新起动

路由器口令设置:

router&gtenable 进入特权模式

router#config terminal 进入全局配置模式

router(config)#hostname 设置交换机的主机名

router(config)#enable secret xxx 设置特权加密口令

router(config)#enable password xxb 设置特权非密口令

router(config)#line console 0 进入控制台口

router(config-line)#line vty 0 4 进入虚拟终端

router(config-line)#login 要求口令验证

router(config-line)#password xx 设置登录口令xx

router(config)#(Ctrl+z) 返回特权模式

router#exit 返回命令

路由器配置:

router(config)#int s0/0 进入Serail接口

router(config-if)#no shutdown 激活当前接口

router(config-if)#clock rate 64000 设置同步时钟

router(config-if)#ip address 设置IP地址

router(config-if)#ip address second 设置第二个IP

router(config-if)#int f0/0.1 进入子接口

router(config-subif.1)#ip address 设置子接口IP

router(config-subif.1)#encapsulation dot1q 绑定vlan中继协议

router(config)#config-register 0x2142 跳过配置文件

router(config)#config-register 0x2102 正常使用配置文件

router#reload 重新引导

路由器文件操作:

router#copy running-config startup-config 保存配置

router#copy running-config tftp 保存配置到tftp

router#copy startup-config tftp 开机配置存到tftp

思科交换机怎么配置?

router#copy tftp flash: 下传文件到flash

router#copy tftp startup-config 下载配置文件

ROM状态:

Ctrl+Break 进入ROM监控状态

rommon&gtconfreg 0x2142 跳过配置文件

rommon&gtconfreg 0x2102 恢复配置文件

rommon&gtreset 重新引导

rommon&gtcopy xmodem: flash: 从console传输文件

rommon&gtIP_ADDRESS=10.65.1.2 设置路由器IP

rommon&gtIP_SUBNET_MASK=255.255.0.0 设置路由器掩码

rommon&gtTFTP_SERVER=10.65.1.1 指定TFTP服务器IP

rommon&gtTFTP_FILE=c2600.bin 指定下载的文件

rommon&gttftpdnld 从tftp下载

rommon&gtdir flash: 查看闪存内容

rommon&gtboot 引导IOS

静态路由:

ip route 命令格式

router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 静态路由举例

router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 默认路由举例

动态路由:

router(config)#ip routing 启动路由转发

router(config)#router rip 启动RIP路由协议。

router(config-router)#network 设置发布路由

router(config-router)#negihbor 点对点帧中继用。

帧中继命令:

router(config)#frame-relay switching 使能帧中继交换

router(config-s0)#encapsulation frame-relay 使能帧中继

router(config-s0)#fram-relay lmi-type cisco 设置管理类型

router(config-s0)#frame-relay intf-type DCE 设置为DCE

router(config-s0)#frame-relay dlci 16

router(config-s0)#frame-relay local-dlci 20 设置虚电路号

router(config-s0)#frame-relay interface-dlci 16

router(config)#log-adjacency-changes 记录邻接变化

router(config)#int s0/0.1 point-to-point 设置子接口点对点

router#show frame pvc 显示永久虚电路

router#show frame map 显示映射

基本访问控制列表:

router(config)#access-list permit|deny

router(config)#interface default:deny any

router(config-if)#ip access-group in|out defaultut

例1:

router(config)#access-list 4 permit 10.8.1.1

router(config)#access-list 4 deny 10.8.1.0 0.0.0.255

router(config)#access-list 4 permit 10.8.0.0 0.0.255.255

router(config)#access-list 4 deny 10.0.0.0 0.255.255.255

router(config)#access-list 4 permit any

router(config)#int f0/0

router(config-if)#ip access-group 4 in

扩展访问控制列表:

access-list permit|deny icmp [type]

access-list permit|deny tcp [port]

例3:

router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo

router(config)#access-list 101 permit ip any any

router(config)#int s0/0

router(config-if)#ip access-group 101 in

例3:

router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80

router(config)#access-list 102 permit ip any any

router(config)#interface s0/1

router(config-if)#ip access-group 102 out

删除访问控制例表:

router(config)#no access-list 102

router(config-if)#no ip access-group 101 in

路由器的nat配置

Router(config-if)#ip nat inside 当前接口指定为内部接口

Router(config-if)#ip nat outside 当前接口指定为外部接口

Router(config)#ip nat inside source static [p] [port]

Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1

Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80

Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0

Router(config)#ip nat inside source list 1 pool p1

Router(config)#ip nat inside destination list 2 pool p2

Router(config)#ip nat inside source list 2 interface s0/0 overload

Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary

Router#show ip nat translation

rotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。

overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。

外部网关协议配置

routerA(config)#router bgp 100

routerA(config-router)#network 19.0.0.0

routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置PPP验证:

RouterA(config)#username password

RouterA(config)#int s0

RouterA(config-if)#ppp authentication {chap|pap}

3.PIX防火墙命令

Pix525(config)#nameif ethernet0 outside security0 命名接口和级别

Pix525(config)#interface ethernet0 auto 设置接口方式

Pix525(config)#interface ethernet1 100full 设置接口方式

Pix525(config)#interface ethernet1 100full shutdown

Pix525(config)#ip address inside 192.168.0.1 255.255.255.0

Pix525(config)#ip address outside 133.0.0.1 255.255.255.252

Pix525(config)#global (if_name) natid ip-ip 定义公网IP区间

Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 例句

Pix525(config)#global (outside) 1 133.0.0.1 例句

Pix525(config)#no global (outside) 1 133.0.0.1 去掉设置

Pix525(config)#nat (if_name) nat_id local_ip [netmark]

Pix525(config)#nat (inside) 1 0 0

内网所有主机(0代表0.0.0.0)可以访问global 1指定的外网。

Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0

内网172.16.5.0/16网段的主机可以访问global 1指定的外网。

Pix525(config)#route if_name 0 0 gateway_ip [metric] 命令格式

Pix525(config)#route outside 0 0 133.0.0.1 1 例句

Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 例句

Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8

表示内部ip地址192.168.0.8,访问外部时被翻译成133.0.0.1全局地址。

Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8

中间区域ip地址172.16.0.8,访问外部时被翻译成133.0.0.1全局地址。

Cisco常用的交换机支持的命令:

交换机基本状态:

switch: ROM状态, 路由器是rommon&gt

hostname&gt用户模式

hostname# 特权模式

hostname(config)# 全局配置模式

hostname(config-if)# 接口状态

交换机口令设置:

switch&gtenable 进入特权模式

switch#config terminal 进入全局配置模式

switch(config)#hostname 设置交换机的主机名

switch(config)#enable secret xxx 设置特权加密口令

switch(config)#enable password xxa 设置特权非密口令

switch(config)#line console 0 进入控制台口

switch(config-line)#line vty 0 4 进入虚拟终端

switch(config-line)#login 允许登录

switch(config-line)#password xx 设置登录口令xx

switch#exit 返回命令

交换机VLAN设置:

switch#vlan database 进入VLAN设置

switch(vlan)#vlan 2 建VLAN 2

switch(vlan)#no vlan 2 删vlan 2

switch(config)#int f0/1 进入端口1

switch(config-if)#switchport access vlan 2 当前端口加入vlan 2

switch(config-if)#switchport mode trunk 设置为干线

switch(config-if)#switchport trunk allowed vlan 1,2 设置允许的vlan

switch(config-if)#switchport trunk encap dot1q 设置vlan 中继

switch(config)#vtp domain 设置发vtp域名

switch(config)#vtp password 设置发vtp密码

switch(config)#vtp mode server 设置发vtp模式

switch(config)#vtp mode client 设置发vtp模式

交换机设置IP地址:

switch(config)#interface vlan 1 进入vlan 1

switch(config-if)#ip address 设置IP地址

switch(config)#ip default-gateway 设置默认网关

switch#dir flash: 查看闪存

交换机显示命令:

switch#write 保存配置信息

switch#show vtp 查看vtp配置信息

switch#show run 查看当前配置信息

switch#show vlan 查看vlan配置信息

switch#show interface 查看端口信息

switch#show int f0/0 查看指定端口信息

思科交换机常用命令:

1:进入特权模式enable

switch&gtenable

switch#

2:进入全局配置模式configureterminal

switch&gtenable

switch#configureterminal

switch(conf)#

3:交换机命名hostnameaptech2950以aptech2950为例

switch&gtenable

switch#configureterminal

switch(conf)#hostnameaptch-2950

aptech2950(conf)#

含义

如果接入层出现了环路,譬如HUB被短接,势必会反应到所在的分布层交换机,从而导致分布层交换机CPU高,这是肯定。建议利用Solarwinds工具对所有分布层交换机CPU进行监控,当某片区用户反应慢,首先检查该片区分布交换机CPU利用率。

以上就是关于思科交换机怎么配置?全部的内容,如果了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

更多相关资讯

1、首先将一台PC和一台交换机用线缆连接起来。 2、打开PC,规范好PC的网络配置,如下图所示,记住PC的网关就是交换机的IP地址。 3、进…
查看详情
1、首先将一台PC和一台交换机用线缆连接起来。 2、打开PC,规范好PC的网络配置,如下图所示,记住PC的网关就是交换机的IP地址。 3、进…
查看详情
1、首先将一台PC和一台交换机用线缆连接起来。 2、打开PC,规范好PC的网络配置,如下图所示,记住PC的网关就是交换机的IP地址。 3、进…
查看详情
相关文章
推荐游戏
风之谷
风之谷
游戏资讯 10.5M
下载
斗罗大陆3
斗罗大陆3
游戏资讯 566.9M
下载
冠军网球
冠军网球
游戏资讯 148.1M
下载
最佳炮手
最佳炮手
游戏资讯 68.1M
下载
如梦下弦月
如梦下弦月
游戏资讯 840.1M
下载
富甲封神传
富甲封神传
游戏资讯 263.0M
下载