路由器NAT负载均衡_telnet

本文涉及的产品
传统型负载均衡 CLB,每月750个小时 15LCU
网络型负载均衡 NLB,每月750个小时 15LCU
公网NAT网关,每月750个小时 15CU
简介:
拓扑图:

配置参数:

r2(config)#acc 1 per 12.1.1.3 0.0.0.0 // 配置服务器的公网 IP

r2(config)#ip nat po 1 192.168.1.2 192.168.1.3 net 255.255.255.0 type rotary // 配置服务器的内网地址范围

r2(config)#ip nat inside destination list 1 pool 1 // 配置目标 NAT 转换

r2(config)#end

测试:

r1#ping 12.1.1.1
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/48/80 ms
r1#ping 12.1.1.2
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/39/64 ms
r1#telnet 12.1.1.3
Trying 12.1.1.3 ... Open
Username: r3
Password:

r3#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            192.168.1.2     YES manual up                    up     

r3#exi
r1#telnet 12.1.1.3
Trying 12.1.1.3 ... Open
Username: r4
Password:

r4#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            192.168.1.3     YES manual up                    up     

r4#exi

r1#

r2#sh ip na tr

Pro Inside global      Inside local       Outside local      Outside global

tcp 12.1.1.3:23        192.168.1.2:23     12.1.1.1:11000     12.1.1.1:11000

tcp 12.1.1.3:23        192.168.1.3:23     12.1.1.1:11001     12.1.1.1:11001

r2#

下面是各设备的配置文件:

r3#sh run

Building configuration...

 
Current configuration : 686 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

no ip routing

!

!

no ip cef

!

!

ip ips po max-events 100

no ftp-server write-enable

!

!

!

!

!

!

!

!

!

!

!

!

!

!

username r3 privilege 15 password 0 abc

!

!

!

!

!

!

interface FastEthernet0/0

 ip address 192.168.1.2 255.255.255.0

 no ip route-cache

 duplex auto

 speed auto

!

ip default-gateway 192.168.1.1

ip http server

no ip http secure-server

ip classless

!

!

!

!

!

control-plane

!

!

!

!

!

!

!

!        

!

line con 0

line aux 0

line vty 0 4

 login local

!

!

end

 
r3# 

r4#sh run

Building configuration...

 
Current configuration : 686 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname r4

!

boot-start-marker

boot-end-marker

!

!

memory-size iomem 5

no aaa new-model

ip subnet-zero

no ip routing

!

!

no ip cef

!

!

ip ips po max-events 100

no ftp-server write-enable

!

!

!

!

!

!

!

!

!

!

!

!

!

!

username r4 privilege 15 password 0 abc

!

!

!

!

!

!

interface FastEthernet0/0

 ip address 192.168.1.3 255.255.255.0

 no ip route-cache

 duplex auto

 speed auto

!

ip default-gateway 192.168.1.1

ip http server

no ip http secure-server

ip classless

!

!

!

!

!

control-plane

!

!

!

!

!

!

!

!        

!

line con 0

line aux 0

line vty 0 4

 login local

!

!

end

 
r4# 

r5#sh run

Building configuration...

 
Current configuration : 1332 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname r5

!

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

!

ip http server

no ip http secure-server

ip classless

!

!

!

!

!

control-plane

!

!

!

!        

!

!

!

!

!

line con 0

line aux 0

line vty 0 4

!

!

end

 
r5#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  up                    up     

r5#

r1#sh run

Building configuration...

 
Current configuration : 769 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname r1

!

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

 ip address 12.1.1.1 255.255.255.0

 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

!

ip http server

no ip http secure-server

ip classless

!

!

!

!        

!

control-plane

!

!

!

!

!

!

!

!

!

line con 0

line aux 0

line vty 0 4

!

!

end

 
r1#

r2#sh run

Building configuration...

 
Current configuration : 1157 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

 ip address 12.1.1.2 255.255.255.0

 ip nat outside

 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 192.168.1.1 255.255.255.0

 ip nat inside

 ip virtual-reassembly

 duplex auto

 speed auto

!

interface FastEthernet2/0

 no ip address

 shutdown

 duplex auto

 speed auto

!

ip http server

no ip http secure-server

ip classless

!

ip nat pool 1 192.168.1.2 192.168.1.3 netmask 255.255.255.0 type rotary

ip nat inside destination list 1 pool 1

!

!

access-list 1 permit 12.1.1.3

!

!

control-plane

!

!

!        

!

!

!

!

!

!

line con 0

line aux 0

line vty 0 4

!

!

end

 
r2#




      本文转自810105851 51CTO博客,原文链接:http://blog.51cto.com/4708948/1133039 ,如需转载请自行联系原作者






相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
相关文章
|
11月前
|
负载均衡 应用服务中间件 Linux
企业实战(13)LVS负载均衡NAT(网络地址转换)模式实战详解(一)
企业实战(13)LVS负载均衡NAT(网络地址转换)模式实战详解(一)
151 0
|
3月前
|
数据安全/隐私保护 网络架构
虚拟路由器中的Source NAT与Static NAT
虚拟路由器中的Source NAT与Static NAT
|
4月前
|
负载均衡 网络协议
NAT模式 LVS负载均衡部署
NAT模式 LVS负载均衡部署
|
12月前
|
存储 负载均衡 应用服务中间件
LVS负载均衡群集——NAT模式实操
LVS负载均衡群集——NAT模式实操
582 0
|
网络架构
交换机与路由器技术-34-动态NAT
交换机与路由器技术-34-动态NAT
60 1
|
网络架构
交换机与路由器技术-35-NAT转换-PAT
交换机与路由器技术-35-NAT转换-PAT
31 0
|
网络架构
交换机与路由器技术-33-静态NAT
交换机与路由器技术-33-静态NAT
47 0
|
负载均衡 调度
NAT负载均衡
NAT负载均衡
105 0
|
运维 数据中心 网络虚拟化
《企业运维之云上网络原理与实践》——第三章 云上网络VPC&EIP&NAT&共享宽带&SLB——云上网络VPC&EIP&NAT&共享带宽&SLB(上)(1)
《企业运维之云上网络原理与实践》——第三章 云上网络VPC&EIP&NAT&共享宽带&SLB——云上网络VPC&EIP&NAT&共享带宽&SLB(上)(1)
349 0
|
弹性计算 运维 安全
《企业运维之云上网络原理与实践》——第三章 云上网络VPC&EIP&NAT&共享宽带&SLB——云上网络VPC&EIP&NAT&共享带宽&SLB(上)(2)
《企业运维之云上网络原理与实践》——第三章 云上网络VPC&EIP&NAT&共享宽带&SLB——云上网络VPC&EIP&NAT&共享带宽&SLB(上)(2)
306 0