目的:在1.1 1.2 1.3 三台内网的服务器访问外网的服务器(202.1.1.2)时,将内网ip转换为外网ip。

1.设置内网三台服务器的Ip ,网关,以及外网服务器的ip网关

分别为:192.168.1.1 192.168.1.254

    192.168.1.2 192.168.1.254

    192.168.1.3 192.168.1.254

    202.1.1.2     202.1.1.1

2.设置路由器端口ip

Router(config-if)#inter f 0/0
Router(config-if)#ip add 192.168.1.254 255.255.255.0
Router(config-if)#inter f 1/0 
Router(config-if)#ip add 202.1.1.1 255.255.255.0

3.标明内外网借口

Router(config-if)#inter f 1/0 
Router(config-if)#ip nat out
Router(config-if)#inter f 0/0
Router(config-if)#ip nat in

4.配置nat

Router(config)#ip nat in sour  static 192.168.1.1 202.1.1.3 
Router(config)#ip nat in sour  static 192.168.1.2 202.1.1.4
Router(config)#ip nat in sour  static 192.168.1.3 202.1.1.5

5.查看

Router#sh ip nat t
Pro  Inside global     Inside local       Outside local      Outside global
---  202.1.1.3         192.168.1.1        ---                ---
---  202.1.1.4         192.168.1.2        ---                ---
---  202.1.1.5         192.168.1.3        ---                ---

 

posted on 2017-12-24 21:09  song.yan  阅读(508)  评论(0)    收藏  举报