当前位置:   article > 正文

华为综合实验01-大型企业网络设计与实验(DHCP、VRRP、OSPF、PPP、PPPoE等)——傅老师eNSP经典实验系列_ensp毕业设计实验

ensp毕业设计实验

作者:运维傅老师(TeacherFu)

特别提示:未经作者允许,不得转载任何内容。违者必究!

大型企业经典网络架构实验

《傅老师eNSP经典综合实验系列之项目01》——原创


==前言==

傅老师文档特点:

1、必须能做通;

2、很强的易读性;

3、有以上2点就够了(曾主刀10+年相关教材编纂,放心看)。

(文章尾部有傅老师的二维码,欢迎沟通交流:)

适合人群:

1、有网络基础,希望短期内完成综合项目或写毕业设计同时提升能力的在校生;

2、有网络基础,用业余时间提升的在职小白;

3、可用于教学,例如综合网络项目实训。

资源下载:

同学们可根据文档内容自行完成实验,也可打包下载本实验的整个eNSP环境(包括拓扑和所有设备的配置,是已经完成的哦~~在eNSP中启动就是全通的)+完整清晰的拓扑图和文档。资源链接如下:

傅老师eNSP经典综合实验系列之“项目01-大型企业经典网络架构”


一、项目概述

    随着全球对环保和可持续发展的日益重视,新能源汽车行业正在迅速崛起。作为该行业的重要一环,新能源汽车电池制造商在推动技术创新和绿色能源应用方面扮演着关键角色。本项目旨在为某知名新能源汽车电池制造商建设一个高效、安全、可靠的网络系统,以满足其总部办公区和工厂区日益增长的网络需求。

    该制造商位于一个科技园区内,拥有总部办公区和工厂区两部分。其中,总部办公区包括1号楼和2号楼,是公司日常运营和管理的重要场所,集中了项目部、研发部、财务部和业务部等多个关键部门。工厂区则是电池生产的核心区域,设有生产部和产品展厅等场所。

二、拓扑图与需求

1、拓扑图

     总部办公区1号楼和2号楼的信息点各自汇聚到SW1和SW2,再上行至路由器R1和R2,并由SW8连接至互联网路由器Internet,总部路由器ZB通过串行链路与工厂路由器GC相连,工厂路由器GC通过PPPoE拨号至Internet。

     总部办公区有VLAN 10、20、30、40、50和300,其中VLAN300是远程管理网络设备专用;另外SW1和SW2还配置有VLAN11和12,用于VRRP的上行接口。

     详细网络拓扑如下图所示:

2、需求

  • 解决总部内网二层环路(对应步骤1-2);
  • 为总部内网自动分配IP地址(对应步骤3);
  • 实现汇聚层出方向主备负载分担(对应步骤4);
  • 实现Internet至总部入方向主备(对应步骤5);
  • 实现总部内网互通(对应步骤6);
  • 实现工厂与总部的连通(对应步骤7-9);
  • 实现与Internet的连通(对应步骤10-11);
  • 实现远程管理网络设备(对应步骤12);
  • 拒绝工厂展厅访问总部内网服务器区(对应步骤13);

 三、实施步骤OBO(one by one)

1、配置总部内部二层接口

(1)SW4

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW4
  6. [SW4]vlan batch 10 20 30 40 50 300
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW4]interface e0/0/1
  9. [SW4-Ethernet0/0/1]port link-type trunk
  10. [SW4-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 300
  11. //很多同学图省事这里允许all或者2 to 4094,这在生产环境中是不允许的,也不专业哦~
  12. [SW4-Ethernet0/0/1]quit
  13. [SW4]interface e0/0/3
  14. [SW4-Ethernet0/0/3]port link-type trunk
  15. [SW4-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300
  16. [SW4-Ethernet0/0/3]quit
  17. [SW4]interface e0/0/2
  18. [SW4-Ethernet0/0/2]port link-type access
  19. [SW4-Ethernet0/0/2]port default vlan 10
  20. [SW4-Ethernet0/0/2]quit

(2)SW5

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW5
  6. [SW5]vlan batch 10 20 30 40 50 300
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW5]interface e0/0/1
  9. [SW5-Ethernet0/0/1]port link-type trunk
  10. [SW5-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 300
  11. [SW5-Ethernet0/0/1]quit
  12. [SW5]interface e0/0/3
  13. [SW5-Ethernet0/0/3]port link-type trunk
  14. [SW5-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300
  15. [SW5-Ethernet0/0/3]quit
  16. [SW5]interface e0/0/2
  17. [SW5-Ethernet0/0/2]port link-type access
  18. [SW5-Ethernet0/0/2]port default vlan 20
  19. [SW5-Ethernet0/0/2]quit

(3)SW6

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW6
  6. [SW6]vlan batch 10 20 30 40 50 300
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW6]interface e0/0/1
  9. [SW6-Ethernet0/0/1]port link-type trunk
  10. [SW6-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 300
  11. [SW6-Ethernet0/0/1]quit
  12. [SW6]interface e0/0/3
  13. [SW6-Ethernet0/0/3]port link-type trunk
  14. [SW6-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300
  15. [SW6-Ethernet0/0/3]quit
  16. [SW6]interface e0/0/2
  17. [SW6-Ethernet0/0/2]port link-type access
  18. [SW6-Ethernet0/0/2]port default vlan 30
  19. [SW6-Ethernet0/0/2]quit

(4)SW7

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW7
  6. [SW7]vlan batch 10 20 30 40 50 300
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW7]interface e0/0/1
  9. [SW7-Ethernet0/0/1]port link-type trunk
  10. [SW7-Ethernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 300
  11. //开始复制粘贴了吗?老老实实敲命令可是高级网工的灵魂吼吼~~
  12. [SW7-Ethernet0/0/1]quit
  13. [SW7]interface e0/0/3
  14. [SW7-Ethernet0/0/3]port link-type trunk
  15. [SW7-Ethernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300
  16. [SW7-Ethernet0/0/3]quit
  17. [SW7]interface e0/0/2
  18. [SW7-Ethernet0/0/2]port link-type access
  19. [SW7-Ethernet0/0/2]port default vlan 40
  20. [SW7-Ethernet0/0/2]quit

(5)SW1

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW1
  6. [SW1]vlan batch 10 20 30 40 50 300 11 12
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. //这里开始有VLAN11和12了,后面VRRP会用到
  9. [SW1]interface g0/0/2
  10. [SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 300 11 12
  11. [SW1-GigabitEthernet0/0/2]quit
  12. [SW1]interface g0/0/3
  13. [SW1-GigabitEthernet0/0/3]port link-type trunk
  14. [SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300 11 12
  15. [SW1-GigabitEthernet0/0/3]quit

(6)SW2

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW2
  6. [SW2]vlan batch 10 20 30 40 50 300 11 12
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW2]interface g0/0/2
  9. [SW2-GigabitEthernet0/0/2]port link-type trunk
  10. [SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40 50 300 11 12
  11. [SW2-GigabitEthernet0/0/2]quit
  12. [SW2]interface g0/0/3
  13. [SW2-GigabitEthernet0/0/3]port link-type trunk
  14. [SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40 50 300 11 12
  15. [SW2-GigabitEthernet0/0/3]quit
  16. [SW2]interface g0/0/6
  17. [SW2-GigabitEthernet0/0/6]port link-type trunk
  18. [SW2-GigabitEthernet0/0/6]port trunk allow-pass vlan 10 20 30 40 50 300 11 12
  19. [SW2-GigabitEthernet0/0/6]quit

(7)SW1和SW2之间的链路聚合

  1. [SW1]interface eth-trunk 1
  2. [SW1-Eth-Trunk1]port link-type trunk
  3. [SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20 30 40 50 300
  4. [SW1-Eth-Trunk1]quit
  5. [SW1]interface g0/0/4
  6. [SW1-GigabitEthernet0/0/4]eth-trunk 1
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW1-GigabitEthernet0/0/4]quit
  9. [SW1]interface g0/0/14
  10. [SW1-GigabitEthernet0/0/14]eth-trunk 1
  11. Info: This operation may take a few seconds. Please wait for a moment...done.
  12. [SW1-GigabitEthernet0/0/14]quit
  13. [SW2]interface eth-trunk 1
  14. [SW2-Eth-Trunk1]port link-type trunk
  15. [SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20 30 40 50 300
  16. [SW2-Eth-Trunk1]quit
  17. [SW2]interface g0/0/4
  18. [SW2-GigabitEthernet0/0/4]eth-trunk 1
  19. Info: This operation may take a few seconds. Please wait for a moment...done.
  20. [SW2-GigabitEthernet0/0/4]quit
  21. [SW2]interface g0/0/14
  22. [SW2-GigabitEthernet0/0/14]eth-trunk 1
  23. Info: This operation may take a few seconds. Please wait for a moment...done.
  24. [SW2-GigabitEthernet0/0/14]quit

(8)SW3

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW3
  6. [SW3]vlan batch 10 20 30 40 50 300
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW3]interface g0/0/1
  9. [SW3-GigabitEthernet0/0/1]port link-type trunk
  10. [SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40 50 300
  11. [SW3-GigabitEthernet0/0/1]quit
  12. [SW3]interface e0/0/3
  13. [SW3-Ethernet0/0/3]port link-type access
  14. [SW3-Ethernet0/0/3]port default vlan 50
  15. [SW3-Ethernet0/0/3]quit

2、配置总部生成树

(1)SW3

  1. [SW3]stp enable
  2. [SW3]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. //华为默认启用MSTP,关于它的应用,我陆续会发其他网络项目中会有的。

(2)SW4

  1. [SW4]stp enable
  2. [SW4]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. [SW4]interface e0/0/2
  5. [SW4-Ethernet0/0/2]stp edged-port enable
  6. //配置为边缘接口,该接口不会主动发送BPDU报文、不参与生成树计算,仅处于转发状态,
  7. //所以,接入层交换机连接终端的接口最适合配置为边缘接口。
  8. [SW4-Ethernet0/0/2]quit
  9. [SW4]stp bpdu-protection
  10. //启用BPDU保护。防止攻击者仿造BPDU报文导致边缘端口属性变成非边缘端口

(3)SW5

  1. [SW5]stp enable
  2. [SW5]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. [SW5]interface e0/0/2
  5. [SW5-Ethernet0/0/2]stp edged-port enable
  6. [SW5-Ethernet0/0/2]quit
  7. [SW5]stp bpdu-protection

(4)SW6

  1. [SW6]stp enable
  2. [SW6]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. [SW6]interface e0/0/2
  5. [SW6-Ethernet0/0/2]stp edged-port enable
  6. [SW6-Ethernet0/0/2]quit
  7. [SW6]stp bpdu-protection

(5)SW7

  1. [SW7]stp enable
  2. [SW7]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. [SW7]interface e0/0/2
  5. [SW7-Ethernet0/0/2]stp edged-port enable
  6. [SW7-Ethernet0/0/2]quit
  7. [SW7]stp bpdu-protection

(6)SW1

  1. [SW1]stp enable
  2. [SW1]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.
  4. [SW1]stp priority 4096
  5. //配置SW1为根网桥。有的同学直接把优先级设置为0,这在生产环境中也是禁止的,
  6. //试想一下,如果你要换个根网桥怎么办?

(7)SW2

  1. [SW2]stp enable
  2. [SW2]stp mode rstp
  3. Info: This operation may take a few seconds. Please wait for a moment...done.

3、配置总部DHCP

(1)SW1为VLAN10和VLAN20分配IP地址

  1. [SW1]dhcp enable
  2. Info: The operation may take a few seconds. Please wait for a moment.done.
  3. [SW1]interface vlanif 10
  4. [SW1-Vlanif10]ip address 10.1.10.1 24
  5. [SW1-Vlanif10]dhcp select interface
  6. [SW1-Vlanif10]quit
  7. [SW1]interface vlanif 20
  8. [SW1-Vlanif20]ip address 10.1.20.1 24
  9. [SW1-Vlanif20]dhcp select interface
  10. [SW1-Vlanif20]quit

(2)SW2为VLAN30和VLAN40分配IP地址

  1. [SW2]dhcp enable
  2. Info: The operation may take a few seconds. Please wait for a moment.done.
  3. [SW2]dhcp snooping enable
  4. [SW2]interface vlanif 30
  5. [SW2-Vlanif30]ip address 10.1.30.1 24
  6. [SW2-Vlanif30]dhcp select interface
  7. [SW2-Vlanif30]quit
  8. [SW2]interface vlanif 40
  9. [SW2-Vlanif40]ip address 10.1.40.1 24
  10. [SW2-Vlanif40]dhcp select interface
  11. [SW2-Vlanif40]quit
  12. [SW2]interface vlanif 50
  13. [SW2-Vlanif50]ip address 10.1.50.1 24
  14. [SW2-Vlanif50]quit

此时总部客户端已经可以获取IP地址,以项目部和财务部为例-->

4、配置总部出方向VRRP

(1)配置SW1上行接口

  1. [SW1]interface g0/0/1
  2. [SW1-GigabitEthernet0/0/1]port link-type access
  3. [SW1-GigabitEthernet0/0/1]port default vlan 11
  4. [SW1-GigabitEthernet0/0/1]quit
  5. [SW1]interface g0/0/5
  6. [SW1-GigabitEthernet0/0/5]port link-type access
  7. [SW1-GigabitEthernet0/0/5]port default vlan 11
  8. [SW1-GigabitEthernet0/0/5]quit
  9. [SW1]interface vlanif 11
  10. [SW1-Vlanif11]ip address 10.1.11.1 24
  11. [SW1-Vlanif11]quit

(2)配置SW2上行接口

  1. [SW2]interface g0/0/1
  2. [SW2-GigabitEthernet0/0/1]port link-type access
  3. [SW2-GigabitEthernet0/0/1]port default vlan 12
  4. [SW2-GigabitEthernet0/0/1]quit
  5. [SW2]interface g0/0/5
  6. [SW2-GigabitEthernet0/0/5]port link-type access
  7. [SW2-GigabitEthernet0/0/5]port default vlan 12
  8. [SW2-GigabitEthernet0/0/5]quit
  9. [SW2]interface vlanif 12
  10. [SW2-Vlanif12]ip address 10.1.12.1 24
  11. [SW2-Vlanif12]quit

(3)配置路由器R1的VRRP下行接口

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname R1
  6. [R1]interface g0/0/0
  7. [R1-GigabitEthernet0/0/0]ip address 10.1.11.11 24
  8. [R1-GigabitEthernet0/0/0]quit
  9. [R1]interface g0/0/2
  10. [R1-GigabitEthernet0/0/2]ip address 10.1.12.11 24
  11. [R1-GigabitEthernet0/0/2]quit

(4)配置路由器R2的VRRP下行接口

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname R2
  6. [R2]interface g0/0/0
  7. [R2-GigabitEthernet0/0/0]ip address 10.1.12.12 24
  8. [R2-GigabitEthernet0/0/0]quit
  9. [R2]interface g0/0/2
  10. [R2-GigabitEthernet0/0/2]ip address 10.1.11.12 24
  11. [R2-GigabitEthernet0/0/2]quit

(5)配置R1为VRRP11的主路由器、VRRP12的备份路由器

  1. [R1]interface g0/0/0
  2. [R1-GigabitEthernet0/0/0]vrrp vrid 11 virtual-ip 10.1.11.10
  3. //VIP一定要与路由器下行接口IP同属一个网段
  4. [R1-GigabitEthernet0/0/0]vrrp vrid 11 priority 120
  5. //默认优先级100,谁高谁是Master
  6. [R1-GigabitEthernet0/0/0]vrrp vrid 11 preempt-mode timer delay 3
  7. //延迟抢占时间,默认为0秒。Backup设备可以默认0秒表示立即抢占,
  8. //但Master通常要设置非0值,避免因网络偶尔不稳定导致的VRRP状态频繁切换。
  9. [R1-GigabitEthernet0/0/0]quit
  10. [R1]interface g0/0/2
  11. [R1-GigabitEthernet0/0/2]vrrp vrid 12 virtual-ip 10.1.12.10
  12. [R1-GigabitEthernet0/0/2]quit

(6)配置R2为VRRP11的备份路由器、VRRP12的主路由器

  1. [R2]interface g0/0/2
  2. [R2-GigabitEthernet0/0/2]vrrp vrid 11 virtual-ip 10.1.11.10
  3. [R2-GigabitEthernet0/0/2]quit
  4. [R2]interface g0/0/0
  5. [R2-GigabitEthernet0/0/0]vrrp vrid 12 virtual-ip 10.1.12.10
  6. [R2-GigabitEthernet0/0/0]vrrp vrid 12 priority 120
  7. [R2-GigabitEthernet0/0/0]vrrp vrid 12 preempt-mode timer delay 3
  8. [R2-GigabitEthernet0/0/0]quit

查看VRRP主备状态正常

5、配置互联网到总部入方向VRRP

这次是反过来配,也必须得行哦~各种蹂躏VRRP便于加深理解,这在生产环境用的太多了

(1)配置R1上行接口

  1. [R1]interface g1/0/0
  2. [R1-GigabitEthernet1/0/0]ip address 8.1.1.9 24
  3. [R1-GigabitEthernet1/0/0]quit

(2)配置R2上行接口

  1. [R2]interface g1/0/0
  2. [R2-GigabitEthernet1/0/0]ip address 8.1.1.10 24
  3. [R2-GigabitEthernet1/0/0]quit

(3)配置Internet路由器与R1和R2相连的接口

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname Internet
  6. [Internet]interface g0/0/1
  7. [Internet-GigabitEthernet0/0/1]ip address 8.1.1.1 24
  8. [Internet-GigabitEthernet0/0/1]quit

(4)配置R1为VRRP8的主路由器

  1. [R1]interface g1/0/0
  2. [R1-GigabitEthernet1/0/0]vrrp vrid 8 virtual-ip 8.1.1.2
  3. [R1-GigabitEthernet1/0/0]vrrp vrid 8 priority 120
  4. [R1-GigabitEthernet1/0/0]vrrp vrid 8 preempt-mode timer delay 3
  5. [R1-GigabitEthernet1/0/0]quit

(5)配置R2为VRRP8的备份路由器

  1. [R2]interface g1/0/0
  2. [R2-GigabitEthernet1/0/0]vrrp vrid 8 virtual-ip 8.1.1.2
  3. [R2-GigabitEthernet1/0/0]quit

查看VRRP状态正常

6、配置总部OSPF(Area 0)

(1)配置R1与总部边界路由器相连的接口

  1. [R1]interface g0/0/1
  2. [R1-GigabitEthernet0/0/1]ip address 10.12.1.9 24
  3. [R1-GigabitEthernet0/0/1]quit

(2)配置R2与总部边界路由器相连的接口

  1. [R2]interface g0/0/1
  2. [R2-GigabitEthernet0/0/1]ip address 10.23.1.9 24
  3. [R2-GigabitEthernet0/0/1]quit

(3)配置总部边界路由器与R1和R2相连的接口

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname ZB
  6. [ZB]interface g0/0/1
  7. [ZB-GigabitEthernet0/0/1]ip address 10.12.1.10 24
  8. [ZB-GigabitEthernet0/0/1]quit
  9. [ZB]interface g0/0/2
  10. [ZB-GigabitEthernet0/0/2]ip address 10.23.1.10 24
  11. [ZB-GigabitEthernet0/0/2]quit

(4)SW1启动OSPF并宣告网段

  1. [SW1]ospf 1 router-id 10.1.11.1
  2. [SW1-ospf-1]area 0
  3. [SW1-ospf-1-area-0.0.0.0]network 10.1.10.0 0.0.0.255
  4. [SW1-ospf-1-area-0.0.0.0]network 10.1.11.0 0.0.0.255
  5. [SW1-ospf-1-area-0.0.0.0]network 10.1.20.0 0.0.0.255
  6. [SW1-ospf-1-area-0.0.0.0]quit
  7. [SW1-ospf-1]quit

(5)SW2启动OSPF并宣告网段

  1. [SW2]ospf 1 router-id 10.1.12.1
  2. [SW2-ospf-1]area 0
  3. [SW2-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
  4. [SW2-ospf-1-area-0.0.0.0]network 10.1.30.0 0.0.0.255
  5. [SW2-ospf-1-area-0.0.0.0]network 10.1.40.0 0.0.0.255
  6. [SW2-ospf-1-area-0.0.0.0]network 10.1.50.0 0.0.0.255
  7. [SW2-ospf-1-area-0.0.0.0]quit
  8. [SW2-ospf-1]quit

(6)R1启动OSPF并宣告网段

  1. [R1]interface loopback 0
  2. [R1-LoopBack0]ip address 192.168.1.3 24
  3. //配置Loopback口IP,用于OSPF Router-ID
  4. [R1-LoopBack0]quit
  5. [R1]ospf 1 router-id 192.168.1.3
  6. [R1-ospf-1]area 0
  7. [R1-ospf-1-area-0.0.0.0]network 10.1.11.0 0.0.0.255
  8. [R1-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
  9. [R1-ospf-1-area-0.0.0.0]network 10.12.1.0 0.0.0.255
  10. [R1-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0
  11. [R1-ospf-1-area-0.0.0.0]quit
  12. [R1-ospf-1]quit

(7)R2启动OSPF并宣告网段

  1. [R2]interface loopback 0
  2. [R2-LoopBack0]ip address 192.168.1.4 24
  3. [R2-LoopBack0]quit
  4. [R2]ospf 1 router-id 192.168.1.4
  5. [R2-ospf-1]area 0
  6. [R2-ospf-1-area-0.0.0.0]network 10.1.11.0 0.0.0.255
  7. [R2-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
  8. [R2-ospf-1-area-0.0.0.0]network 10.23.1.0 0.0.0.255
  9. [R2-ospf-1-area-0.0.0.0]network 192.168.1.4 0.0.0.0
  10. [R2-ospf-1-area-0.0.0.0]quit
  11. [R2-ospf-1]quit
  12. //想一想:R1和R2为什么不宣告与Internet相连的网段?

(8)ZB启动OSPF并宣告网段

  1. [ZB]interface loopback 0
  2. [ZB-LoopBack0]ip address 192.168.1.12 24
  3. [ZB-LoopBack0]quit
  4. [ZB]ospf 1 router-id 192.168.1.12
  5. [ZB-ospf-1]area 0
  6. [ZB-ospf-1-area-0.0.0.0]network 10.12.1.0 0.0.0.255
  7. [ZB-ospf-1-area-0.0.0.0]network 10.23.1.0 0.0.0.255
  8. [ZB-ospf-1-area-0.0.0.0]network 192.168.1.12 0.0.0.0
  9. [ZB-ospf-1-area-0.0.0.0]quit
  10. [ZB-ospf-1]quit

(9)测试总部内网连通性

在路由器ZB查看路由表,可看到内网各网段路由条目-->

用项目部PC测试与各网段连通性-->

7、配置工厂内部通信

(1)配置SW10二层接口

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname SW10
  6. [SW10]vlan batch 5 6
  7. Info: This operation may take a few seconds. Please wait for a moment...done.
  8. [SW10]interface e0/0/1
  9. [SW10-Ethernet0/0/1]port link-type trunk
  10. [SW10-Ethernet0/0/1]port trunk allow-pass vlan 5 6
  11. [SW10-Ethernet0/0/1]quit
  12. [SW10]interface e0/0/2
  13. [SW10-Ethernet0/0/2]port link-type access
  14. [SW10-Ethernet0/0/2]port default vlan 5
  15. [SW10-Ethernet0/0/2]quit
  16. [SW10]interface e0/0/3
  17. [SW10-Ethernet0/0/3]port link-type access
  18. [SW10-Ethernet0/0/3]port default vlan 6
  19. [SW10-Ethernet0/0/3]quit

(2)路由器GC配置单臂路由

  1. <Huawei>system-view
  2. Enter system view, return user view with Ctrl+Z.
  3. [Huawei]undo info-center enable
  4. Info: Information center is disabled.
  5. [Huawei]sysname GC
  6. [GC]interface g0/0/1.5
  7. [GC-GigabitEthernet0/0/1.5]dot1q termination vid 5
  8. [GC-GigabitEthernet0/0/1.5]ip address 10.2.5.1 24
  9. [GC-GigabitEthernet0/0/1.5]arp broadcast enable
  10. //启动子接口的ARP广播功能,以便于IP报文的正常转发
  11. [GC-GigabitEthernet0/0/1.5]quit
  12. [GC]interface g0/0/1.6
  13. [GC-GigabitEthernet0/0/1.6]dot1q termination vid 6
  14. [GC-GigabitEthernet0/0/1.6]ip address 10.2.6.1 24
  15. [GC-GigabitEthernet0/0/1.6]arp broadcast enable
  16. [GC-GigabitEthernet0/0/1.6]quit

测试工厂内部通信OK-->

8、配置总部与工厂间的PPP链路

(1)配置GC串口IP与协议

  1. [GC]interface s1/0/0
  2. [GC-Serial1/0/0]ip address 22.2.2.2 24
  3. [GC-Serial1/0/0]link-protocol ppp
  4. [GC-Serial1/0/0]quit

(2)配置ZB串口IP与协议

  1. [ZB]interface s1/0/0
  2. [ZB-Serial1/0/0]ip address 22.2.2.1 24
  3. [ZB-Serial1/0/0]link-protocol ppp
  4. [ZB-Serial1/0/0]quit

(3)配置ZB认证方

  1. [ZB]interface s1/0/0
  2. [ZB-Serial1/0/0]ppp authentication-mode chap
  3. [ZB-Serial1/0/0]quit
  4. [ZB]aaa
  5. [ZB-aaa]local-user chap-gc password cipher gc123456
  6. Info: Add a new user.
  7. [ZB-aaa]local-user chap-gc service-type ppp
  8. [ZB-aaa]quit
  9. [ZB]interface s1/0/0
  10. [ZB-Serial1/0/0]shutdown
  11. [ZB-Serial1/0/0]undo shutdown
  12. [ZB-Serial1/0/0]quit

(4)配置GC被认证方

  1. [GC]interface s1/0/0
  2. [GC-Serial1/0/0]ppp chap user chap-gc
  3. [GC-Serial1/0/0]ppp chap password cipher gc123456
  4. [GC-Serial1/0/0]quit

9、配置工厂OSPF(Area1)

这里假设工厂与总部之间的链路不稳定或者很远。。。很慢,所以将工厂创建Area1

(1)ZB路由器宣告网段

  1. [ZB]ospf 1 router-id 192.168.1.12
  2. [ZB-ospf-1]area 1
  3. [ZB-ospf-1-area-0.0.0.1]network 22.2.2.0 0.0.0.255
  4. [ZB-ospf-1-area-0.0.0.1]quit
  5. [ZB-ospf-1]quit

(2)GC路由器宣告网段

  1. [GC]ospf 1 router-id 192.168.1.11
  2. [GC-ospf-1]area 1
  3. [GC-ospf-1-area-0.0.0.1]network 10.2.5.0 0.0.0.255
  4. [GC-ospf-1-area-0.0.0.1]network 10.2.6.0 0.0.0.255
  5. [GC-ospf-1-area-0.0.0.1]network 22.2.2.0 0.0.0.255
  6. [GC-ospf-1-area-0.0.0.1]quit
  7. [GC-ospf-1]quit

(3)测试总部与工厂的连通性

10、配置总部内网到Internet的通信

(1)配置Internet路由器G0/0/2接口

  1. [Internet]interface g0/0/2
  2. [Internet-GigabitEthernet0/0/2]ip address 100.1.1.1 24
  3. [Internet-GigabitEthernet0/0/2]quit

(2)配置Internet到总部内网的路由

[Internet]ip route-static 10.1.0.0 255.255.0.0 8.1.1.2

(3)配置R1到Internet的路由

  1. [R1]ip route-static 0.0.0.0 0.0.0.0 8.1.1.1
  2. [R1]ospf 1
  3. [R1-ospf-1]default-route-advertise type 1 //引入静态路由至OSPF
  4. [R1-ospf-1]quit

(4)配置R2到Internet的路由

  1. [R2]ip route-static 0.0.0.0 0.0.0.0 8.1.1.1
  2. [R2]ospf 1
  3. [R2-ospf-1]default-route-advertise type 1
  4. [R2-ospf-1]quit

(5)测试总部内网到Internet的连通性

11、配置工厂到Internet的PPPoE链路

(1)配置Internet路由器为PPPoE服务器

  1. [Internet]ip pool GC
  2. //创建全局地址池
  3. Info: Its successful to create an IP address pool
  4. [Internet-ip-pool-GC]network 12.1.1.0 mask 24
  5. [Internet-ip-pool-GC]gateway-list 12.1.1.1
  6. [Internet-ip-pool-GC]quit
  7. [Internet]
  8. [Internet]interface virtual-template 1
  9. //配置虚拟模板接口并关联地址池
  10. [Internet-Virtual-Template1]ip address 12.1.1.1 24
  11. [Internet-Virtual-Template1]remote address pool GC
  12. [Internet-Virtual-Template1]quit
  13. [Internet]
  14. [Internet]interface g0/0/0
  15. [Internet-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1
  16. //在接口上启用PPPoE服务器功能
  17. [Internet-GigabitEthernet0/0/0]quit
  18. [Internet]
  19. [Internet]interface virtual-template 1
  20. //配置认证
  21. [Internet-Virtual-Template1]ppp authentication-mode chap
  22. [Internet-Virtual-Template1]quit
  23. [Internet]aaa
  24. [Internet-aaa]local-user gcuser password cipher Aa123456
  25. Info: Add a new user.
  26. [Internet-aaa]local-user gcuser service-type ppp
  27. [Internet-aaa]quit

(2)配置GC路由器为PPPoE客户端

  1. [GC]acl 2001
  2. [GC-acl-basic-2001]rule permit source 10.2.0.0 0.0.255.255
  3. //ACL配合后面的EasyIP
  4. [GC-acl-basic-2001]quit
  5. [GC]dialer-rule //创建拨号规则
  6. [GC-dialer-rule]dialer-rule 1 ip permit
  7. [GC-dialer-rule]quit
  8. [GC]
  9. [GC]interface dialer 1 //配置虚拟拨号接口
  10. [GC-Dialer1]ip address ppp-negotiate
  11. [GC-Dialer1]dialer user gcuser
  12. [GC-Dialer1]dialer-group 1
  13. [GC-Dialer1]dialer bundle 1
  14. [GC-Dialer1]
  15. [GC-Dialer1]ppp chap user gcuser //配置客户端认证
  16. [GC-Dialer1]ppp chap password cipher Aa123456
  17. [GC-Dialer1]nat outbound 2001 //配置EasyIP
  18. Info: The NAT address pool is empty
  19. [GC-Dialer1]quit
  20. [GC]interface g0/0/0
  21. [GC-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1 //接口绑定虚拟拨号
  22. [GC-GigabitEthernet0/0/0]quit
  23. [GC]ip route-static 0.0.0.0 0.0.0.0 dialer 1 preference 85
  24. //创建到Internet的默认路由

(3)测试PPPoE

查看PPPoE服务器状态,已经UP-->

查看地址池,已经分配出去1个-->

查看PPPoE客户端状态,已经UP-->

查看Dialer1接口,获取了IP地址12.1.1.254-->

查看EasyIP已配好-->

测试工厂客户端与互联网的连通性-->

12、配置远程管理网络设备

以远程管理交换机SW1为例

(1)配置管理IP(VLANIF300)

  1. [SW1]interface vlanif 300
  2. [SW1-Vlanif300]ip address 192.168.1.1 24
  3. [SW1-Vlanif300]quit

(2)配置认证和Telnet

  1. [SW1]aaa
  2. [SW1-aaa]local-user TeacherFu privilege level 3 password cipher Aa123456
  3. Info: Add a new user.
  4. [SW1-aaa]local-user TeacherFu service-type telnet
  5. [SW1-aaa]quit
  6. [SW1]user-interface vty 0 4
  7. [SW1-ui-vty0-4]authentication-mode aaa
  8. [SW1-ui-vty0-4]protocol inbound telnet
  9. [SW1-ui-vty0-4]quit

(3)测试远程管理

在本实验中,用另一台网络设备SW2充当Telnet客户端

  1. [SW2]interface vlanif 300
  2. [SW2-Vlanif300]ip address 192.168.1.2 24
  3. //先配置管理网段的IP地址
  4. [SW2-Vlanif300]quit

测试可以成功登录-->

13、配置访问控制

禁止工厂展厅的客户端访问总部内网服务器区

(1)配置ACL之前,展厅是可以访问总部内网服务器的

(2)配置路由器GC的ACL

  1. [GC]acl 3000
  2. [GC-acl-adv-3000]rule 5 deny ip source 10.2.5.0 0.0.0.255 destination 10.1.50.0 0.0.0.255
  3. [GC-acl-adv-3000]rule 10 permit ip source any destination any
  4. [GC-acl-adv-3000]quit
  5. [GC]interface g0/0/1.5
  6. [GC-GigabitEthernet0/0/1.5]traffic-filter inbound acl 3000
  7. //在入方向应用ACL效率更高
  8. [GC-GigabitEthernet0/0/1.5]quit

(3)配置ACL之后再次测试连通性

四、傅老师的微信名片

欢迎沟通交流:)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/619703
推荐阅读
相关标签
  

闽ICP备14008679号