do show spanning-tree (do sh sp)
do show int trunk (do sh int tr)
no ip domain lo
line con 0
logg syn
exec-t 0 0
// Stp mode
SwitchX(config)#do show spanning-tree
SwitchX(config)#spanning-tree mode rapid-pvst = sp mo r
sw(config)#spanning-tree vlan 1 root primary
sw(config)#do show spanning-tree vlan 1
Sw(config)#int vlan 1
Sw(config-if)#ip add 1.1.1.1 255.255.255.0
Sw(config-if)#no shutdown
// Configures BPDU guard and PortFast on interface FastEthernet0/1
sw(config)#int fa0/1
sw(config-if)#switchport access 1
Sw(config-if)#spanning-tree portfast = spa p
Sw(config-if)#spanning-tree bpduguard enable = spa bp en
// Enables PortFast on all nontrunking interfaces and enables BPDU guard globally for allPortFast-
enabled ports
Sw(config)#spanning-tree portfast edge bpduguard default ??
Sw(config)#spanning-tree portfast default =sp p de
// Turn off DTP after trunking
Sw(config)#int fa0/23
Sw(config-if)#switchport mode trunk
Sw(config-if)#switchport nonegotiate
//Assign dynamic trunk port
Sw(config)#int fa0/24
Sw(config-if)#switchport mode dynamic desirable
Sw(config)#do show int trunk
//config vtp server
Sw(config)#vtp domain CCNA
Sw(config)#vtp version 2
Sw(config)#vtp password ccna
Sw(config)#vtp mode server
Sw(config)#do sh vtp sta
//config vtp client
C1(config)#vtp domain CCNA
C1(config)#vtp password ccna
//三层交换机 dhcp
dhcp(config)#ip dhcp pool aaa
dhcp(config)#network 1.1.1.0 255.255.255.0
dhcp(config)#default-router 1.1.1.1
dhcp(config)#int vlan 1
dhcp(config-if)#ip add 1.1.1.1 255.255.255.0 //关联 dhcp pool aaa的defalut-router address
dhcp(config)#ip routing
//cisco router ARP timeout on e0/0
R1(config)#int e0/0
R1(config-if)arp timeout 3600
R1(config)#do sh int e0/0
网友评论