题目:
思路:
首先划分IP地址,根据题目要求将172.16.0.0/16合理分配出来,即将分为172.16.1.0—172.16.1.127和172.16.1.129—172.16.1.254两个网段之间的ip地址。为了避免网络冗余,会沉默其中的一些端口,其中除了G0/0/24端口打开,Vlanif 1和Vlanif 99和Eth-Trunk 0打开,其余端口都会沉默,防止路由表网络冗余,使得网络能够更加优化,沉默端口是比较平常的优化网络的一种方式。
其配置顺序:
CHANNEL VLAN TRUNK STP SVI VRRP DHCP
配置:
网络部署思路:
1、拓扑设计 --ip地址规划
2、配置
0)拓扑搭建 – 交换部分技术
1)底层–所有节点拥有合法的ip地址
2)路由
3)策略
4)测试
5)排错
3、维护
4、升级
ISP:
[isp]int lo0
[isp-LoopBack0]ip add 1.1.1.1 24
[isp-LoopBack0]int g0/0/0
[isp-GigabitEthernet0/0/0]ip add 12.1.1.1 24
R1:
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 12.1.1.1 24
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 172.16.0.1 30
[r1-GigabitEthernet0/0/0]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 172.16.0.5 30
[r1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.1
[r1-ospf-1]default-route-advertise
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r1-acl-basic-2000]int g0/0/1
[r1-GigabitEthernet0/0/1]nat outbound 2000
LSW1:
[sw1]interface Eth-Trunk 0
[sw1]int g0/0/22
[sw1-GigabitEthernet0/0/22]eth-trunk 0
[sw1-GigabitEthernet0/0/22]int g0/0/23
[sw1-GigabitEthernet0/0/23]eth-trunk 0
[sw1]vlan 2
[sw1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 Gi
gabitEthernet 0/0/22 to GigabitEthernet 0/0/23
[sw1]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 Eth
-Trunk 0
[sw1-port-group]port link-type trunk
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/2]port link-type trunk
[sw1-Eth-Trunk0]port link-type trunk
[sw1-port-group]port trunk allow-pass vlan 2
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
[sw1-Eth-Trunk0]port trunk allow-pass vlan 2
[sw1]stp enable
[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]stp instance 1 root primary
[sw1]stp instance 2 root secondary
[sw1]int vlan 1
[sw1-Vlanif1]ip add 172.16.1.1 25
[sw1-Vlanif1]int vlan 2
[sw1-Vlanif2]ip add 172.16.1.129 25
[sw1]int vlan 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 interface GigabitEthernet 0/0/24 reduced 10
[sw1-Vlanif1]int vlan 2
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 172.16.1.254
[sw1]dhcp enable
[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 v2
[sw1-ip-pool-v2]network 172.16.1.128 ma 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]int vlan 1
[sw1-Vlanif1]dhcp select global
[sw1-Vlanif1]int vlan 2
[sw1-Vlanif2]dhcp select global
[sw1]vlan 99
[sw1]int g0/0/24
[sw1-GigabitEthernet0/0/24]port link-type access
[sw1-GigabitEthernet0/0/24]port default vlan 99
[sw1-GigabitEthernet0/0/24]int vlan 99
[sw1-Vlanif99]ip add 172.16.0.2 30
[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
[sw1-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
[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
LSW2:
[sw2]interface Eth-Trunk 0
[sw2-Eth-Trunk0]int g0/0/22
[sw2-GigabitEthernet0/0/22]eth-trunk 0
[sw2-GigabitEthernet0/0/22]int g0/0/23
[sw2-GigabitEthernet0/0/23]eth-trunk 0
[sw2]vlan 2
[sw2]port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/2 Eth-
Trunk 0
[sw2-port-group]port link-type trunk
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/2]port link-type trunk
[sw2-Eth-Trunk0]port link-type trunk
[sw2-port-group]port trunk allow-pass vlan 2
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
[sw2-Eth-Trunk0]port trunk allow-pass vlan 2
[sw2]stp enable
[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]stp instance 1 root secondary
[sw2]stp instance 2 root primary
[sw2]int vlan 1
[sw2-Vlanif1]ip add 172.16.1.2 25
[sw2]int vlan 2
[sw2-Vlanif2]ip add 172.16.1.130 25
[sw2]int vlan 1
[sw2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.126
[sw2-Vlanif1]int vlan 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 GigabitEthernet 0/0/24
[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 vlan 1
[sw2-Vlanif1]dhcp select global
[sw2-Vlanif1]int vlan 2
[sw2-Vlanif2]dhcp select global
[sw2]vlan 99
[sw2-vlan99]int vlan 99
[sw2-Vlanif99]ip add 172.16.0.6 30
[sw2-Vlanif99]int g0/0/24
[sw2-GigabitEthernet0/0/24]p l a
[sw2-GigabitEthernet0/0/24]p d v 99
[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.6 0.0.0.0
[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
[sw2-ospf-1-area-0.0.0.1]abr-summary 172.16.1.0 255.255.255.0
[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 99
LSW3:
[sw3]vlan 2
[sw3]int e0/0/2
[sw3-Ethernet0/0/2]port link-type access
[sw3-Ethernet0/0/2]port default vlan 2
[sw3-Ethernet0/0/2]int g0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[sw3-GigabitEthernet0/0/1]int g0/0/2
[sw3-GigabitEthernet0/0/2]port link-type trunk
[sw3-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
[sw3]stp edged-port
[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]active region-configuration
[sw3]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/2
[sw3-port-group]stp edged-port enable
[sw3-Ethernet0/0/1]stp edged-port enable
[sw3-Ethernet0/0/2]stp edged-port enable
[sw3]int e0/0/3
[sw3-Ethernet0/0/3]stp instance 1 port priority 112
LSW4:
[sw4]vlan 2
[sw4-vlan2]int e0/0/2
[sw4-Ethernet0/0/2]p l a
[sw4-Ethernet0/0/2]p d v 2
[sw4]port-group group-member g 0/0/1 to g 0/0/2
[sw4-port-group]port link-type trunk
[sw4-GigabitEthernet0/0/1]port link-type trunk
[sw4-GigabitEthernet0/0/2]port link-type trunk
[sw4-port-group]port trunk allow-pass vlan 2
[sw4-GigabitEthernet0/0/1]port trunk allow-pass vlan 2
[sw4-GigabitEthernet0/0/2]port trunk allow-pass vlan 2
[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]active region-configuration
[sw4]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/2
[sw4-port-group]stp edged-port enable
[sw4-Ethernet0/0/1]stp edged-port enable
[sw4-Ethernet0/0/2]stp edged-port enable
验证: