题目要求如下:
构建拓扑图:
1.IP配置
ISP:
R1:
SW1:
SW2:
2、 OSPF协议内网通
R1:
ospf 1 router-id 1.1.1.1
default-route-advertise always
area 0.0.0.0
network 172.168.0.1 0.0.0.0
network 172.168.0.5 0.0.0.0
SW1:
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 172.168.0.2 0.0.0.0
network 172.168.1.1 0.0.0.0
network 172.168.2.1 0.0.0.0
SW2:
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 172.168.0.6 0.0.0.0
network 172.168.1.2 0.0.0.0
network 172.168.2.2 0.0.0.0
3、STP
SW1:
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
stp instance 1 root primary
stp instance 2 root secondary
SW2:
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
stp instance 1 root secondary
stp instance 2 root primary
SW3:
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
SW4:
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
4、VRRP
SW1:
interface Vlanif1
vrrp vrid 1 virtual-ip 172.168.1.99
vrrp vrid 1 priority 120
interface Vlanif2
vrrp vrid 2 virtual-ip 172.168.2.99
SW2:
interface Vlanif2
vrrp vrid 2 virtual-ip 172.168.2.99
vrrp vrid 2 priority 120
interface Vlanif1
vrrp vrid 1 virtual-ip 172.168.1.99
5、链路聚合
SW2:
interface Eth-Trunk0
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/1
eth-trunk 0
interface Ethernet0/0/4
eth-trunk 0
SW1:
interface Eth-Trunk0
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/1
eth-trunk 0
interface Ethernet0/0/4
eth-trunk 0
6、DHCP自动获取IP
SW1:
dhcp enable
#
ip pool v1
gateway-list 172.168.1.99
network 172.168.1.0 mask 255.255.255.0
dns-list 8.8.8.8
#
ip pool v2
gateway-list 172.168.2.99
network 172.168.2.0 mask 255.255.255.0
dns-list 8.8.8.8
#
interface Vlanif1
dhcp select global
#
interface Vlanif2
dhcp select global
#
SW2:
dhcp enable
#
ip pool v1
gateway-list 172.168.1.99
network 172.168.1.0 mask 255.255.255.0
dns-list 8.8.8.8
#
ip pool v2
gateway-list 172.168.2.99
network 172.168.2.0 mask 255.255.255.0
dns-list 8.8.8.8
interface Vlanif1
#
dhcp select global
#
interface Vlanif2
dhcp select global
7、NAT配置
R1:
acl number 2000
rule 5 permit source 172.16.0.0 0.0.255.255
interface GigabitEthernet0/0/0
nat outbound 2000
8、测试(R1为例)
1、上公网
2、PC互PING
3、断掉某一三层交换机后继续ping通(ping 1.1.1.1)