综合实验

目录

实验一:

1、拓扑图

2、需求:

3、配置步骤

4、配置命令:

实验二:

拓扑图:

需求

配置步骤

第一步:SW1/SW2/SW3基础配置

第二步:SW5和SW6的-基础配置

第三步:配置VRRP

第四步:配置MSTP

第五步:配置DHCP服务器

第六步:配置SW5和SW6-DHCP中继

第七步:配置接口IP地址

第八步:SW5/SW6和出口设备R1互联配置

第九步:R1配置默认路由和NAT

第十步:扩展知识

配置命令


实验一:

1、拓扑图

2、需求:

1)全网互联互通

2)SW1远程控制SW2和SW3

3、配置步骤

4、配置命令:

SW4配置: 
 sysname SW4 
#
vlan batch 10 20 30 40
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface Eth-Trunk2
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface GigabitEthernet0/0/1
 eth-trunk 1
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 2
#
interface GigabitEthernet0/0/4
 eth-trunk 2
#
interface GigabitEthernet0/0/5
 port hybrid pvid vlan 10
 port hybrid untagged vlan 10 20 30 40
#


 SW5配置: 
 sysname SW5
#
vlan batch 10 20 30 40
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
interface Eth-Trunk3
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface Eth-Trunk4
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface GigabitEthernet0/0/1
 eth-trunk 3
#
interface GigabitEthernet0/0/2
 eth-trunk 3
#
interface GigabitEthernet0/0/3
 eth-trunk 4
#
interface GigabitEthernet0/0/4
 eth-trunk 4
#
interface GigabitEthernet0/0/5
 port hybrid pvid vlan 20
 port hybrid untagged vlan 10 20 30 40
 

 SW6配置: 
sysname SW6
#
vlan batch 10 20 30 40
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
interface Eth-Trunk5
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface Eth-Trunk6
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface GigabitEthernet0/0/1
 eth-trunk 5
#
interface GigabitEthernet0/0/2
 eth-trunk 5
#
interface GigabitEthernet0/0/3
 eth-trunk 6
#
interface GigabitEthernet0/0/4
 eth-trunk 6
#
interface GigabitEthernet0/0/5
 port hybrid pvid vlan 30
 port hybrid untagged vlan 10 20 30 40
 
 SW7配置: 
sysname SW7
#
vlan batch 10 20 30 40
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
interface Eth-Trunk7
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface Eth-Trunk8
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 mode lacp-static
#
interface GigabitEthernet0/0/1
 eth-trunk 7
#
interface GigabitEthernet0/0/2
 eth-trunk 7
#
interface GigabitEthernet0/0/3
 eth-trunk 8
#
interface GigabitEthernet0/0/4
 eth-trunk 8
#
interface GigabitEthernet0/0/5
 port hybrid pvid vlan 40
 port hybrid untagged vlan 10 20 30 40
 
 
 SW2的配置: 
sysname SW2
#
vlan batch 10 20 30 40
#
stp instance 1 priority 4096
stp instance 2 priority 8192
#
lacp priority 100
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
aaa
 local-user ntd02 password cipher 123
 local-user ntd02 privilege level 15
 local-user ntd02 service-type telnet
#
interface Vlanif1
 ip address 192.168.123.22 255.255.255.0      //管理vlan:用于SW1远程控制SW2 
#
interface Eth-Trunk1
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
#
interface Eth-Trunk3
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 
#
interface Eth-Trunk5
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
#
interface Eth-Trunk7
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
#
interface Eth-Trunk9
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
#
interface GigabitEthernet0/0/1
 eth-trunk 1
#
interface GigabitEthernet0/0/2
 eth-trunk 1
#
interface GigabitEthernet0/0/3
 eth-trunk 3
#
interface GigabitEthernet0/0/4
 eth-trunk 3
#
interface GigabitEthernet0/0/5
 eth-trunk 5
#
interface GigabitEthernet0/0/6
 eth-trunk 5
#
interface GigabitEthernet0/0/7
 eth-trunk 7
#
interface GigabitEthernet0/0/8
 eth-trunk 7
#
interface GigabitEthernet0/0/9
 port hybrid tagged vlan 10 20 30 40
#
interface GigabitEthernet0/0/10
 eth-trunk 9
#
interface GigabitEthernet0/0/20
 eth-trunk 9
#
user-interface vty 0 4
 authentication-mode aaa
 
  
 SW3配置: 
sysname SW3
#
vlan batch 10 20 30 40
#
stp instance 1 priority 8192
stp instance 2 priority 4096
#
lacp priority 150
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
aaa
 local-user ntd03 password cipher 123
 local-user ntd03 privilege level 15
 local-user ntd03 service-type telnet
#
interface Vlanif1
 ip address 192.168.123.33 255.255.255.0
#
interface Eth-Trunk2
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 
#
interface Eth-Trunk4
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40

#
interface Eth-Trunk6
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40

#
interface Eth-Trunk8
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
 
#
interface Eth-Trunk9
 mode lacp-static
 port link-type trunk
 port trunk allow-pass vlan 10 20 30 40
#
interface GigabitEthernet0/0/1
 eth-trunk 2
#
interface GigabitEthernet0/0/2
 eth-trunk 2
#
interface GigabitEthernet0/0/3
 eth-trunk 4
#
interface GigabitEthernet0/0/4
 eth-trunk 4
#
interface GigabitEthernet0/0/5
 eth-trunk 6
#
interface GigabitEthernet0/0/6
 eth-trunk 6
#
interface GigabitEthernet0/0/7
 eth-trunk 8
#
interface GigabitEthernet0/0/8
 eth-trunk 8
#
interface GigabitEthernet0/0/9
 port hybrid tagged vlan 10 20 30 40
#
interface GigabitEthernet0/0/10
 eth-trunk 9
#
interface GigabitEthernet0/0/20
 eth-trunk 9
#
user-interface vty 0 4
 authentication-mode aaa
 
 
 SW1配置:   
sysname SW1
#
vlan batch 10 20 30 40 66
#
interface Vlanif1
 ip address 192.168.123.123 255.255.255.0
#
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
#
interface Vlanif30
 ip address 192.168.30.254 255.255.255.0
#
interface Vlanif40
 ip address 192.168.40.254 255.255.255.0
#
interface Vlanif66
 ip address 192.168.66.1 255.255.255.0
#
interface GigabitEthernet0/0/1
 port hybrid tagged vlan 10 20 30 40
#
interface GigabitEthernet0/0/2
 port hybrid tagged vlan 10 20 30 40
#
interface GigabitEthernet0/0/10
 port link-type access
 port default vlan 66
#
ip route-static 0.0.0.0 0.0.0.0 192.168.66.2

 R1配置: 
sysname R1
#
interface GigabitEthernet0/0/0
 ip address 192.168.88.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.66.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/2.80
 dot1q termination vid 80
 ip address 192.168.80.254 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/2.90
 dot1q termination vid 90
 arp broadcast enable
#
ip route-static 192.168.10.0 255.255.255.0 192.168.66.1
ip route-static 192.168.20.0 255.255.255.0 192.168.66.1
ip route-static 192.168.30.0 255.255.255.0 192.168.66.1
ip route-static 192.168.40.0 255.255.255.0 192.168.66.1
ip route-static 192.168.50.0 255.255.255.0 192.168.88.2

 SW8配置: 
sysname SW8
#
vlan batch 50 60 70 88 100
#
vlan 100
 aggregate-vlan
 access-vlan 50 60 70
#
interface Vlanif88
 ip address 192.168.88.2 255.255.255.0
#
interface Vlanif100
 ip address 192.168.50.254 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 50 60 70
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 50 60 70
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 50 60 70
#
interface GigabitEthernet0/0/10
 port link-type access
 port default vlan 88
#
ip route-static 0.0.0.0 0.0.0.0 192.168.88.1

 
 SW9配置: 
sysname SW9
#
vlan batch 50 60 70
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 50
#
interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 50 60 70


 SW10配置: 
sysname SW10
#
vlan batch 50 60 70
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 60
#
interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 50 60 70

 SW11配置: 
sysname SW11
#
vlan batch 50 60 70
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 70
#
interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 50 60 70


 SW12配置: 
sysname SW12
#
vlan batch 80 90
#
interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 80
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 90
#
interface GigabitEthernet0/0/10
 port link-type trunk
 port trunk allow-pass vlan 80 90

实验二:

拓扑图:

需求

1)公司有三个部门,财务部,市场部,技术部,为了内网安全,给每个部门单独划分一个VLAN

-财务部:vlan10、市场部:vlan20、技术部:vlan30

-公司所有部门,所有VLAN内的主机都通过DHCP服务器分发IP地址

解决方案:vlan技术

2)所有部门中都使用了网关冗余技术,为了增强网关稳定性和冗余性

-配置VRRP

-SW5是VLAN10和VLAN20的Master ,是VLAN30的Backup

-SW6是VLAN10和VLAN20的Backup,是VLAN30的Master

解决方案:VRRP技术+vlanif

3)交换机之间存在很多冗余链路,必须防止广播风暴的发生,并且能够提高链路的利用率,

要求每个部门的主机访问其他主机时,使用的都是最优的转发路径

-配置MSTP

-SW5是VLAN10和VLAN20的主根 ,是VLAN30和vlan50的备根

-SW6是VLAN10和VLAN20的备根 ,是VLAN30和vlan50的主根

解决方案:MSTP技术

4)公司所有部门,所有VLAN内的主机都通过DHCP服务器分发IP地址

-VLAN10和vlan20的主机通过SW5这台DHCP中继获取IP地址

-VLAN30的主机通过SW6这台DHCP中继获取IP地址

解决方案:DHCP和DHCP中继

5)部署地址池NAT,实现内网主机访问外网

解决方案:NAT和ACL+路由

配置步骤

第一步:SW1/SW2/SW3基础配置

-3台交换机创建vlan10/vlan20/vlan30/vlan50

-与PC互联的接口配置为access,并接入指定的vlan

-与SW5和SW6交换机互联的接口配置为trunk,允许所有vlan通过

第二步:SW5和SW6的-基础配置

-创建vlan10/vlan20/vlan30/vlan50

-配置vlanif虚接口地址:SW5: 192.168.xx.251 SW6: 192.168.xx.252

-与SW1/SW2/SW3互联的接口配置trunk,允许所有vlan通过

-SW5和SW6互联的接口也做trunk ,允许所有vlan通过

-SW5与R3-DHCP 服务器互联的接口配置access ,加入vlan50

第三步:配置VRRP

-在vlanif虚接口下配置VRRP

-让SW5成为vlan10/vlan20的Master,vlan30的Backup

-让SW6成为vlan30的Master,vlan10/vlan20的Backup

第四步:配置MSTP

-在所有的交换机中配置MSTP

-让SW5成为vlan10/vlan20的主根,vlan30/vlan50的备根

-让SW6成为vlan30/vlan50的主根、vlan10/vlan20的备根

第五步:配置DHCP服务器

-在R3-DHCP系统视图下开启dhcp 功能

-R3-DHCP中创建IP地址池(网段、网关、dns)

-R3-DHCP中配置默认路由,下一跳为192.168.50.251 (配置回程路由,回应DHCP请求)

-在R3-DHCP-g0/0/0接口下配置IP地址:192.168.50.1

-在R3-DHCP-g0/0/0接口下开启基于全局的DHCP

第六步:配置SW5和SW6-DHCP中继

-在系统视图下,开启dhcp 功能

-在每个vlanif虚接口下开启dhcp中继,并配置DHCP服务器IP:192.168.50.1

第七步:配置接口IP地址

-R1配置接口IP地址

-R4配置接口IP地址-ISP-dx的接口IP地址

-server1 和client1 配置IP地址

第八步:SW5/SW6和出口设备R1互联配置

-在SW5中创建vlan15,并将g0/0/7接口加入vlan15

-在SW5中配置vlanif 15的接口IP地址

-在SW5中配置默认路由,下一跳指向出口设备R1,实现将企业内网数据转发给出口设备

-在SW6中创建vlan16,并将g0/0/7接口加入vlan16

-在SW6中配置vlanif 16的接口IP地址

-在SW6中配置默认路由,下一跳指向出口设备R1,实现将企业内网数据转发给出口设备

-在R1配置去往vlan10/vlan20/vlan30网段的回程路由,下一跳分别指SW5和SW6

第九步:R1配置默认路由和NAT

-R1配置默认路由,下一跳指向公网网关

-R1配置NAT地址池

-R1配置ACL,定义允许那些内网网段访问外网

-R1在出接口g0/0/2中配置地址池NAT

第十步:扩展知识

配置命令

第一步:SW1/SW2/SW3基础配置 
 [Huawei]sys SW1 
[SW1]vlan batch 10 20 30 50
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]quit
[SW1]port-group group-member g0/0/2 g0/0/3
[SW1-port-group]port link-type trunk 
[SW1-port-group]port trunk allow-pass vlan all


 [Huawei]sys SW2 
[SW2]vlan batch 10 20 30 50 
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 20
[SW2-GigabitEthernet0/0/1]quit
[SW2]port-group group-member g0/0/2 g0/0/3
[SW2-port-group]port link-type trunk  
[SW2-port-group]port trunk allow-pass vlan all


 [Huawei]sys SW3 
[SW3]vlan batch 10 20 30 50
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]port link-type access
[SW3-GigabitEthernet0/0/1]port default vlan 30
[SW3-GigabitEthernet0/0/1]quit
[SW3]port-group group-member g0/0/2 g0/0/3
[SW3-port-group]port link-type trunk 
[SW3-port-group]port trunk allow-pass vlan all

 
 第二步:SW5和SW6的-基础配置 
 [Huawei]sys HX_SW5 
[HX_SW5]vlan batch 10 20 30 50
[HX_SW5]port-group group-member g0/0/1 to g0/0/3 g0/0/6
[HX_SW5-port-group]port link-type trunk 
[HX_SW5-port-group]port trunk allow-pass vlan all
[HX_SW5-port-group]quit

[HX_SW5]int vlan 10
[HX_SW5-Vlanif10]ip add 192.168.10.251 24
[HX_SW5-Vlanif10]int vlan 20
[HX_SW5-Vlanif20]ip add 192.168.20.251 24
[HX_SW5-Vlanif20]int vlan 30
[HX_SW5-Vlanif30]ip add 192.168.30.251 24
[HX_SW5-Vlanif30]int vlan 50
[HX_SW5-Vlanif50]ip add 192.168.50.251 24

[HX_SW5]int g0/0/5
[HX_SW5-GigabitEthernet0/0/5]port link-type access
[HX_SW5-GigabitEthernet0/0/5]port default vlan 50


 [Huawei]sys HX_SW6 
[HX_SW6]vlan batch 10 20 30 50
[HX_SW6]port-group group-member g0/0/1 to g0/0/3 g0/0/6
[HX_SW6-port-group]port link-type trunk 
[HX_SW6-port-group]port trunk allow-pass vlan all
[HX_SW6-port-group]quit
[HX_SW6]int vlan 10
[HX_SW6-Vlanif10]ip add 192.168.10.252 24
[HX_SW6-Vlanif10]int vlan 20
[HX_SW6-Vlanif20]ip add 192.168.20.252 24
[HX_SW6-Vlanif20]int vlan 30
[HX_SW6-Vlanif30]ip add 192.168.30.252 24
[HX_SW6-Vlanif30]int vlan 50
[HX_SW6-Vlanif50]ip add 192.168.50.252 24


 第三步:配置VRRP 
[HX_SW5]int vlan 10
[HX_SW5-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[HX_SW5-Vlanif10]vrrp vrid 10 priority 130
[HX_SW5-Vlanif10]int vlan 20
[HX_SW5-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[HX_SW5-Vlanif20]vrrp vrid 20 priority 130
[HX_SW5-Vlanif20]int vlan 30
[HX_SW5-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254


[HX_SW6]int vlan 10
[HX_SW6-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.254
[HX_SW6-Vlanif10]int vlan 20
[HX_SW6-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.254
[HX_SW6-Vlanif20]int vlan 30
[HX_SW6-Vlanif30]vrrp vrid 30 virtual-ip 192.168.30.254
[HX_SW6-Vlanif30]vrrp vrid 30 priority 130


 第四步:配置MSTP 
[HX_SW5]stp region-configuration       //进入mst域的配置
[HX_SW5-mst-region]region-name ntd2306   //创建域的名字
[HX_SW5-mst-region]instance 5 vlan 50    //创建实例树5 绑定vlan50
[HX_SW5-mst-region]instance 10 vlan 10   //创建实例树10 绑定vlan10
[HX_SW5-mst-region]instance 20 vlan 20   //创建实例树20 绑定vlan20
[HX_SW5-mst-region]instance 30 vlan 30   //创建实例树30 绑定vlan30
[HX_SW5-mst-region]active region-configuration    //激活这个区域


[HX_SW6]stp region-configuration
[HX_SW6-mst-region] region-name ntd2306
[HX_SW6-mst-region] instance 5 vlan 50
[HX_SW6-mst-region] instance 10 vlan 10
[HX_SW6-mst-region] instance 20 vlan 20
[HX_SW6-mst-region] instance 30 vlan 30
[HX_SW6-mst-region] active region-configuration


[SW1]stp region-configuration
[SW1-mst-region] region-name ntd2306
[SW1-mst-region] instance 5 vlan 50
[SW1-mst-region] instance 10 vlan 10
[SW1-mst-region] instance 20 vlan 20
[SW1-mst-region] instance 30 vlan 30
[SW1-mst-region] active region-configuration


[SW2]stp region-configuration
[SW2-mst-region] region-name ntd2306
[SW2-mst-region] instance 5 vlan 50
[SW2-mst-region] instance 10 vlan 10
[SW2-mst-region] instance 20 vlan 20
[SW2-mst-region] instance 30 vlan 30
[SW2-mst-region] active region-configuration

[SW3]stp region-configuration
[SW3-mst-region] region-name ntd2306
[SW3-mst-region] instance 5 vlan 50
[SW3-mst-region] instance 10 vlan 10
[SW3-mst-region] instance 20 vlan 20
[SW3-mst-region] instance 30 vlan 30
[SW3-mst-region] active region-configuration


[HX_SW5]stp instance 10 priority 4096      SW5是vlan10的主根
[HX_SW5]stp instance 20 priority 4096      SW5是vlan20的主根
[HX_SW5]stp instance 30 priority 8192
[HX_SW5]stp instance 5  priority 8192

[HX_SW6]stp instance 10 priority 8192
[HX_SW6]stp instance 20 priority 8192
[HX_SW6]stp instance 30 priority 4096      SW6是vlan30的主根
[HX_SW6]stp instance 5  priority 4096      SW6是vlan50的主根

 备注:另外一种设置主根和备根的配置命令---参考 
 [HX_SW6]stp instance 5 root   primary      //设置主根后,优先级默认为0
[HX_SW6]stp instance 5 root   secondary    //设置备根后,优先级默认为4096 


 第五步:配置DHCP服务器 
[Huawei]sys R3_DHCP

1)开启dhcp功能
[R3_DHCP]dhcp enable

2)创建dhcp地址池
[R3_DHCP]ip pool vlan10
[R3_DHCP-ip-pool-vlan10]network 192.168.10.0  mask 24
[R3_DHCP-ip-pool-vlan10]gateway-list 192.168.10.254
[R3_DHCP-ip-pool-vlan10]dns-list 8.8.8.8

[R3_DHCP-ip-pool-vlan10]ip pool vlan20
[R3_DHCP-ip-pool-vlan20]network 192.168.20.0 mask 24
[R3_DHCP-ip-pool-vlan20]gateway-list 192.168.20.254
[R3_DHCP-ip-pool-vlan20]dns-list 8.8.8.8

[R3_DHCP-ip-pool-vlan20]ip pool vlan30
[R3_DHCP-ip-pool-vlan30]network 192.168.30.0 mask 24
[R3_DHCP-ip-pool-vlan30]gateway-list 192.168.30.254
[R3_DHCP-ip-pool-vlan30]dns-list 8.8.8.8
[R3_DHCP-ip-pool-vlan30]quit

3)配置接口IP地址,在接口下开启基于全局的dhcp
[R3_DHCP]int g0/0/0
[R3_DHCP-GigabitEthernet0/0/0]ip add 192.168.50.1 24
[R3_DHCP-GigabitEthernet0/0/0]dhcp select global
[R3_DHCP-GigabitEthernet0/0/0]quit

4)在dhcp服务器中配置回程的默认,让dhcp服务器能够给dhcp中继回包
[R3_DHCP]ip route-static 0.0.0.0 0.0.0.0 192.168.50.251


 第六步:配置SW5和SW6-DHCP中继 
1)开启dhcp 功能
[HX_SW5]dhcp enable

2)开启dhcp中继
[HX_SW5]int vlan 10
[HX_SW5-Vlanif10]dhcp select relay 
[HX_SW5-Vlanif10]dhcp relay server-ip 192.168.50.1

[HX_SW5-Vlanif10]int vlan 20
[HX_SW5-Vlanif20]dhcp select relay
[HX_SW5-Vlanif20]dhcp relay server-ip 192.168.50.1

[HX_SW5-Vlanif20]int vlan 30
[HX_SW5-Vlanif30]dhcp select relay
[HX_SW5-Vlanif30]dhcp relay server-ip 192.168.50.1

1)开启dhcp功能
[HX_SW6]dhcp enable

2)配置dhcp中继
[HX_SW6]int vlan 10
[HX_SW6-Vlanif10]dhcp select relay
[HX_SW6-Vlanif10]dhcp relay server-ip 192.168.50.1
[HX_SW6-Vlanif10]int vlan 20
[HX_SW6-Vlanif20]dhcp select relay
[HX_SW6-Vlanif20]dhcp relay server-ip 192.168.50.1
[HX_SW6-Vlanif20]int vlan 30
[HX_SW6-Vlanif30]dhcp select relay
[HX_SW6-Vlanif30]dhcp relay server-ip 192.168.50.1


 第七步:配置接口IP地址 
[Huawei]sys ISP-dx
[ISP-dx]int g0/0/0
[ISP-dx-GigabitEthernet0/0/0]ip add 100.1.1.2 29
[ISP-dx-GigabitEthernet0/0/0]int g0/0/1
[ISP-dx-GigabitEthernet0/0/1]ip add 200.1.1.254 24

[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.15.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.16.1 24
[R1-GigabitEthernet0/0/1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip add 100.1.1.1 29

 第八步:SW5/SW6和出口设备R1互联配置 
[HX_SW5]vlan 15
[HX_SW5-vlan15]quit
[HX_SW5]int vlan 15
[HX_SW5-Vlanif15]ip add 192.168.15.5 24
[HX_SW5-Vlanif15]quit
[HX_SW5]int g0/0/7
[HX_SW5-GigabitEthernet0/0/7]port link-type access
[HX_SW5-GigabitEthernet0/0/7]port default vlan 15

[HX_SW6]vlan 16
[HX_SW6-vlan16]quit
[HX_SW6]int vlan 16
[HX_SW6-Vlanif16]ip add 192.168.16.6 24
[HX_SW6-Vlanif16]quit
[HX_SW6]int g0/0/7
[HX_SW6-GigabitEthernet0/0/7]port link-type access
[HX_SW6-GigabitEthernet0/0/7]port default vlan 16



[HX_SW5]ip route-static 0.0.0.0 0.0.0.0 192.168.15.1

[HX_SW6]ip route-static 0.0.0.0 0.0.0.0 192.168.16.1


[R1]ip route-static 192.168.10.0 24 192.168.15.5
[R1]ip route-static 192.168.10.0 24 192.168.16.6 preference  70

[R1]ip route-static 192.168.20.0 24 192.168.15.5
[R1]ip route-static 192.168.20.0 24 192.168.16.6 preference 70

[R1]ip route-static 192.168.30.0 24 192.168.16.6 
[R1]ip route-static 192.168.30.0 24 192.168.15.5 preference 70

 第九步:R1配置默认路由和NAT 
[R1]nat address-group 1 100.1.1.3 100.1.1.5
[R1]acl 2000
[R1-acl-basic-2000]rule 10 permit source 192.168.10.0 0.0.0.255
[R1-acl-basic-2000]rule 20 permit source 192.168.20.0 0.0.0.255
[R1-acl-basic-2000]rule 30 permit source 192.168.30.0 0.0.0.255
[R1-acl-basic-2000]quit
[R1]int g0/0/2
[R1-GigabitEthernet0/0/2]nat outbound 2000 address-group 1  

[R1]ip route-static 0.0.0.0 0.0.0.0 100.1.1.2


 第十步:扩展知识 
1)上行链路跟踪
[HX_SW5]int vlan 10
[HX_SW5-Vlanif10]vrrp vrid 10 track int g0/0/7 reduced  50

[HX_SW5-Vlanif10]int vlan 20
[HX_SW5-Vlanif20]vrrp vrid 20 track int g0/0/7 reduced 50


[HX_SW6]int vlan 30
[HX_SW6-Vlanif30]vrrp vrid 30 track int g0/0/7 reduced 50


[SW1]int g0/0/4
[SW1-GigabitEthernet0/0/4]port link-type access
[SW1-GigabitEthernet0/0/4]port default vlan 10



1)先关闭PC的DHCP

2)在dhcp服务器的用户视图下,重置IP地址池
<R3_DHCP>reset ip pool name vlan10 all

3)进入ip pool vlan10 ,做地址排除
<R3_DHCP>sys
[R3_DHCP]ip pool vlan10
[R3_DHCP-ip-pool-vlan10]excluded-ip-address 192.168.10.240  192.168.10.253



第二种解决方案:
[R3_DHCP]dhcp server  ping  packet 4      //开启ping探测,每次发送4个探测报文

[R3_DHCP]dhcp server ping timeout 100    //每个探测报文的超时时间为100毫秒   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值