配置静态NAT, Easy IP, 三层交换配置VRRP, 网络负载均衡

 

  1. 案例1:配置静态NAT
  2. 案例2:Easy IP
  3. 案例3:三层交换配置VRRP
  4. 案例4:网络负载均衡

1 案例1:配置静态NAT

1.1 问题

按照图-1拓扑图所示,在R1上配置静态NAT使192.168.2.1转换为100.0.0.2,192.168.2.2转换为100.0.0.3,实现外部网络访问

图-1

1.2 步骤

实现此案例需要按照如下步骤进行。

步骤一:配置静态NAT

pc3无需配置网关

 
  1. [Huawei]interface GigabitEthernet 0/0/0
  2. [Huawei-GigabitEthernet0/0/0] ip address 100.0.0.1 8
  3. [Huawei-GigabitEthernet0/0/0]nat static global 100.0.0.2 inside 192.168.2.1
  4. [Huawei-GigabitEthernet0/0/0]nat static global 100.0.0.3 inside 192.168.2.2

2 案例2:Easy IP

2.1 问题

按照图-2所示的拓扑结构,在R1上配置Easy IP使企业内网192.168.2.0/24利用g0/0/0端口的ip,实现外部网络的访问

图-2

2.2 步骤

实现此案例需要按照如下步骤进行

步骤一:配置静态NAT

注:以下命令需要在路由器配置好ip的基础上完成

 
  1. [Huawei]acl 2000    
  2. [Huawei-acl-basic-2000]rule permit source any //使用acl定义任何内部地址
  3. [Huawei]interface g0/0/0
  4. [Huawei-GigabitEthernet0/0/0]nat outbound 2000 //可以利用g0/0/0的ip访问外网

3 案例3:三层交换配置VRRP

3.1 问题

按照图-3所示拓扑结构,在三层交换机配置热备份路由协议使组内两个出口设备共享一个虚拟ip地址192.168.1.254为内网主机的网关

图-3

3.2 步骤

本实验暂不考虑NAT问题

步骤一:pc配置ip

pc设备配置ip与网关,192.168.1.1的网关为192.168.1.254

192.168.4.1的网关为192.168.4.254

步骤二:路由器配置

路由器配置

 
  1. system-view
  2. [Huawei]interface GigabitEthernet 0/0/0
  3. [Huawei-GigabitEthernet0/0/0]ip address 192.168.2.1 24
  4. [Huawei]interface GigabitEthernet 0/0/1
  5. [Huawei-GigabitEthernet0/0/1]ip address 192.168.3.1 24
  6. [Huawei]interface GigabitEthernet 0/0/2
  7. [Huawei-GigabitEthernet0/0/2]ip address 192.168.4.254 24
  8.  
  9. [Huawei]ospf    
  10. [Huawei-ospf-1]area 0
  11. [Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
  12. [Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
  13. [Huawei-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255

步骤三:交换机配置

1)MS1

 
  1. system-view
  2. [Huawei]interface Vlanif 1
  3. [Huawei-Vlanif1]ip add 192.168.1.252 24
  4. [Huawei]vlan 2
  5. [Huawei-vlan2]quit
  6. [Huawei]interface Vlanif 2
  7. [Huawei-Vlanif2]ip address 192.168.2.2 24
  8. [Huawei-Vlanif2]quit
  9. [Huawei]interface GigabitEthernet 0/0/2
  10. [Huawei-GigabitEthernet0/0/2]port link-type access
  11. [Huawei-GigabitEthernet0/0/2]port default vlan 2
  12.  
  13. [Huawei]ospf    
  14. [Huawei-ospf-1]area 0
  15. [Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
  16. [Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
  17.  
  18. [Huawei]interface Vlanif 1
  19. [Huawei-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254

2)MS2

 
  1. system-view
  2. [Huawei]interface Vlanif 1
  3. [Huawei-Vlanif1]ip add 192.168.1.253 24
  4. [Huawei]vlan 3
  5. [Huawei-vlan3]quit
  6. [Huawei]interface Vlanif 3
  7. [Huawei-Vlanif3]ip address 192.168.3.2 24
  8. [Huawei-Vlanif3]quit
  9. [Huawei]interface GigabitEthernet 0/0/2
  10. [Huawei-GigabitEthernet0/0/2]port link-type access
  11. [Huawei-GigabitEthernet0/0/2]port default vlan 3
  12.  
  13. [Huawei]ospf    
  14. [Huawei-ospf-1]area 0
  15. [Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
  16. [Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
  17.  
  18. [Huawei]interface Vlanif 1
  19. [Huawei-Vlanif1]vrrp vrid 1 virtual-ip 192.168.1.254

4 案例4:网络负载均衡

4.1 问题

按照图-4所示拓扑结构,配置MS1为vlan10的主路由器、vlan20的备份路由器,MS2为vlan10的备份路由器、vlan20的主路由器,实现负载均衡的效果

图-4

4.2 步骤

实现此案例需要按照如下步骤进行

步骤一:配置交换机

1)MS1

 
  1. [Huawei]interface Vlanif 10
  2. [Huawei-Vlanif10]ip address 192.168.10.252 24
  3. [Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
  4. [Huawei-Vlanif10]vrrp vrid 1 priority 110
  5.  
  6. [Huawei]interface Vlanif 20
  7. [Huawei-Vlanif20]ip address 192.168.20.252 24
  8. [Huawei-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.254

1)MS2

 
  1. [Huawei]interface Vlanif 10
  2. [Huawei-Vlanif10]ip address 192.168.10.253 24
  3. [Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
  4.  
  5. [Huawei]interface Vlanif 20
  6. [Huawei-Vlanif20]ip address 192.168.20.253 24
  7. [Huawei-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.254
  8. [Huawei-Vlanif20]vrrp vrid 2 priority 110

你可能感兴趣的:(配置静态NAT, Easy IP, 三层交换配置VRRP, 网络负载均衡)