當前位置:首頁 » 數據倉庫 » 思科交換機如何配置主備命令
擴展閱讀
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)和更高的性能。