三层架构实验

三层架构实验_第1张图片

 三层架构实验_第2张图片 

思路:先配三层交换机,绑通道再把汇聚层接口绑到trunk,再把二层交换机连接电脑的接口为access,向上汇聚层为trunk,然后开启stp,做根网桥冗余,sw1,sw2互为冗余,做网关冗余VRRP,再配置核心层的ip,三层交换机要在vlan中配ip,在交换机中配DHCP给PC分配ip
 

lsp

sys
int g0/0/0
ip a 12.1.1.2 24
int l0
ip a 8.8.8.8 24

核心层

int g 0/0/0
ip a 172.16.0.1 30
int g 0/0/1
ip a 172.16.0.5 30
int g0/0/2
ip a 12.1.1.1 24
acl 2000 
rule permit source 172.16.0.0 0.0.255.255
int g0/0/2
nat outbound 2000

汇聚层

lsw1

# 配置路由接口
sys
vlan 99
interface Vlanif 99
ip a 172.16.0.2 30
int g0/0/5
port hybrid pvid  vlan 99
port hybrid untagged vlan 99

# 配置以太网中继
interface Eth-Trunk 0
interface GigabitEthernet 0/0/3
eth-trunk 0
int g0/0/1
eth-trunk 0

# 创建干道和VLAN
vlan batch 2 to 3
int g0/0/1
port link-type trunk
port trunk allow-pass vlan all
int g0/0/4
port link-type trunk
port trunk allow-pass vlan all

# 配置生成树
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

# 配置备份网关
vrrp vrid 1 priority 101
int vlan 1
ip a 172.16.1.1 24
vrrp vrid 1 virtual-ip 172.16.1.250
vrrp vrid 1 priority 101
int vlan 2
ip a 172.16.2.2 24
vrrp vrid 2 virtual-ip 172.16.2.250

# DHCP
dhcp enable 
ip pool a
network 172.16.1.1 mask 24
gateway-list 172.16.1.250

int vlan 1
dhcp select global

lsw2

# 配置路由接口
sys
vlan 99
interface Vlanif 99
ip a 172.16.0.6 30
int g0/0/5
port hybrid pvid  vlan 99
port hybrid untagged vlan 99

# 以太网中继
interface Eth-Trunk 0
interface GigabitEthernet 0/0/3
eth-trunk 0
int g0/0/1
eth-trunk 0

# 配置干道和VLAN
vlan batch 2 to 3
int g0/0/2
port link-type trunk
port trunk allow-pass vlan all
int g0/0/4
port link-type trunk
port trunk allow-pass vlan all

# 配置生成树
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration

stp instance 2 root primary 
stp instance 1 root secondary

# 配置备份网关
int vlan 1
ip a 172.16.1.2 24
vrrp vrid 1 virtual-ip 172.16.1.250
int vlan 2
ip a 172.16.2.1 24
vrrp vrid 2 virtual-ip 172.16.2.250
vrrp vrid 2  priority 101

# DHCP
dhcp enable 
ip pool a
network 172.16.1.1 mask 24
gateway-list 172.16.1.250
ip pool b
network 172.16.2.1 mask 24
gateway-list 172.16.2.250

int vlan 2
dhcp select global

接入层

lsw3

# 配置干道和VALN
vlan batch 2 to 3
int g0/0/4
port link-type trunk
port trunk allow-pass vlan all
int g0/0/5
port link-type trunk
port trunk allow-pass vlan all
int g0/0/3
port link-type trunk
port trunk allow-pass vlan all

# 配置生成树
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration

# 配置VLAN
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 1
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 2

lsw4

# 设置干道
vlan batch 2 to 3
int g0/0/4
port link-type trunk
port trunk allow-pass vlan all
int g0/0/5
port link-type trunk
port trunk allow-pass vlan all
int g0/0/3
port link-type trunk
port trunk allow-pass vlan all

# 配置生成树
stp region-configuration
region-name a
instance 1 vlan 1
instance 2 vlan 2
active region-configuration

# 配置VLAN
interface GigabitEthernet 0/0/1
port link-type access
port default vlan 1
interface GigabitEthernet 0/0/2
port link-type access
port default vlan 2

路由

#核心层和汇聚层设备使用动态路由

rip 1
version 2
network 172.16.0.0

# 缺省路由:

LSW1:ip route-static 0.0.0.0 0 172.16.0.1

LSW2:ip route-static 0.0.0.0 0 172.16.0.5

AR1:ip route-static 0.0.0.0 0 12.1.1.2

#空接口:

AR1:ip route-static 172.16.0.0 16 null 0

测试

三层架构实验_第3张图片

 三层架构实验_第4张图片

 三层架构实验_第5张图片

 

你可能感兴趣的:(网络,运维)