三层架构实验

实验要求

1、内网IP地址172.16.0.0/16 合理分配
2、SW1/2之间互为备份
3、VRRP/STP/VLAN/TRUNK均使用
4、所有pc通过dhcp获取ip

实验拓扑图

 

实验流程

IP配置

isp

R1

lsw1

lsw2


ospf配置

r1
ospf 1 router-id 1.1.1.1
 default-route-advertise                         
 area 0.0.0.1 
  network 172.16.20.0 0.0.0.3 
  network 172.16.30.0 0.0.0.3 

ip route-static 0.0.0.0 0.0.0.0 10.1.12.2


lsw1
 ospf 1 router-id 2.2.2.2              
 silent-interface GigabitEthernet0/0/4           
 silent-interface GigabitEthernet0/0/5
 silent-interface vlan 1
 silent-interface vlan 2 
  area 0.0.0.0
  network 172.16.1.0 0.0.0.255
  network 172.16.2.0 0.0.0.255
  network 172.16.12.0 0.0.0.3
  area 0.0.0.1
  network 172.16.20.0 0.0.0.3

ip pool a
 gateway-list 172.16.1.254
 network 172.16.1.0 mask 255.255.255.0       #创建地址池
#
ip pool b
 gateway-list 172.16.2.254
 network 172.16.2.0 mask 255.255.255.0

lsw2
 ospf 1 router-id 3.3.3.3
 silent-interface GigabitEthernet0/0/4
 silent-interface GigabitEthernet0/0/5
 silent-interface vlan 1
 silent-interface vlan 2
 area 0.0.0.0
  network 172.16.2.0 0.0.0.255
  network 172.16.1.0 0.0.0.255
  network 172.16.12.0 0.0.0.3
 area 0.0.0.1
  network 172.16.30.0 0.0.0.3

ip pool a
 gateway-list 172.16.1.254
 network 172.16.1.0 mask 255.255.255.0
ip pool b
 gateway-list 172.16.2.254
 network 172.16.2.0 mask 255.255.255.0

stp配置

lsw1
stp instance 1 root primary                  设置该交换机为实例1的生成树主根
stp instance 2 root secondary                设置该交换机为实例2的生成树备根
stp bpdu-protection                             设置BPDU保护,防止网络动荡
stp region-configuration                    进入MSTP区域
 region-name 1                              给该区域取名
 revision-level 1                           更改修订级
 instance 1 vlan 1                          说明vlan1走实例1,实例2是vlan1的备根
 instance 2 vlan 2
 active region-configuration 

lsw2
stp instance 1 root secondary
stp instance 2 root primary
stp bpdu-protection                 
stp region-configuration
 region-name 1
 revision-level 1
 instance 1 vlan 1
 instance 2 vlan 2
 active region-configuration

lsw3

stp bpdu-protection                 
stp region-configuration
 region-name 1
 revision-level 1
 instance 1 vlan 1
 instance 2 vlan 2
 active region-configuration

lsw4

stp bpdu-protection                 
stp region-configuration
 region-name 1
 revision-level 1
 instance 1 vlan 1
 instance 2 vlan 2
 active region-configuration

配置VRRP

lsw1

interface Vlanif1                              配置vlan的地址
 ip address 172.16.1.1 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.1.254           设置vrrp的虚拟地址
 vrrp vrid 1 priority 120                            设置vrrp的优先级,使该交换机成为vlan1的master
 vrrp vrid 1 preempt-mode timer delay 10        Master出现问题后,backup的抢占时间
 vrrp vrid 1 track interface GigabitEthernet0/0/3 reduced 30    

                                                                                           上游设备出现问题,master 变为backup

interface Vlanif2
 ip address 172.16.2.1 255.255.255.0
 vrrp vrid 1 virtual-ip 172.16.2.254
 vrrp vrid 1 priority 120
 vrrp vrid 1 preempt-mode timer delay 10
 vrrp vrid 1 track interface GigabitEthernet0/0/3 reduced 30

链路聚合

lsw1

interface Eth-Trunk1                           #进入链路聚合
 port link-type trunk                            
 port trunk allow-pass vlan 2 12
 mode lacp-static                              #设置为自动聚合
进接口配置
interface GigabitEthernet0/0/1
 eth-trunk 1
interface GigabitEthernet0/0/2
 eth-trunk 1

lsw2

interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 12
 mode lacp-static
进接口配置
interface GigabitEthernet0/0/1
 eth-trunk 1
interface GigabitEthernet0/0/2
 eth-trunk 1

nat配置

acl number 2000  
 rule 5 permit source 172.16.0.0 0.0.255.255 

每个接口起trunk

lsw1

lsw2

lsw3

lsw4

测试

pc1

pc2

pc3

pc4

 查看生成树

lsw1

lsw2

 查看vrrp聚合

R1

lsw1

pc上网

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值