HCIP——网络三层架构实验

网络三层架构实验

HCIP——网络三层架构实验_第1张图片
一、搭建拓扑图,并且规划好IP地址
HCIP——网络三层架构实验_第2张图片
二、根据题目要求进行合理搭配
1、内网已经按照172.16.10.0/16分配
HCIP——网络三层架构实验_第3张图片
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

二、检验

HCIP——网络三层架构实验_第4张图片
HCIP——网络三层架构实验_第5张图片
HCIP——网络三层架构实验_第6张图片
HCIP——网络三层架构实验_第7张图片
所有PC都已经获得IP,并且互相PIng通
HCIP——网络三层架构实验_第8张图片

三、SW1和SW2互相备份

HCIP——网络三层架构实验_第9张图片
HCIP——网络三层架构实验_第10张图片
现在用PC1–ping–ISP客户端
HCIP——网络三层架构实验_第11张图片
这里看到已经通了

接下来将SW1关闭,在进行同样的操作
HCIP——网络三层架构实验_第12张图片
可以看到还是互通状态,说明SW1和SW2互为备份成功

你可能感兴趣的:(HCIP——网络三层架构实验)