当前位置:首页 » 数据仓库 » 思科交换机如何配置主备命令
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

思科交换机如何配置主备命令

发布时间: 2022-10-22 17:38:54

① 思科2960交换机配置命令都有哪些

思科2960交换机配置命令如下:

1、access: 主要用来接入终端设备,如PC机、服务器、打印服务器等。

2、trunk: 主要用在连接其它交换机,以便在线路上承载多个vlan。

3、multi: 在一个线路中承载多个vlan,但不像trunk,它不对承载的数据打标签。主要用于接入支持多vlan的服务器或者一些网络分析设备。现在基本不使用此类接口,在cisco的网络设备中,也基本不支持此类接口了。


(1)思科交换机如何配置主备命令扩展阅读:

交换机口令设置:

1、switch>enable;进入特权模式、switch#configterminal;进入全局配置模式、switch(config)#hostname;设置交换机的主机名。

2、switch(config)#enablesecretxxx;设置特权加密口令、switch(config)#enablepasswordxxa;设置特权非密口令。

3、switch(config)#lineconsole0;进入控制台口、switch(config-line)#linevty04;进入虚拟终端。

4、switch(config-line)#login;允许登录、switch(config-line)#passwordxx;设置登录口令xx、switch#exit;返回命令。

② 求思科交换机的配置命令

1.基于IOS交换机设置主机名/系统名:
switch(config)#
hostname
hostname
基于CLI交换机设置主机名/系统名:
switch(enable)
set
system
name
name-string
2.基于IOS交换机设置登录口令:
switch(config)#
enable
password
level
1
password
基于CLI交换机设置登录口令:
switch(enable)
set
password
switch(enable)
set
enalbepass
3.基于IOS交换机设置远程访问:
switch(config)#
interface
vlan
1
switch(config-if)#
ip
address
ip-address
netmask
switch(config-if)#
ip
default-gateway
ip-address
基于CLI交换机设置远程访问:
switch(enable)
set
interface
sc0
ip-address
netmask
broadcast-address
switch(enable)
set
interface
sc0
vlan
switch(enable)
set
ip
route
default
gateway
4.基于IOS交换机启用浏览CDP信息:
switch(config-if)#
cdp
enable
switch(config-if)#
no
cdp
enable
查看Cisco邻接设备CDP通告信息:
switch#
show
cdp
interface
[type
modle/port]
switch#
show
cdp
neighbors
[type
mole/port]
[detail]
基于CLI交换机启用浏览CDP信息:
switch(enable)
set
cdp
{enable|disable}
mole/port
查看Cisco邻接设备CDP通告信息:
switch(enable)
show
cdp
neighbors[mole/port]
[vlan|plex|capabilities|detail]
5.基于IOS交换机端口描述:
switch(config-if)#
description
description-string
基于CLI交换机端口描述:
switch(enable)set
port
name
mole/number
description-string
6.基于IOS交换机设置端口速度:
switch(config-if)#
speed{10|100|auto}
基于CLI交换机设置端口速度:
switch(enable)
set
port
speed
moudle/number
{10|100|auto}
switch(enable)
set
port
speed
moudle/number
{4|16|auto}
7.基于IOS交换机设置太网链路模式:
switch(config-if)#
plex
{auto|full|half}
基于CLI交换机设置太网链路模式:
switch(enable)
set
port
plex
mole/number
{full|half}
8.基于IOS交换机配置静态VLAN:
switch#
vlan
database
switch(vlan)#
vlan
vlan-num
name
vla
switch(vlan)#
exit
switch#
configure
teriminal
switch(config)#
interface
interface
mole/number
switch(config-if)#
switchport
mode
access
switch(config-if)#
switchport
access
vlan
vlan-num
sw
查看原帖>>
采纳哦

③ cisco交换机的配置命令

交换机口令设置:
switch>enable ;进入特权模式
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 ;设置登录口令xxswitch#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模式

④ 思科交换机如何配置命令是什么要详细的,谢谢!

交换机配置命令config,远端登录telnet,不过没法详细,思科机器型号很多,配置也很多,要配端口,配IP,配速率,建议你网上下载一个配置大全。

⑤ 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密码,破解及其容易!

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,bpguard,bpfilter

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-->listening

15s,listening-->learning 15s,learning-->forwarding 20s

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

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

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

/当一端口启用了root

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

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

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

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

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

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

广播、组播风暴控制设定

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

⑥ 思科三层交换机配置实例及命令

三层交换机是不是经常让你机器不好使,看看下面的三层交换机配置文章,一切问题都能解决。本文详细介绍实例讲解:全面的三层交换机配置比较全面的三层交换机配置实例,带命令解释哟!

三层交换机配置:

Enable //进入私有模式

Configure terminal //进入全局模式

service password-encryption //对密码进行加密

hostname Catalyst 3550-12T1 //给三层交换机定义名称

enable password 123456. //enable密码

Enable secret 654321 //enable的加密密码(应该是乱码而不是654321这样)

Ip subnet-zero //允许使用全0子网(默认都是打开的)

Ip name-server 172.16.8.1 172.16.8.2 //三层交换机名字Catalyst 3550-12T1对应的IP地址是172.16.8.1

Service dhcp //提供DHCP服务

ip routing //启用三层交换机上的路由模块

Exit

三层交换机配置:

Vtp mode server //定义VTP工作模式为sever模式

Vtp domain centervtp //定义VTP域的名称为centervtp

Vlan 2 name vlan2 //定义vlan并给vlan取名(如果不取名的话,vlan2的名字应该是vlan002)

Vlan 3 name vlan3

Vlan 4 name vlan4

Vlan 5 name vlan5

Vlan 6 name vlan6

Vlan 7 name vlan7

Vlan 8 name vlan8

Vlan 9 name vlan9

Exit

三层交换机配置:

interface Port-channel 1 //进入虚拟的以太通道组1

switchport trunk encapsulation dot1q //给这个接口的trunk封装为802.1Q的帧格式

switchport mode trunk //定义这个接口的工作模式为trunk

switchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过

Interface gigabitethernet 0/1 //进入模块0上的吉比特以太口1

switchport trunk encapsulation dotlq //给这个接口的trunk封装为802.1Q的帧格式

switchport mode trunk //定义这个接口的工作模式为trunk

switchport trunk allowed vlan all //在这个trunk上允许所有的vlan通过

channel-group 1 mode on //把这个接口放到快速以太通道组1中

Interface gigabitethernet 0/2 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

channel-group 1 mode on

三层交换机配置:

port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依*源和目的IP的方式)

interface gigabitethernet 0/3 //进入模块0上的吉比特以太口3

switchport trunk encapsulation dotlq //给trunk封装为802.1Q

switchport mode trunk //定义这个接口的工作模式为trunk

switchport trunk allowed vlan all //允许所有vlan信息通过

interface gigabitethernet 0/4 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/5 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/6 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchprot trunk allowed vlan all

三层交换机配置:

interface gigbitethernet 0/7 //进入模块0上的吉比特以太口7

Switchport mode access //定义这个接口的工作模式为访问模式

switchport access vlan 9 //定义这个接口可以访问哪个vlan(实际就是分配这个接口到vlan)

no shutdown

spanning-tree vlan 6-9 cost 1000 //在生成树中,vlan6-9的开销定义为10000

interface range gigabitethernet 0/8 – 10 //进入模块0上的吉比特以太口8,9,10

switchport mode access //定义这些接口的'工作模式为访问模式

switchport access vlan 8 //把这些接口都分配到vlan8中

no shutdown

三层交换机配置:

spanning-tree portfast //在这些接口上使用portfast(使用portfast以后,在生成树的时候不参加运算,直接成为转发状态)

interface gigabitethernet 0/11 //进入模块0上的吉比特以太口11

switchport trunk encapsulation dotlq //给这个接口封装为802.1Q

switchport mode trunk //定义这个接口的工作模式为trunk

switchport trunk allowed vlan all //允许所有vlan信息通过

interface gigabitethernet 0/12 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface vlan 1 //进入vlan1的逻辑接口(不是物理接口,用来给vlan做路由用)

ip address 172.16.1.7 255.255.255.0 //配置IP地址和子网掩码

no shutdown

三层交换机配置:

standby 1 ip 172.16.1.9 //开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为172.16.1.9

standby 1 priority 110 preempt //定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式

interface vlan 2 //同上

ip address 172.16.2.252 255.255.255.0

no shutdown

standby 2 ip 172.16.2.254

standby 2 priority 110 preempt

ip access-group 101 in //在入方向上使用扩展的访问控制列表101

interface vlan 3 //同上

ip address 172.16.3.252 255.255.255.0

no shutdown

三层交换机配置:

standby 3 ip 172.16.3.254

standby 3 priority 110 preempt

ip access-group 101 in

interface vlan 4 //同上

ip address 172.16.4.252 255.255.255.0

no shutdown

standby 4 ip 172.16.4.254

standby 4 priority 110 preempt

ip access-group 101 in

interface vlan 5

ip address 172.16.5.252 255.255.255.0

no shutdown

standby 5 ip 172.16.5.254

standby 5 priority 110 preempt

ip access-group 101 in

interface vlan 6

ip address 172.16.6.252 255.255.255.0

no shutdown

三层交换机配置:

standby 6 ip 172.16.6.254

standby 6 priority 100 preempt

interface vlan 7

ip address 172.16.7.252 255.255.255.0

no shutdown

standby 7 ip 172.16.7.254

standby 7 priority 100 preempt

interface vlan 8

ip address 172.16.8.252 255.255.255.0

no shutdown

standby 8 ip 172.16.8.254

standby 8 priority 100 preempt

interface vlan 9

ip address 172.16.9.252 255.255.255.0

no shutdown

三层交换机配置:

standby 9 ip 172.16.9.254

standby 9 priority 100 preempt

access-list 101 deny ip any 172.16.7.0 0.0.0.255 //扩展的访问控制列表101

access-list 101 permit ip any any

Interface vlan 1 //进入vlan1这个逻辑接口

Ip helper-address 172.16.8.1 //可以转发广播(helper-address的作用就是把广播转化为单播,然后发向172.16.8.1)

Interface vlan 2

Ip helper-address 172.16.8.1

Interface vlan 3

ip helper-address 172.16.8.1

interface vlan 4

ip helper-address 172.16.8.1

interface vlan 5

ip helper-address 172.16.8.1

interface vlan 6

ip helper-address 172.16.8.1

interface vlan 7

ip helper-address 172.16.8.1

interface vlan 9

ip helper-address 172.16.8.1

router rip//启用路由协议RIP

version 2//使用的是RIPv2,如果没有这句,则是使用RIPv1

network 172.16.0.0//宣告直连的网段

exit

三层交换机配置:

ip route 0.0.0.0 0.0.0.0 172.16.9.250//缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172.16.9.250这个路由器

line con 0

line aux 0

line vty 0 15//telnet线路(路由器只有5个,是0-4)

password 12345678//login密码

login

end

running-config startup-config 保存配置

⑦ 思科交换机关于MSTP的配置命令

1、首先我们按着如下图所示搭建一个实验的拓扑图。

⑧ 思科交换机怎么配置

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

(8)思科交换机如何配置主备命令扩展阅读

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

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

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

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

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

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

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

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

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

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

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

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