拓扑图:
配置参数:
R2:
ip nat pool 1 10.1.2.2 10.1.2.3 netmask 255.255.255.0 type rotary //内网服务器地址池
ip nat inside destination list 1 pool 1 //目标NAT绑定
access-list 1 permit 192.168.1.2 //路由器外网接口IP地址
interface FastEthernet1/0
ip nat inside //内网接口
interface FastEthernet2/0
ip nat outside   //外网接口
计算机配置情况:
电脑上有3块网卡:
本地连接-----桥接====>C3
VMware Network Adapter-----桥接====>C1
VirtualBox Host-Only Network-----桥接====>C2
FTP服务器:
C1:
C2:
C3:
以太网适配器 本地连接:

 

   连接特定的 DNS 后缀 . . . . . . . : domain
   本地链接 IPv6 地址. . . . . . . . : fe80::3836:3343:add:768f%13
   IPv4 地址 . . . . . . . . . . . . : 192.168.1.100
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   默认网关. . . . . . . . . . . . . : 192.168.1.1

 

以太网适配器 VirtualBox Host-Only Network:

 

   连接特定的 DNS 后缀 . . . . . . . :
   本地链接 IPv6 地址. . . . . . . . : fe80::b5f2:e1a1:e34e:5847%23
   IPv4 地址 . . . . . . . . . . . . : 10.1.2.5  ---------->对应虚拟机的C2
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   默认网关. . . . . . . . . . . . . : 10.1.2.1

 

以太网适配器 VMware Network Adapter VMnet1:

 

   连接特定的 DNS 后缀 . . . . . . . :
   本地链接 IPv6 地址. . . . . . . . : fe80::896:5b4c:a949:d0e3%30
   IPv4 地址 . . . . . . . . . . . . : 10.1.2.4  ---------->对应虚拟机的C1
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   默认网关. . . . . . . . . . . . . : 10.1.2.1
测试:
在C3(真机)上登陆FTP:可以看到登陆到了10.1.2.2的FTP服务器上面!
C:\Users\lenovo>ftp 192.168.1.2
连接到 192.168.1.2。
220 Microsoft FTP Service
用户(192.168.1.2:(none)): administrator
331 Password required for administrator.
密码:
230 User administrator logged in.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
02-08-13  02:33PM                    4 ftp1.txt
226 Transfer complete.
ftp: 收到 49 字节,用时 0.00秒 24.50千字节/秒。
ftp>

 

r2#sh ip na tr
Pro Inside global      Inside local       Outside local      Outside global
tcp 192.168.1.2:21     10.1.2.2:21        192.168.1.100:54476 192.168.1.100:54476
r2#
在C3(真机)上再次登陆FTP:可以看到自动转换到了10.1.2.3的FTP服务器上面!
C:\Users\lenovo>ftp 192.168.1.2
连接到 192.168.1.2。
220 Microsoft FTP Service
用户(192.168.1.2:(none)): administrator
331 Password required for administrator.
密码:
230 User administrator logged in.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
02-08-13  01:09PM                   24 ftp2.txt
226 Transfer complete.
ftp: 收到 49 字节,用时 0.00秒 49000.00千字节/秒。
ftp>

 

r2#sh ip na tr
Pro Inside global      Inside local       Outside local      Outside global
tcp 192.168.1.2:21     10.1.2.2:21        192.168.1.100:54476 192.168.1.100:54476
tcp 192.168.1.2:20     10.1.2.3:20        192.168.1.100:54484 192.168.1.100:54484
tcp 192.168.1.2:21     10.1.2.3:21        192.168.1.100:54483 192.168.1.100:54483
r2#
可以看到TPC负载均衡配置成功!
问题:
只有将FTP服务器的外网IP配置成路由器的外网接口才可以测试成功!配置成其它的IP就测试不成功。
下面是各设备的配置文件:
r2#sh run
Building configuration...

 

Current configuration : 1184 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
ip ips po max-events 100
no ftp-server write-enable
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Serial0/0
 no ip address
 ip virtual-reassembly
 serial restart-delay 0
!
interface Serial0/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial0/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial0/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface FastEthernet1/0
 ip address 10.1.2.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet2/0
 ip address 192.168.1.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
ip http server
no ip http secure-server
ip classless
!
ip nat pool 1 10.1.2.2 10.1.2.3 netmask 255.255.255.0 type rotary
ip nat inside destination list 1 pool 1
!
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
!
control-plane
!
!
!        
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
!
end

 

r2#
r2# sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial0/0                  unassigned      YES manual up                    down   
Serial0/1                  unassigned      YES NVRAM  administratively down down   
Serial0/2                  unassigned      YES NVRAM  administratively down down   
Serial0/3                  unassigned      YES NVRAM  administratively down down   
FastEthernet1/0            10.1.2.1        YES NVRAM  up                    up     
FastEthernet2/0            192.168.1.2     YES manual up                    up     
r2#
r3#sh run
Building configuration...

 

Current configuration : 1342 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r3
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
ip cef
!
!
ip ips po max-events 100
no ftp-server write-enable
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
!        
interface FastEthernet0/1
 no ip address
!
interface FastEthernet0/2
 no ip address
!
interface FastEthernet0/3
 no ip address
 shutdown
!
interface FastEthernet0/4
 no ip address
 shutdown
!
interface FastEthernet0/5
 no ip address
 shutdown
!
interface FastEthernet0/6
 no ip address
 shutdown
!
interface FastEthernet0/7
 no ip address
 shutdown
!
interface FastEthernet0/8
 no ip address
 shutdown
!
interface FastEthernet0/9
 no ip address
 shutdown
!
interface FastEthernet0/10
 no ip address
 shutdown
!
interface FastEthernet0/11
 no ip address
 shutdown
!
interface FastEthernet0/12
 no ip address
 shutdown
!        
interface FastEthernet0/13
 no ip address
 shutdown
!
interface FastEthernet0/14
 no ip address
 shutdown
!
interface FastEthernet0/15
 no ip address
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip http server
no ip http secure-server
ip classless
!
!
!
!        
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
!
!
end

 

r3#
r3# sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  up                    up     
FastEthernet0/1            unassigned      YES unset  up                    up     
FastEthernet0/2            unassigned      YES unset  up                    up     
FastEthernet0/3            unassigned      YES unset  administratively down down   
FastEthernet0/4            unassigned      YES unset  administratively down down   
FastEthernet0/5            unassigned      YES unset  administratively down down   
FastEthernet0/6            unassigned      YES unset  administratively down down   
FastEthernet0/7            unassigned      YES unset  administratively down down   
FastEthernet0/8            unassigned      YES unset  administratively down down   
FastEthernet0/9            unassigned      YES unset  administratively down down   
FastEthernet0/10           unassigned      YES unset  administratively down down   
FastEthernet0/11           unassigned      YES unset  administratively down down   
FastEthernet0/12           unassigned      YES unset  administratively down down   
FastEthernet0/13           unassigned      YES unset  administratively down down   
FastEthernet0/14           unassigned      YES unset  administratively down down   
FastEthernet0/15           unassigned      YES unset  administratively down down   
Vlan1                      unassigned      YES unset  administratively down down   
r3#

 

转载于:https://blog.51cto.com/4708948/1133153

NAT负载均衡_ftp相关推荐

  1. 路由器NAT负载均衡实验过程详解

    实验拓扑图: 实验环境配置说明: 1.将R1的Fa0/0接口的IP设为:192.168.2.1/24,S1/2接口的IP设为:202.96.134.1/24: 2.将R2的S1/2接口的IP设为:20 ...

  2. 端口映射与NAT负载均衡

    4.1 实验目的 (1)理解端口静态映射的作用: (2)理解负载均衡的用途: (3)掌握NAT端口映射的配置: (4)掌握基于TCP的NAT负载均衡的配置: (5)掌握NAT均衡负载的测试: 4.2 ...

  3. LVS nat 负载均衡实验

    clint  本地物理机   192.168.0.196 (director)VIP                 192.168.0.146 (director)DIP               ...

  4. 负载均衡策略深入剖析

    在实际应用中,我们可能不想仅仅是把客户端的服务请求平均地分配给内部服务器,而不管服务器是否宕机.而是想使Pentium III服务器比Pentium II能接受更多的服务请求,一台处理服务请求较少的服 ...

  5. 【万字长文】吃透负载均衡

    首先告诉大家一件事,在十一国庆期间,引擎的机器又又...又扛不住了流量. 经过监控分析,发现某个服务的一个实例所在的虚拟机扛不住了,所以采取临时措施流量控制之后,问题解决了,但还是造成了不小的损失. ...

  6. 四层和七层负载均衡的区别介绍--转

    简单理解四层和七层负载均衡:①所谓四层就是基于IP+端口的负载均衡:七层就是基于URL等应用层信息的负载均衡:同理,还有基于MAC地址的二层负载均衡和基于IP地址的三层负载均衡. 换句换说,二层负载均 ...

  7. 简单讲解一下负载均衡、反向代理模式的优点、缺点

    (1)反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端 ...

  8. Web负载均衡学习笔记之四层和七层负载均衡的区别

    0x00 简介 简单理解四层和七层负载均衡: ① 所谓四层就是基于IP+端口的负载均衡:七层就是基于URL等应用层信息的负载均衡:同理,还有基于MAC地址的二层负载均衡和基于IP地址的三层负载均衡. ...

  9. 四层和七层负载均衡的区别介绍(转载)

    简单理解四层和七层负载均衡: ①所谓四层就是基于IP+端口的负载均衡:七层就是基于URL等应用层信息的负载均衡:同理,还有基于MAC地址的二层负载均衡和基于IP地址的三层负载均衡. 换句换说,二层负载 ...

最新文章

  1. 哈希表(HashMap)分析及实现(JAVA)
  2. 分布式监控报警平台Centreon之:Centreon依赖安装
  3. 排序算法_桶排序(箱排序)
  4. 创建自定义地理(坐标)变换
  5. 单片机实验-DA实验
  6. java多态可以传匿名对象吗_Java复习笔记2--匿名类和多态
  7. Python菜鸟之python入门
  8. linux-文件管理-不完整版
  9. 2019年Java程序设计讲课笔记目录
  10. LeetCode刷题(1)
  11. 用友u8不显示服务器名,用友u8提示对数据库服务器名
  12. IntelliJ IDEA 配置svn及使用
  13. 【领域建模】UML类图工具推荐
  14. html表格合并内外边框,table 表格边框合并为单一的边框的方法
  15. 开机就显示重启界面,Lenovo重装Win 10系统的解决办法之一
  16. Android的WebView如何播放视频和全屏视频(腾讯X5内核)
  17. 已解决Idea创建maven工程没有src目录的情况
  18. 教师计算机应用基础知识,计算机应用基础
  19. ap模式和sta模式共存_让无线网卡同时工作在 AP 和 STA 模式
  20. HDS相关(二)之具有Flash Access保护的HTTP Dynamic Streaming

热门文章

  1. mybatis plus 日志打印_Mybatis-plus常用API全套教程,看完没有不懂的
  2. php 判断下载状态,php下载文件显示进度(适用于CLI模式或长连接)
  3. 形成性考核(计算机应用基础) 答案,2019年最新电大《计算机应用基础(Win7)》形成性考核册及答案.pdf...
  4. 在java中如何输入角度_在Java中以特定角度绘制一条线
  5. 数据预处理包括哪些内容python_常见的数据预处理--python篇
  6. 百度地图 json 区域 数据_获取百度地图可视区域范围的数据
  7. 【电脑帮助】解决Wind10系统照片中自带的保存的图片和本机照片的问题
  8. short类型占16位,可以赋给short类型的最大值32767,最小值为-32768
  9. vscode ---- 插件
  10. JavaSE----变量、String、运算符、流程控制