『壹』 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
『貳』 思科三層交換機的詳細配置命令是什麼
三層交換機基本配置
【實驗名稱】
三層交換機埠配置。
【實驗目的】
配置開啟三層交換機的三層功能,實現路由作用。
【背景描述】
公司現有1台三層交換機,要求你進行測試,該交換機的三層功能是否工作正常
【技術原理】
三層交換機是在二層交換的基礎上實現了三層的路由功能。三層交換機基於「一次路由,多次交換」的特性,在區域網環境中轉發性能遠遠高於路由器。而且三層交換機同時具備二層的功能,能夠和二層的交換機進行很好的數據轉發。三層交換機的乙太網介面要比一般的路由器多很多,更加適合多個區域網段之間的互聯。
三層交換機的所有埠在默認情況下都屬於二層埠,不具備路由功能。不能給物理埠直接配置IP地址。但可以開啟物理埠的三層路由功能。
三層交換機默認開啟了路由功能,可利用ip
routing命令進行控制。
【實現功能】
開啟三層交換機物理埠的路由功能。
【實驗設備】
S3550-24或S3550-48(1台),直連線(1條)
【實驗步驟】
步驟1.
開啟三層交換機的路由功能。
Switch>enable
Switch#configure
terminal
Switch(config)#hostname
S3550-24
S3550-24(config)#ip
routing
!開啟三層交換機的路由功能
步驟2.
配置三層交換機埠的路由功能。
S3550-24(config)#interface
fastethernet
0/5
S3550-24(config-if)#no
switchport
!開啟埠的三層路由功能
S3550-24(config-if)#ip
address
192.168.5.1
255.255.255.0
!
給埠配置IP地址
S3550-24(config-if)#no
shutdown
S3550-24(config-if)#end
步驟3.
驗證、測試配置。
S3550#show
ip
interface
!查看介面狀態信息
Interface
:
Fa0/5
Description
:
FastEthernet100BaseTX
0/5
OperStatus
:
up
!介面狀態是UP
ManagementStatus
:
Enabled
Primary
Internet
address:
192.168.5.1/24
Broadcast
address
:
255.255.255.255
PhysAddress
:
00d0.f8ff.bd43
S3550#show
interfaces
f0/5
!查看介面狀態信息
Interface
:
FastEthernet100BaseTX
0/5
Description
:
AdminStatus
:
up
!介面狀態是UP
OperStatus
:
up
Medium-type
:
copper
Hardware
:
10/100BaseTX
Mtu
:
1500
LastChange
:
0d:0h:32m:49s
AdminDuplex
:
Auto
OperDuplex
:
Unknown
AdminSpeed
:
Auto
OperSpeed
:
Unknown
FlowControlAdminStatus
:
Off
FlowControlOperStatus
:
Off
Priority
:
0
Broadcast
blocked
:DISABLE
Unknown
multicast
blocked
:DISABLE
Unknown
unicast
blocked
:DISABLE
ARP
Timeout
:
3600
sec
Primary
Internet
address:
192.168.5.1/24
PhysAddress
:
00d0.f8ff.bd43
ManagementStatus:Enabled
Broadcast
address
:
255.255.255.255
主機測試:將PC1的IP地址設為192.168.5.2/24,在PC1上ping
192.168.5.1。
ping
192.168.5.1
Pinging
192.168.5.1
with
32
bytes
of
data:
Reply
from
192.168.5.1:
bytes=32
time<1ms
TTL=64
Reply
from
192.168.5.1:
bytes=32
time<1ms
TTL=64
Reply
from
192.168.5.1:
bytes=32
time<1ms
TTL=64
Reply
from
192.168.5.1:
bytes=32
time<1ms
TTL=64
Ping
statistics
for
192.168.5.1:
Packets:
Sent
=
4,
Received
=
4,
Lost
=
0
(0%
loss),
Approximate
round
trip
times
in
milli-seconds:
Minimum
=
0ms,
Maximum
=
0ms,
Average
=
0ms
【參考配置】
S3550-24#show
running-config
System
software
version
:
1.02
Build
Oct
17
2005
Release
Building
configuration...
Current
configuration
:
145
bytes
version
1.0
hostname
Switch
vlan
1
interface
FastEthernet
0/5
no
switchport
ip
address
192.168.5.1
255.255.255.0
!
end
『叄』 兩台思科交換機堆疊如何配置
默認不需要配置就能堆疊成功,採用菊花鏈的方式連接。
switch01 stack port 01 --- switch02 stack port 02,
switch02 stack port 01 --- switch03 stack port 02,
switch03 stack port 01 --- switch01 stack port 02,
以此類推
『肆』 尋求思科4506交換機配置命令
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]
太多了,一次寫不完
『伍』 思科交換機詳細配置方法和命令
思科交換機的基本配置命令學習
一、交換機口令設置:
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 ;返回命令
二、交換機顯示命令:
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中的配置信息
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怕生成樹議
三. 路由器配置命令
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
+線路號 清除線路
四. 三層交換機配置命令
配置一組二層埠
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號或舊的來進行修改
『陸』 思科交換機怎麼給埠配置ip
1、在思科模擬器上找到Cisco 2960交換機一台,PC 2台,直通線若干條,進行連接配置。
注意事項:
交換機根據工作位置的不同,可以分為廣域網交換機和區域網交換機。廣域的交換機就是一種在通信系統中完成信息交換功能的設備,它應用在數據鏈路層。交換機有多個埠,每個埠都具有橋接功能,可以連接一個區域網或一台高性能伺服器或工作站。實際上,交換機有時被稱為多埠網橋。
『柒』 Cisco交換機Trunk配置命令!
1.(config)#int
f0/0
//進入相應介面,如果是多個介面可以使用命令
int
range
f0/
0
-
n
2.(config-if)#switchport
trunk
encapsulation
{dot1q|isl
}//封裝dot1q或者isl(isl為思科私有,dot1q是802.1q,通用)
3.(config-if)#switchport
mode
trunk
//配置埠為trunk類型
4.(config-if)#switchport
trunk
allowed
vlan
all
//trunk允許所有vlan的流量通過
注意:2和3順序不可顛倒
『捌』 求答兩台思科3750交換機堆疊的配置,有詳細配置和講解最好
堆疊有幾個前提,ios要求一致,設備型號最好是一致
比如cisco3750g 和cisco3750x是不能做堆疊的
2台堆疊 A機的stack1 接 B機的stack2 A機的stack2 接 B 機的stack1
『玖』 Packet Tracer 如何配置兩台交換機堆疊(希望給出相關配置命令)
模擬器不能模擬堆疊,堆疊是要專門的堆疊線才可以
『拾』 兩台思科交換機堆疊如何配置
堆疊需要在2台交換機上都加配置,1台配了,1台沒配是無法堆疊的。
在添加配置的時候,可以指定優先順序,用優先順序來決定主備關系。如果不配置,則由交換機之間根據ip地址的大小來選舉主機。
堆疊完成後,部分配置會重合,邏輯上2台已經「合體」了,堆疊配置就只保留一份,但如果繼續堆疊,就需要在後進的交換機上繼續配置,這個不是直接插上就好的技術。