一、搭建拓扑图,并且规划好IP地址
二、根据题目要求进行合理搭配
1、内网已经按照172.16.10.0/16分配
3、VRRP/STP/VLAN/DHCP均可使用
(1)STP
SW1
#
stp instance 1 root primary
stp instance 2 root secondary
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
#
drop-profile default
#
SW2
#
stp instance 1 root secondary
stp instance 2 root primary
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
dhcp enable
#
diffserv domain default
#
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
#
drop-profile default
SW3
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
#
drop-profile default
#
SW4
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration
#
drop-profile default
(2)VRRP
SW1
#
interface Vlanif1
ip address 172.16.2.253 255.255.255.0
vrrp vrid 1 virtual-ip 172.16.2.250
vrrp vrid 1 priority 110
vrrp vrid 1 track interface GigabitEthernet0/0/3 reduced 20
#
interface Vlanif2
ip address 172.16.3.253 255.255.255.0
vrrp vrid 1 virtual-ip 172.16.3.250
dhcp select global
#
SW2
#
interface Vlanif1
ip address 172.16.2.254 255.255.255.0
vrrp vrid 1 virtual-ip 172.16.2.250
#
interface Vlanif2
ip address 172.16.3.254 255.255.255.0
vrrp vrid 1 virtual-ip 172.16.3.250
vrrp vrid 1 priority 110
vrrp vrid 1 track interface GigabitEthernet0/0/3
dhcp select global
#
(3)VLAN和TRUNK干道
TRUNK干道允许VLAN1和VLAN2通过
SW1
#
interface Vlanif9
ip address 172.16.0.2 255.255.255.252
#
interface MEth0/0/1
#
interface Eth-Trunk0
port link-type trunk
port trunk allow-pass vlan 2
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/2
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 9
stp edged-port enable
#
SW2
#
interface Vlanif9
ip address 172.16.0.6 255.255.255.252
#
interface MEth0/0/1
#
interface Eth-Trunk0
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/2
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 9
stp edged-port enable
#
SW3
#
interface Ethernet0/0/1
port link-type access
port default vlan 2
stp edged-port enable
#
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/2
port hybrid tagged vlan 2
#
SW4
#
interface Ethernet0/0/2
port link-type access
port default vlan 2
stp edged-port enable
#
#
interface GigabitEthernet0/0/1
port hybrid tagged vlan 2
#
interface GigabitEthernet0/0/2
port hybrid tagged vlan 2
#
(4)DHCP
SW1
#
ip pool v1
gateway-list 172.16.2.250
network 172.16.2.0 mask 255.255.255.0
dns-list 114.114.114.114
#
ip pool v2
gateway-list 172.16.3.250
network 172.16.3.0 mask 255.255.255.0
dns-list 114.114.114.114
#
最后在端口去开启DHCP服务
dhcp select global
SW2
#
ip pool v1
gateway-list 172.16.2.250
network 172.16.2.0 mask 255.255.255.0
dns-list 114.114.114.114
#
ip pool v2
gateway-list 172.16.3.250
network 172.16.3.0 mask 255.255.255.0
dns-list 114.114.114.114
#
最后在端口去开启DHCP服务
dhcp select global