ibm 刀片 BladeCenter H22 背板交换机链路聚合配置bnt和nt

折腾了几天,刀片终于上架了,开始了网络配置,通过管理口登录管理刀箱,但开始配置,之前从来没有碰过刀片,居然以为插上电简单配置一下就可以通了,谁知道一个刀箱上居然有两个交换机需要配置,到ibm官方网站上去查,居然有3个牌子的手册,据说是找cisco、北电、博科三家厂商oem的,我都不知道看那个,全部下载下来研究吧。

最后发现这个应该是北电的,好像是博科把北电收购了,上面的标貌似博科。哈哈,看的差不多了就开始配置了(当然有高手在,我自己的话估计够呛)。

由于项目需求,需要把带万兆光口的交换机(ibm 刀箱背板上的交换机)和博科 rx-16做爽端口绑定,就是我们常说的链路聚合(目的当然是冗余和加大带宽)。当然在配置中遇到了不少问题,2天之中从博科交换机到ibm交换机,再到ibm刀箱背板交换机。都是以前没用过的。

bnt用于计算网络

nt用于管理网

我们需要把背板上的bnt交换机的两个万兆口做聚合与博客交换机的连接,当然博客交换机上也是配置聚合,nt交换机就比较简单了,把tag标签去掉。纯2层模式就可以了。

一、配置前检查

bnt进入交换机

进交换机之前先检查交换机是否是干净的状态。
info进 入主菜单输入info,这里面是查看信息的地方
首先检查port
然后检查lacp 动态聚合
可以检查vlan
如果有可以删除,之后才继续安装。

二、配置

1、取消tag标签
cfg进入配置模式
port 1-14 (不能批量,只能一个一个的敲)
tag d把tag改为untag模式(与cisco的trunk到access类似,但是cisco认为access口)

apply
info
port

2、配置trunk
cfg
trunk
ena
选择 1
add ext1
add ext2 将口放入trunk
apply
diff

nt交换机配置用步骤1就修改为纯2层模式了

下面为具体是配置:

>> Main# info
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# port
Alias Port Tag Fast Lrn Fld PVID NAME VLAN(s)
----- ---- --- ---- --- ---- -------------- -------------------------------
INT1 1 y n e e 1 INT1 1 4095
INT2 2 y n e e 1 INT2 1 4095
INT3 3 y n e e 1 INT3 1 4095
INT4 4 y n e e 1 INT4 1 4095
INT5 5 y n e e 1 INT5 1 4095
INT6 6 y n e e 1 INT6 1 4095
INT7 7 y n e e 1 INT7 1 4095
INT8 8 y n e e 1 INT8 1 4095
INT9 9 y n e e 1 INT9 1 4095
INT10 10 y n e e 1 INT10 1 4095
INT11 11 y n e e 1 INT11 1 4095
INT12 12 y n e e 1 INT12 1 4095
INT13 13 y n e e 1 INT13 1 4095
INT14 14 y n e e 1 INT14 1 4095
MGT1 15 y n e e 4095*MGT1 4095
MGT2 16 y n e e 4095*MGT2 4095
EXT1 17 n n e e 1 EXT1 1
EXT2 18 n n e e 1 EXT2 1
EXT3 19 n n e e 1 EXT3 1
EXT4 20 n n e e 1 EXT4 1
EXT5 21 n n e e 1 EXT5 1
EXT6 22 n n e e 1 EXT6 1
EXT7 23 n n e e 1 EXT7 1
EXT8 24 n n e e 1 EXT8 1
EXT9 25 n n e e 1 EXT9 1
* = PVID is tagged.

>> information# ls
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# lacp
------------------------------------------------------------
[LACP Menu]
aggr - Show LACP aggregator information for the port
port - Show LACP port information
dump - Show all LACP ports information

>> LACP# dump
port lacp adminkey operkey selected prio attached trunk
aggr
----------------------------------------------------------------------------
INT1 off 1 1 no 32768 -- --
INT2 off 2 2 no 32768 -- --
INT3 off 3 3 no 32768 -- --
INT4 off 4 4 no 32768 -- --
INT5 off 5 5 no 32768 -- --
INT6 off 6 6 no 32768 -- --
INT7 off 7 7 no 32768 -- --
INT8 off 8 8 no 32768 -- --
INT9 off 9 9 no 32768 -- --
INT10 off 10 10 no 32768 -- --
INT11 off 11 11 no 32768 -- --
INT12 off 12 12 no 32768 -- --
INT13 off 13 13 no 32768 -- --
INT14 off 14 14 no 32768 -- --
EXT1 off 17 17 no 32768 -- --
EXT2 off 18 18 no 32768 -- --
EXT3 off 19 19 no 32768 -- --
EXT4 off 20 20 no 32768 -- --
EXT5 off 21 21 no 32768 -- --
EXT6 off 22 22 no 32768 -- --
EXT7 off 23 23 no 32768 -- --
EXT8 off 24 24 no 32768 -- --
EXT9 off 25 25 no 32768 -- --

>> LACP# cd ..
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# ls
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# cd ..
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# vlan
VLAN Name Status Ports
---- -------------------------------- ------ -------------------------
1 Default VLAN ena INT1-INT14 EXT1-EXT9
4095 Mgmt VLAN ena INT1-INT14 MGT1 MGT2

>> Layer 2# lacp
------------------------------------------------------------
[LACP Menu]
aggr - Show LACP aggregator information for the port
port - Show LACP port information
dump - Show all LACP ports information

>> LACP# port
Usage: port <port INT1-14,EXT1-9>

>> LACP# cd ..
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information


>> Layer 2# cd /
------------------------------------------------------------
[Main Menu]
info - information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command,always available]

>> Main# cfg
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port
Enter port (INT1-14,MGT1-2,EXT1-9): 1
------------------------------------------------------------
[Port INT1 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT1# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT1 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT1# apply
------------------------------------------------------------------
Apply complete; don't forget to "save" updated configuration.

>>
Jan 2 8:47:54 170.120.116.224 INFO mgmt: new configuration applied
Port INT1# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 2
------------------------------------------------------------
[Port INT2 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT2# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT2 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT2# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 3
------------------------------------------------------------
[Port INT3 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT3# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT3 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT3# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 4
------------------------------------------------------------
[Port INT4 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT4# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT4 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT4# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 5
------------------------------------------------------------
[Port INT5 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT5# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT5 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT5# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 6
------------------------------------------------------------
[Port INT6 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT6# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT6 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT6# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 7
------------------------------------------------------------
[Port INT7 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT7# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT7 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT7# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 8
------------------------------------------------------------
[Port INT8 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT8# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT8 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT8# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 9
------------------------------------------------------------
[Port INT9 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT9# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT9 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT9# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 10
------------------------------------------------------------
[Port INT10 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT10# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT10 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT10# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 11
------------------------------------------------------------
[Port INT11 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT11# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT11 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT11# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 12
------------------------------------------------------------
[Port INT12 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT12# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT12 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT12# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 13
------------------------------------------------------------
[Port INT13 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT13# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT13 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT13# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# port 14
------------------------------------------------------------
[Port INT14 Menu]
gig - Gig Phy Menu
aclqos - Acl/Qos Configuration Menu
8021ppri - Set default 802.1p priority
pvid - Set default port VLAN id
name - Set port name
dscpmrk - Enable/disable DSCP remarking for port
learn - Enable/disable fdb Learning for port
tag - Enable/disable VLAN tagging for port
tagpvid - Enable/disable tagging on pvid
fastfwd - Enable/disable Port Fast Forwarding mode
floodblk - Enable/disable Port flood blocking
ena - Enable port
dis - disable port
cur - display current port configuration

>> Port INT14# tag d
Current VLAN tag support: enabled
New VLAN tag support: disabled
Port INT14 will be removed from all VLANs except its PVID.
Confirm removing this port from all VLANs [y/n]: y
TAG flag reset

>> Port INT14# apply
------------------------------------------------------------------
Apply complete; don't forget to "save" updated configuration.

>>
Jan 2 8:50:23 170.120.116.224 INFO mgmt: new configuration applied
Port INT14# save
Request will first copy the FLASH "active" config to "backup",
then overlay FLASH "active" with new config.
Confirm saving to FLASH [y/n]: y
New config successfully saved to FLASH.
Switch is currently set to use factory default config block on next boot.

Jan 2 8:50:39 170.120.116.224 INFO mgmt: new configuration saved from AOS
Confirm change that to the active config block [y/n]: y
Next boot will use active config block.

>>
Jan 2 8:50:47 170.120.116.224 NOTICE mgmt: boot config block changed
Port INT14# cd ..
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# cd ..
------------------------------------------------------------
[Main Menu]
info - information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command,always available]

>> Main# info
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# port
Alias Port Tag Fast Lrn Fld PVID NAME VLAN(s)
----- ---- --- ---- --- ---- -------------- -------------------------------
INT1 1 n n e e 1 INT1 1
INT2 2 n n e e 1 INT2 1
INT3 3 n n e e 1 INT3 1
INT4 4 n n e e 1 INT4 1
INT5 5 n n e e 1 INT5 1
INT6 6 n n e e 1 INT6 1
INT7 7 n n e e 1 INT7 1
INT8 8 n n e e 1 INT8 1
INT9 9 n n e e 1 INT9 1
INT10 10 n n e e 1 INT10 1
INT11 11 n n e e 1 INT11 1
INT12 12 n n e e 1 INT12 1
INT13 13 n n e e 1 INT13 1
INT14 14 n n e e 1 INT14 1
MGT1 15 y n e e 4095*MGT1 4095
MGT2 16 y n e e 4095*MGT2 4095
EXT1 17 n n e e 1 EXT1 1
EXT2 18 n n e e 1 EXT2 1
EXT3 19 n n e e 1 EXT3 1
EXT4 20 n n e e 1 EXT4 1
EXT5 21 n n e e 1 EXT5 1
EXT6 22 n n e e 1 EXT6 1
EXT7 23 n n e e 1 EXT7 1
EXT8 24 n n e e 1 EXT8 1
EXT9 25 n n e e 1 EXT9 1
* = PVID is tagged.

>> information# cd /
------------------------------------------------------------
[Main Menu]
info - information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command,always available]

>> Main#
Jan 2 8:56:08 170.120.116.224 ALERT stg: Port EXT2,putting port into blocking state


>> Main# cfg
------------------------------------------------------------
[Configuration Menu]
sys - System-wide Parameter Menu
port - Port Menu
pmirr - Port Mirroring Menu
l2 - Layer 2 Menu
l3 - Layer 3 Menu
qos - QOS Menu
acl - Access Control List Menu
setup - Step by step configuration set up
dump - Dump current configuration to script file
ptcfg - Backup current configuration to FTP/TFTP server
gtcfg - Restore current configuration from FTP/TFTP server
cur - display current configuration

>> Configuration# l2
------------------------------------------------------------
[Layer 2 Menu]
8021x - 802.1x Menu
mrst - Multiple Spanning Tree/Rapid Spanning Tree Menu
stg - Spanning Tree Menu
fdb - fdb Menu
trunk - Trunk Group Menu
thash - IP Trunk Hash Menu
lacp - Link Aggregation Control Protocol Menu
failovr - Failover Menu
vlan - VLAN Menu
pvstcomp - Enable/disable PVST+ compatibility mode
bpduGrd - Enable/disable BPDU Guard
macnotif - Enable/disable MAC address notification
upfast - Enable/disable Uplink Fast
update - UplinkFast station update rate
cur - display current layer 2 parameters

>> Layer 2# trunk/
Enter trunk group number: (1-16) 1
------------------------------------------------------------
[Trunk group 1 Menu]
add - Add port to trunk group
rem - Remove port from trunk group
ena - Enable trunk group
dis - disable trunk group
del - Delete trunk group
cur - display current Trunk Group configuration

>> Trunk group 1# add
Enter port (INT1-EXT9): ext1
Port EXT1 added.
Reminder: Trunk 1 needs to be enabled.

>> Trunk group 1# add ext2
Port EXT2 added.
Reminder: Trunk 1 needs to be enabled.

>> Trunk group 1# apply
------------------------------------------------------------------
Apply complete; don't forget to "save" updated configuration.

>>
Jan 2 8:57:46 170.120.116.224 INFO mgmt: new configuration applied
Trunk group 1# cd /
------------------------------------------------------------
[Main Menu]
info - information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command,always available]

>> Main# info
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# dump
------------------------------------------------------------------

upfast disabled,update 40

BPDU Guard disabled

Pvst+ compatibility mode enabled

------------------------------------------------------------------
Spanning Tree Group 1: On (STP/PVST+)
VLANs: 1

Current Root: Path-Cost Port Hello MaxAge FwdDel
ffff 34:40:b5:60:c5:00 2 EXT1 2 20 15

Parameters: Priority Hello MaxAge FwdDel Aging
65535 2 20 15 300

Port Priority Cost FastFwd State Designated Bridge Des Port
---- -------- ---- -------- ---------- --------------------- --------
INT1 0 0 n FORWARDING *
INT2 0 0 n FORWARDING *
INT3 0 0 n FORWARDING *
INT4 0 0 n FORWARDING *
INT5 0 0 n FORWARDING *
INT6 0 0 n FORWARDING *
INT7 0 0 n FORWARDING *
INT8 0 0 n FORWARDING *
INT9 0 0 n FORWARDING *
INT10 0 0 n FORWARDING *
INT11 0 0 n FORWARDING *
INT12 0 0 n FORWARDING *
INT13 0 0 n FORWARDING *
INT14 0 0 n FORWARDING *
EXT1 128 2 n FORWARDING ffff-34:40:b5:60:c5:00 8012
EXT2 128 2 n BLOCKING ffff-34:40:b5:6f:f4:00 8011
EXT3 128 2 n disABLED
EXT4 128 0! n disABLED
EXT5 128 0! n disABLED
EXT6 128 0! n disABLED
EXT7 128 0! n disABLED
EXT8 128 0! n disABLED
EXT9 128 0! n disABLED
* = STP turned off for this port.
! = Automatic path cost.

------------------------------------------------------------------
Spanning Tree Group 128: On (STP/PVST+)
VLANs: 4095

Current Root: Path-Cost Port Hello MaxAge FwdDel
ffff 34:40:b5:70:62:00 0 2 20 15

Parameters: Priority Hello MaxAge FwdDel Aging
65535 2 20 15 300

Port Priority Cost FastFwd State Designated Bridge Des Port
---- -------- ---- -------- ---------- --------------------- --------
MGT1 0 0 n FORWARDING *
MGT2 0 0 n disABLED *
* = STP turned off for this port.

VLAN Name Status Ports
---- -------------------------------- ------ -------------------------
1 Default VLAN ena INT1-INT14 EXT1-EXT9
4095 Mgmt VLAN ena MGT1 MGT2

Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


Current priority to COS queue information:
Priority COSq Weight
-------- ---- ------
0 0 1
1 0 1
2 0 1
3 0 1
4 1 2
5 1 2
6 1 2
7 1 2

Current port priority information:
Port Priority COSq Weight
----- -------- ---- ------
INT1 0 0 1
INT2 0 0 1
INT3 0 0 1
INT4 0 0 1
INT5 0 0 1
INT6 0 0 1
INT7 0 0 1
INT8 0 0 1
INT9 0 0 1
INT10 0 0 1
INT11 0 0 1
INT12 0 0 1
INT13 0 0 1
INT14 0 0 1
MGT1 0 0 1
MGT2 0 0 1
EXT1 0 0 1
EXT2 0 0 1
EXT3 0 0 1
EXT4 0 0 1
EXT5 0 0 1
EXT6 0 0 1
EXT7 0 0 1
EXT8 0 0 1
EXT9 0 0 1

Forwarding database information:
MAC address VLAN Port Trnk State Permanent
----------------- ---- ---- ---- ----- ---------
00:25:90:61:17:0f 1 EXT1 FWD
00:25:90:61:c8:75 1 EXT1 FWD
00:25:90:61:ca:85 1 EXT1 FWD
34:40:b5:60:c5:00 1 EXT1 FWD
34:40:b5:64:85:00 1 EXT1 FWD
5c:f3:fc:ef:5b:c7 4095 MGT1 FWD

802.1x Operational Info:
------------------------------------------------------------------
System capability : Authenticator
System status : disabled
Protocol version : 1
Guest VLAN status : disabled
Guest VLAN : none
Authenticator Backend
Port Auth Mode Auth Status PAE State Auth State
----- ------------ ------------ -------------- ----------
INT1 force-auth unauthorized initialize initialize
INT2 force-auth unauthorized initialize initialize
INT3 force-auth unauthorized initialize initialize
INT4 force-auth unauthorized initialize initialize
INT5 force-auth unauthorized initialize initialize
INT6 force-auth unauthorized initialize initialize
INT7 force-auth unauthorized initialize initialize
INT8 force-auth unauthorized initialize initialize
INT9 force-auth unauthorized initialize initialize
INT10 force-auth unauthorized initialize initialize
INT11 force-auth unauthorized initialize initialize
INT12 force-auth unauthorized initialize initialize
INT13 force-auth unauthorized initialize initialize
INT14 force-auth unauthorized initialize initialize
EXT1 force-auth unauthorized initialize initialize
EXT2 force-auth unauthorized initialize initialize
*EXT3 force-auth unauthorized initialize initialize
*EXT4 force-auth unauthorized initialize initialize
*EXT5 force-auth unauthorized initialize initialize
*EXT6 force-auth unauthorized initialize initialize
*EXT7 force-auth unauthorized initialize initialize
*EXT8 force-auth unauthorized initialize initialize
*EXT9 force-auth unauthorized initialize initialize
------------------------------------------------------------------
* - Port down or disabled


STP uplink fast mode : disabled


>> Layer 2# cd ..
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2# cd ..
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2# cd ..
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information#

>> information#

>> information#

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2# cd /
------------------------------------------------------------
[Main Menu]
info - information Menu
stats - Statistics Menu
cfg - Configuration Menu
oper - Operations Command Menu
boot - Boot Options Menu
maint - Maintenance Menu
diff - Show pending config changes [global command]
apply - Apply pending config changes [global command]
save - Save updated config to FLASH [global command]
revert - Revert pending or applied changes [global command]
exit - Exit [global command,always available]

>> Main# info
------------------------------------------------------------
[information Menu]
sys - System information Menu
l2 - Layer 2 information Menu
l3 - Layer 3 information Menu
qos - QoS Menu
acl - Show ACL information
link - Show link status
port - Show port information
transcvr - Show Port Transceiver status
dump - Dump all information

>> information# l2
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# lacp
------------------------------------------------------------
[LACP Menu]
aggr - Show LACP aggregator information for the port
port - Show LACP port information
dump - Show all LACP ports information

>> LACP# dump
port lacp adminkey operkey selected prio attached trunk
aggr
----------------------------------------------------------------------------
INT1 off 1 1 no 32768 -- --
INT2 off 2 2 no 32768 -- --
INT3 off 3 3 no 32768 -- --
INT4 off 4 4 no 32768 -- --
INT5 off 5 5 no 32768 -- --
INT6 off 6 6 no 32768 -- --
INT7 off 7 7 no 32768 -- --
INT8 off 8 8 no 32768 -- --
INT9 off 9 9 no 32768 -- --
INT10 off 10 10 no 32768 -- --
INT11 off 11 11 no 32768 -- --
INT12 off 12 12 no 32768 -- --
INT13 off 13 13 no 32768 -- --
INT14 off 14 14 no 32768 -- --
EXT1 off 17 17 no 32768 -- --
EXT2 off 18 18 no 32768 -- --
EXT3 off 19 19 no 32768 -- --
EXT4 off 20 20 no 32768 -- --
EXT5 off 21 21 no 32768 -- --
EXT6 off 22 22 no 32768 -- --
EXT7 off 23 23 no 32768 -- --
EXT8 off 24 24 no 32768 -- --
EXT9 off 25 25 no 32768 -- --

>> LACP# cd ..
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2# apply
No apply needed.

>> Layer 2#
Jan 2 9:11:36 170.120.116.224 ALERT stg: Port EXT1,putting port into blocking state

Jan 2 9:11:36 170.120.116.224 ALERT stg: Port EXT2,putting port into blocking state

Jan 2 9:11:36 170.120.116.224 ALERT stg: Port EXT1,putting port into blocking state

Jan 2 9:12:03 170.120.116.224 ALERT stg: STG 1,topology change detected

Jan 2 9:12:03 170.120.116.224 ALERT stg: Port EXT2,putting port into blocking state


>> Layer 2#

>> Layer 2#

>> Layer 2#

>> Layer 2#

>> Layer 2#

>> Layer 2# ls
------------------------------------------------------------
[Layer 2 Menu]
fdb - Forwarding Database information Menu
lacp - Link Aggregation Control Protocol Menu
8021x - Show 802.1x information
stg - Show STP information
cist - Show CIST information
trunk - Show Trunk Group information
vlan - Show VLAN information
dump - Dump all layer 2 information

>> Layer 2# trunk
Trunk group 1: disabled
Reminder: Trunk group 1 needs to be enabled.
Protocol - Static
port state:
EXT1: STG 1 forwarding
EXT2: STG 1 BLOCKING


>> Layer 2#
Jan 2 9:13:19 170.120.116.224 ALERT stg: STG 1,topology change detected

我上面出现ext2 blocking 是因为我配置了trunk 没有enable,所以出现这个情况

database群:119224876(db china联盟) 虚拟化方面群:229845401(虚拟化-云计算-物联网)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图:提供一种方法顺序访问一个聚合对象中的每个元素,而又不想暴露该对象的内部表示。应用:STL标准库迭代器实现、Java集合类型迭代器等模式结构:心得:迭代器模式的目的是在不获知集合对象内部细节的同时能对集合元素进行遍历操作
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,常见的IO模型有四种:(1)同步阻塞IO(BlockingIO):即传统的IO模型。(2)同步非阻塞IO(Non-blockingIO):默认创建的socket都是阻塞的,非阻塞IO要求socket被设置为NONBLOCK。注意这里所说的N
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定义一系列算法,把他们封装起来,并且使他们可以相互替换,使算法可以独立于使用它的客户而变化。应用:排序的比较方法、封装针对类的不同的算法、消除条件判断、寄存器分配算法等。模式结构:心得:对对象(Context)的处理操作可
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个作用于某对象结构中的各元素的操作,它使你在不改变各元素的类的前提下定义作用于这些元素的新操作。应用:作用于编译器语法树的语义分析算法。模式结构:心得:访问者模式是要解决对对象添加新的操作和功能时候,如何尽可能不修改对象的类的一种方
命令模式(Command)命令模式(Command)[Action/Transaction]意图:将一个请求封装为一个对象,从而可用不同的请求对客户参数化。对请求排队或记录请求日志,以及支持可撤消的操作。应用:用户操作日志、撤销恢复操作。模式结构:心得:命令对象的抽象接口(Command)提供的两个
生成器模式(Builder)生成器模式(Builder)意图:将一个对象的构建和它的表示分离,使得同样的构建过程可以创建不同的表示。 应用:编译器词法分析器指导生成抽象语法树、构造迷宫等。模式结构:心得:和工厂模式不同的是,Builder模式需要详细的指导产品的生产。指导者(Director)使用C
设计模式学习心得《设计模式:可复用面向对象软件的基础》一书以更贴近读者思维的角度描述了GOF的23个设计模式。按照书中介绍的每个设计模式的内容,结合网上搜集的资料,我将对设计模式的学习心得总结出来。网络上关于设计模式的资料和文章汗牛充栋,有些文章对设计模式介绍生动形象。但是我相信“一千个读者,一千个
工厂方法模式(Factory Method)工厂方法模式(Factory Method)[Virtual Constructor]意图:定义一个用于创建对象的接口,让子类决定实例化哪一个类,使一个类的实力化延迟到子类。应用:多文档应用管理不同类型的文档。模式结构:心得:面对同一继承体系(Produc
单例模式(Singleton)单例模式(Singleton)意图:保证一个类只有一个实例,并提供一个访问它的全局访问点。应用:Session或者控件的唯一示例等。模式结构:心得:单例模式应该是设计模式中最简单的结构了,它的目的很简单,就是保证自身的实例只有一份。实现这种目的的方式有很多,在Java中
装饰者模式(Decorator)装饰者模式(Decorator)[Wrapper]意图:动态的给一个对象添加一些额外的职责,就增加功能来说,比生成子类更为灵活。应用:给GUI组件添加功能等。模式结构:心得:装饰器(Decorator)和被装饰的对象(ConcreteComponent)拥有统一的接口
抽象工厂模式(Abstract Factory)抽象工厂模式(Abstract Factory)[Kit]意图:提供一个创建一系列相关或相互依赖对象的接口,而无须指定他们具体的类。应用:用户界面工具包。模式结构:心得:工厂方法把生产产品的方式封装起来了,但是一个工厂只能生产一类对象,当一个工厂需要生
桥接模式(Bridge)桥接模式(Bridge)[Handle/Body]意图:将抽象部分与它的实现部分分离,使他们都可以独立的变化。应用:不同系统平台的Windows界面。模式结构:心得:用户所见类体系结构(Window派生)提供了一系列用户的高层操作的接口,但是这些接口的实现是基于具体的底层实现
适配器模式(Adapter)适配器模式(Adapter)[Wrapper]意图:将类的一个接口转换成用户希望的另一个接口,使得原本由于接口不兼容而不能一起工作的类可以一起工作。应用:将图形类接口适配到用户界面组件类中。模式结构:心得:适配器模式一般应用在具有相似接口可复用的条件下。目标接口(Targ
组合模式(Composition)组合模式(Composition)意图:将对象组合成树形结构以表示“部分-整体”的层次结构,使得用户对单个对象和组合对象的使用具有一致性。应用:组合图形、文件目录、GUI容器等。模式结构:心得: 用户(Client)通过抽象类(Component)提供的公用接口统一
原型模式(Prototype)原型模式(Prototype)意图:用原型实例制定创建对象的种类,并且通过拷贝这些原型创建新的对象。应用:Java/C#中的Clonable和IClonable接口等。模式结构:心得:原型模式本质上就是对象的拷贝,使用对象拷贝代替对象创建的原因有很多。比如对象的初始化构
什么是设计模式一套被反复使用、多数人知晓的、经过分类编目的、代码 设计经验 的总结;使用设计模式是为了 可重用 代码、让代码 更容易 被他人理解、保证代码 可靠性;设计模式使代码编制  真正工程化;设计模式使软件工程的 基石脉络, 如同大厦的结构一样;并不直接用来完成代码的编写,而是 描述 在各种不同情况下,要怎么解决问题的一种方案;能使不稳定依赖于相对稳定、具体依赖于相对抽象,避免引
单一职责原则定义(Single Responsibility Principle,SRP)一个对象应该只包含 单一的职责,并且该职责被完整地封装在一个类中。Every  Object should have  a single responsibility, and that responsibility should be entirely encapsulated by t
动态代理和CGLib代理分不清吗,看看这篇文章,写的非常好,强烈推荐。原文截图*************************************************************************************************************************原文文本************
适配器模式将一个类的接口转换成客户期望的另一个接口,使得原本接口不兼容的类可以相互合作。
策略模式定义了一系列算法族,并封装在类中,它们之间可以互相替换,此模式让算法的变化独立于使用算法的客户。