• 交换综合实验


    实验要求如下
    在这里插入图片描述
    先分析实验,完成拓扑设计
    进行ip地址规划
    172.16.0.0/24 骨干 172.16.0.0/30 172.16.0.4/30
    172.16.1.0/24 vlan1 172.16.1.0/25 172.16.1.128/25
    ip地址分配好后
    创建eth-trunk绑定接口

    [SW3]int Eth-Trunk 1
    [SW3-Eth-Trunk1]q
    [SW3]int g0/0/01
    [SW3-GigabitEthernet0/0/1]eth-trunk 1
    [SW3]int g0/0/2
    [SW3-GigabitEthernet0/0/2]eth-trunk 1
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    然后创建vlan
    在SW1/SW2连接PC处的接口化为vlan2

    SW2]int e0/0/3
    [SW2-Ethernet0/0/3]port link-type access
    [SW2-Ethernet0/0/3]port default vlan 1
    [SW2-Ethernet0/0/3]int e0/0/04
    [SW2-Ethernet0/0/4]port link- access
    [SW2-Ethernet0/0/4]port default vlan 2
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    划分trunk干道
    SW3/SW4都可以按此方法划分trunk

    [SW3]port-group group-member Eth-Trunk 1 GigabitEthernet 0/0/3 to g0/0/04
    [SW3-port-group]port link-type trunk
    [SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 2
    
    • 1
    • 2
    • 3

    SW1/SW2划入trunk

    [SW1]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/02
    [SW1-port-group]port link-type trunk
    [SW1-port-group]port trunk allow-pass vlan 2
    
    • 1
    • 2
    • 3

    配置STP生成树
    因为华为设备中默认是MSTP;
    SW1/SW2/SW3/SW4均按照此配置进行配置

    [SW4]stp re
    [SW4]stp region-configuration
    [SW4-mst-region]region-name a
    [SW4-mst-region]instance 1 vlan 1
    [SW4-mst-region]instance 2 vlan 2
    [SW4-mst-region]active region-configuration
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    将交换机连接电脑的接口调整为生成树的边缘接口,连接用户,这样可以响应速度更快,连电脑接口只需要一次bpdu收发就行
    在SW1/SW2上进行配置

    [SW2]port-group group-member Ethernet 0/0/03 to Ethernet 0/0/4
    [SW2-port-group]stp edged-port enable
    [SW2-Ethernet0/0/3]stp edged-port enable
    [SW2-Ethernet0/0/4]stp edged-port enable
    
    • 1
    • 2
    • 3
    • 4

    配置好SVI和VRRP后,开始配置dhcp下方地址

    [SW3]dhcp enable
    [SW3]ip pool 1
    [SW3-ip-pool-1]network 172.16.1.0 mask 25
    [SW3-ip-pool-1]gateway-list 172.16.1.126
    [SW3-ip-pool-1]dns-list 8.8.8.8
    [SW3]ip pool 2
    [SW3-ip-pool-2]network 172.16.1.128 mask 25
    [SW3-ip-pool-2]gateway-list 172.16.1.254
    [SW3-ip-pool-2]dns-list 8.8.8.8
    [SW3]int Vlanif 1
    [SW3-Vlanif1]dhcp select global
    [SW3-Vlanif1]int vl2
    [SW3-Vlanif2]dhcp select global
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    查看pc的ip地址
    在这里插入图片描述
    然后开始配置ospf

    [SW3]ospf 1 router-id 1.1.1.1
    [SW3-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
    
    • 1
    • 2
    [SW4]ospf 1 router-id 2.2.2.2
    [SW4-ospf-1]area 0
    [SW4-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
    
    • 1
    • 2
    • 3

    在R1上配置一条缺省路由,并在OSPF域内重发布

    R1]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
    [R1]ospf 1
    [R1-ospf-1]default-route-advertise
    
    • 1
    • 2
    • 3

    配置NAT地址转换,使内网地址访问公网可以通过NAT转换

    R1]acl 2000
    [R1-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
    [R1]int g0/0/0
    [R1-GigabitEthernet0/0/0]nat outbound 2000
    
    • 1
    • 2
    • 3
    • 4

    测试pc访问公网
    在这里插入图片描述

  • 相关阅读:
    Java项目模块占用CPU过高问题分析
    优思学院|精益六西格玛中的8大浪费是什么?
    医院空调冷热源设计方案VR元宇宙模拟演练的独特之处
    FastDFS基础学习(二)之安装FastDFS
    【云IDE】尝试着操作了云IDE感觉蛮好用的操作步骤总结了一下来看看,提提建议
    Python:实现perfect cube完全立方数算法(附完整源码)
    最新Justnews主题源码6.0.1开心版+社交问答插件2.3.1+附教程
    动态规划4(Leetcode746使用最小花费爬楼梯)
    了解什么是架构基本概念和架构本质
    Opencv实现信用卡识别
  • 原文地址:https://blog.csdn.net/qq_53012201/article/details/126184513