交换配置顺序:
channel vlan Trunk stp svi vrrp dhcp
绑定channel
[sw1]interface e
[sw1]interface Eth-Trunk 0
[sw1-Eth-Trunk0]int g 0/0/22
[sw1-GigabitEthernet0/0/22]eth-trunk 0
[sw1-GigabitEthernet0/0/23]eth-trunk 0
[sw2]interface Eth-Trunk 0
[sw2]int g 0/0/22
[sw2-GigabitEthernet0/0/22]et
[sw2-GigabitEthernet0/0/22]eth-trunk 0
[sw2]int g 0/0/23
[sw2-GigabitEthernet0/0/23]eth-trunk 0
vlan Trunk
[sw1]v 2
[sw1-vlan2]q
[sw1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/02 Eth-Trunk 0
[sw1-port-group]p l t
[sw1-port-group]p t a v 2
[sw2]v 2
[sw2-vlan2]q
[sw2]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/02 Eth-Trunk 0
[sw2-port-group]p l t
[sw2-port-group]p t a v 2[sw3]v 2
[sw3-vlan2]q
[sw3]int e 0/0/1
[sw3-Ethernet0/0/1]p l a
[sw3-Ethernet0/0/1]p d v 2
[sw3-Ethernet0/0/1]int g 0/0/1
[sw3-GigabitEthernet0/0/1]p l t
[sw3-GigabitEthernet0/0/1]p t a v 2
[sw3-GigabitEthernet0/0/1]int g 0/0/2
[sw3-GigabitEthernet0/0/2]p l t
[sw3-GigabitEthernet0/0/2]p t a v 2[sw4]v 2
[sw4]int e 0/0/2
[sw4-Ethernet0/0/2]p l a
[sw4-Ethernet0/0/2]p d v 2
[sw4-Ethernet0/0/2]q
[sw4]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2
[sw4-port-group]p l t
[sw4-port-group]p t a v 2
stp
[sw1]stp en
[sw1]stp region-configuration
[sw1-mst-region]region-name a
[sw1-mst-region]instance 1 vlan 1
[sw1-mst-region]instance 2 vlan 2
[sw1-mst-region]active region-configuration
[sw1-mst-region]q
[sw1]stp instance 1 root primary
[sw1]stp instance 2 root secondary[sw2]stp en
[sw2]stp region-configuration
[sw2-mst-region]region-name a
[sw2-mst-region]instance 1 vlan 1
[sw2-mst-region]instance 2 vlan 2
[sw2-mst-region]active region-configuration
[sw2-mst-region]q
[sw2]stp instance 1 root secondary
[sw2]stp instance 2 root primary[sw1]stp instance 0 root primary 始终把根放在汇聚层
[sw2]stp instance 0 root secondary[sw3]stp enable
[sw3]stp region-configuration
[sw3-mst-region]region-name a
[sw3-mst-region]instance 1 vlan 1
[sw3-mst-region]instance 2 vlan 2
[sw3-mst-region]q
[sw3]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/22
[sw3-port-group]stp edged-port enable 优化 交换机所有接口全部优化 若sw3的3号口接入ap,改优先级,防止出环后被堵
[sw3]int e 0/0/3
[sw3-Ethernet0/0/3]stp instance 0 port priority 16[sw4]stp enable
[sw4]stp region-configuration
[sw4-mst-region]region-name a
[sw4-mst-region]instance 1 vlan 1
[sw4-mst-region]instance 2 vlan 2
[sw4-mst-region]q
[sw4]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/22
[sw4-port-group]stp edged-port enablesvi
[sw1]int v1
[sw1-Vlanif1]ip address 172.16.1.1 25
[sw1-Vlanif1]int v 2
[sw1-Vlanif2]ip address 172.16.1.129 25[sw2]int v1
[sw2-Vlanif1]ip address 172.16.1.2 25
[sw2-Vlanif1]int v 2
[sw2-Vlanif2]ip address 172.16.1.130 25vrrp
[sw1]int v 1
[sw1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[sw1-Vlanif1]vrrp vrid 1 priority 105
[sw1-Vlanif1]vrrp vrid 1 track int g 0/0/24 redu 10
[sw1-Vlanif1]int v 2
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[sw2]int v 1
[sw2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[sw2-Vlanif1]int v 2
[sw2-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[sw2-Vlanif2]vrrp vrid 1 priority 105
[sw2-Vlanif2]vrrp vrid 1 track interface g 0/0/24 reduced 10dhcp
[sw1]dhcp en
[sw1]ip pool in1
[sw1-ip-pool-in1]network 172.16.1.0 mask 25
[sw1-ip-pool-in1]gateway-list 172.16.1.126
[sw1-ip-pool-in1]dns-list 114.114.114.114 8.8.8.8
[sw1-ip-pool-in1]q
[sw1]ip pool v2
[sw1-ip-pool-v2]network 172.16.1.128 mask 25
[sw1-ip-pool-v2]gateway-list 172.16.1.254
[sw1-ip-pool-v2]dns-list 114.114.114.114 8.8.8.8
[sw1-ip-pool-v2]q
[sw1]int v1
[sw1-Vlanif1]dhcp select global
[sw1-Vlanif1]int v 2
[sw1-Vlanif2]dhcp select global[sw2]dhcp enable
[sw2]ip pool in1
[sw2-ip-pool-in1] gateway-list 172.16.1.126
[sw2-ip-pool-in1] network 172.16.1.0 mask 255.255.255.128
[sw2-ip-pool-in1] dns-list 114.114.114.114 8.8.8.8
[sw2-ip-pool-in1]ip pool v2
[sw2-ip-pool-v2] gateway-list 172.16.1.254
[sw2-ip-pool-v2] network 172.16.1.128 mask 255.255.255.128
[sw2-ip-pool-v2] dns-list 114.114.114.114 8.8.8.8
[sw2]int v1
[sw2-Vlanif1]dhcp select global
[sw2-Vlanif1]int v 2
[sw2-Vlanif2]dhcp select global
路由:
[r2]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip address 172.16.0.1 30
[r2-GigabitEthernet0/0/1]int g 0/0/2
[r2-GigabitEthernet0/0/2]ip address 172.16.0.5 30
[sw1]v 99 因为模拟器的问题调完三层接口也不能配IP,所以把一个接口划分到vlan里面,用svi接口模拟此现象
[sw1-vlan99]q.
[sw1]int g 0/0/24
[sw1-GigabitEthernet0/0/24]p l a
[sw1-GigabitEthernet0/0/24]p d v 99
[sw1-GigabitEthernet0/0/24]int v 99
[sw1-Vlanif99]ip address 172.16.0.2 30[sw2]v 99
[sw2-vlan99]q
[sw2]int g 0/0/24
[sw2-GigabitEthernet0/0/24]p l a
[sw2-GigabitEthernet0/0/24]p d v 99
[sw2]int v 99
[sw2-Vlanif99]ip address 172.16.0.6 30路由
[r2]ospf 1 router-id 1.1.1.1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 172.16.0.5 0.0.0.0
[sw1]ospf 1 router-id 2.2.2.2
[sw1-ospf-1]area 0
[sw1-ospf-1-area-0.0.0.0]network 172.16.0.2 0.0.0.0
[sw1-ospf-1]area 1
[sw1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[sw1-ospf-1-area-0.0.0.1]network 172.16.1.129 0.0.0.0[sw2]ospf 1 router-id 3.3.3.3
[sw2-ospf-1]area 0
[sw2-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.0.0
[sw2-ospf-1-area-0.0.0.0]q
[sw2-ospf-1]area 1
[sw2-ospf-1-area-0.0.0.1]network 172.16.1.2 0.0.0.0
[sw2-ospf-1-area-0.0.0.1]network 172.16.1.130 0.0.0.0[sw1]ospf 1
[sw1-ospf-1]area 1
[sw1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0[sw2]ospf 1
[sw2-ospf-1]area 1
[sw2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0公网:
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip ad
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r1-GigabitEthernet0/0/0]int lo0
[r1-LoopBack0]ip address 1.1.1.1 24
沉默接口不发hello包
[sw1]ospf 1
[sw1-ospf-1]silent-interface all
[sw1-ospf-1]undo silent-interface GigabitEthernet 0/0/24
[sw1-ospf-1]undo silent-interface Eth-Trunk 0
[sw1-ospf-1]undo silent-interface Vlanif 1
[sw1-ospf-1]undo silent-interface Vlanif 99[sw2-ospf-1]silent-interface all
[sw2-ospf-1]undo silent-interface GigabitEthernet 0/0/24
[sw2-ospf-1]undo silent-interface Eth-Trunk 0
[sw2-ospf-1]undo silent-interface Vlanif 1
[sw2-ospf-1]undo silent-interface Vlanif 99r2上做easy ip
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 172.16.0.0 255.255.0.0
[r2-acl-basic-2000]q
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]nat outbound 2000汇总设备做空接口
[sw1]ip route-static 172.16.1.0 24 NULL 0
[sw2]ip route-static 172.16.1.0 24 NULL 0