PT上的NAT配置
2017-12-06 17:21
141 查看
NAT
静态NAT
----
步骤 1:静态映射公有
IP 地址到私有 IP
地址。
ISP
以外的外部主机可以访问与 R2
相连的内部服务器。将公有 IP
地址 209.165.200.254
静态指定为NAT
用来映射数据包到内部服务器私有 IP
地址 192.168.20.254
的地址。
R2(config)#ip nat inside source static 192.168.20.254209.165.200.254
步骤 2:指定内部和外部
NAT 接口。
NAT
工作之前,必须指定哪些接口是内部接口,哪些接口是外部接口。
R2(config)#interface serial 0/0/1
R2(config-if)#ip nat outside
R2(config-if)#interface fa0/0
R2(config-if)#ip nat inside
步骤 3:检验静态
NAT 配置。
从 ISP ping
公有IP
地址 209.165.200.254。
动态 NAT
静态 NAT
建立了内部地址与特定公有地址之间的永久性映射。而动态 NAT
则是将私有 IP
地址临时映射到公有地址,这些公有 IP
地址源自 NAT
地址池。
步骤 1:定义全局地址池。
创建一个地址池,以便将符合条件的源地址转换为其中的地址。以下命令创建名为 MY-NAT-POOL 的地址池,符合条件的源地址将被转换为209.165.200.241
- 209.165.200.246 范围内的可用 IP
地址。
R2(config)#ip nat poolMY-NAT-POOL 209.165.200.241 209.165.200.246 netmask
255.255.255.248
步骤 2:创建标准访问控制列表,以便确定需要转换的内部地址。
R2(config)#ip access-list extended NAT
R2(config-std-nacl)#permit ip 192.168.10.00.0.0.255 any
R2(config-std-nacl)#permit ip 192.168.11.00.0.0.255 any
步骤 3:将地址池与访问控制列表绑定,建立动态源地址转换。
一台路由器可以具有一个以上的 NAT
池和一个以上的ACL。以下命令告知路由器使用哪个地址池来转换 ACL
允许的主机。
R2(config)#ip natinside source list NAT pool MY-NAT-POOL
步骤 4:指定内部和外部
NAT 接口。
您已经指定静态 NAT
配置的内部接口和外部接口。现在将链接到 R1
的串行接口添加为内部接口。
R2(config)#interface serial 0/0/0
R2(config-if)#ip nat inside
步骤 5:检验配置。
从 PC1
和PC2 ping ISP。然后在 R2
上使用 show ip nat translations 命令检验
NAT。
R2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 209.165.200.241 192.168.10.11 --- ---
--- 209.165.200.242 192.168.11.11 --- ---
--- 209.165.200.254 192.168.20.254 --- ---
NAT
过载
通过跟踪端口号,NAT过载允许多位内部用户重用公有 IP
地址。
本任务中,您将删除前一任务中配置的地址池和映射语句。然后在 R2
上配置 NAT
过载,以便连接任何外部设备时,所有内部IP
地址能被转换为 R2 S0/0/1
地址。
步骤 1:删除NAT
地址池和映射语句。
使用以下命令删除NAT
地址池和到 NAT ACL
的映射。
R2(config)#no ipnat pool MY-NAT-POOL 209.165.200.241 209.165.200.246 netmask 255.255.255.248
R2(config)#no ip nat inside source list NAT poolMY-NAT-POOL
----------如果接收到以下消息,请清除 NAT
转换。
%Pool MY-NAT-POOL in use, cannot destroy
R2#clear ip nat translation *
步骤 2:使用serial
0/0/1 接口公有 IP
地址在 R2
上配置PAT。
配置与动态NAT
相似,不同之处在于不是使用地址池,而是使用 interface 关键字来识别外部
IP 地址。因此没有定义 NAT
池。利用 overload 关键字可以将端口号添加到转换中。
因为已经配置ACL
来确定转换哪些内部 IP
地址,并且已经指定哪些接口是内部接口和外部接口,所以只需配置以下命令:
R2(config)#ip natinside source list NAT interface S0/0/1 overload
步骤 3:检验配置。
从PC1
和 PC2 ping ISP。然后在 R2
上使用 show ip nat translations 命令检验
NAT。
R2#show ip nattranslations
Pro Inside global Inside local Outside local Outside global
icmp 209.165.200.225:3 192.168.10.11:3 209.165.200.226:3 209.165.200.226:3
icmp 209.165.200.225:1024192.168.11.11:3 209.165.200.226:3 209.165.200.226:1024
--- 209.165.200.254 192.168.20.254 --- ---
注:前一任务中,您可以将关键字 overload 添加到 ip
nat inside sourcelist NAT pool MY-NAT-POOL 命令中,以允许六位以上的用户同时访问外部。
静态NAT
----
步骤 1:静态映射公有
IP 地址到私有 IP
地址。
ISP
以外的外部主机可以访问与 R2
相连的内部服务器。将公有 IP
地址 209.165.200.254
静态指定为NAT
用来映射数据包到内部服务器私有 IP
地址 192.168.20.254
的地址。
R2(config)#ip nat inside source static 192.168.20.254209.165.200.254
步骤 2:指定内部和外部
NAT 接口。
NAT
工作之前,必须指定哪些接口是内部接口,哪些接口是外部接口。
R2(config)#interface serial 0/0/1
R2(config-if)#ip nat outside
R2(config-if)#interface fa0/0
R2(config-if)#ip nat inside
步骤 3:检验静态
NAT 配置。
从 ISP ping
公有IP
地址 209.165.200.254。
动态 NAT
静态 NAT
建立了内部地址与特定公有地址之间的永久性映射。而动态 NAT
则是将私有 IP
地址临时映射到公有地址,这些公有 IP
地址源自 NAT
地址池。
步骤 1:定义全局地址池。
创建一个地址池,以便将符合条件的源地址转换为其中的地址。以下命令创建名为 MY-NAT-POOL 的地址池,符合条件的源地址将被转换为209.165.200.241
- 209.165.200.246 范围内的可用 IP
地址。
R2(config)#ip nat poolMY-NAT-POOL 209.165.200.241 209.165.200.246 netmask
255.255.255.248
步骤 2:创建标准访问控制列表,以便确定需要转换的内部地址。
R2(config)#ip access-list extended NAT
R2(config-std-nacl)#permit ip 192.168.10.00.0.0.255 any
R2(config-std-nacl)#permit ip 192.168.11.00.0.0.255 any
步骤 3:将地址池与访问控制列表绑定,建立动态源地址转换。
一台路由器可以具有一个以上的 NAT
池和一个以上的ACL。以下命令告知路由器使用哪个地址池来转换 ACL
允许的主机。
R2(config)#ip natinside source list NAT pool MY-NAT-POOL
步骤 4:指定内部和外部
NAT 接口。
您已经指定静态 NAT
配置的内部接口和外部接口。现在将链接到 R1
的串行接口添加为内部接口。
R2(config)#interface serial 0/0/0
R2(config-if)#ip nat inside
步骤 5:检验配置。
从 PC1
和PC2 ping ISP。然后在 R2
上使用 show ip nat translations 命令检验
NAT。
R2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 209.165.200.241 192.168.10.11 --- ---
--- 209.165.200.242 192.168.11.11 --- ---
--- 209.165.200.254 192.168.20.254 --- ---
NAT
过载
通过跟踪端口号,NAT过载允许多位内部用户重用公有 IP
地址。
本任务中,您将删除前一任务中配置的地址池和映射语句。然后在 R2
上配置 NAT
过载,以便连接任何外部设备时,所有内部IP
地址能被转换为 R2 S0/0/1
地址。
步骤 1:删除NAT
地址池和映射语句。
使用以下命令删除NAT
地址池和到 NAT ACL
的映射。
R2(config)#no ipnat pool MY-NAT-POOL 209.165.200.241 209.165.200.246 netmask 255.255.255.248
R2(config)#no ip nat inside source list NAT poolMY-NAT-POOL
----------如果接收到以下消息,请清除 NAT
转换。
%Pool MY-NAT-POOL in use, cannot destroy
R2#clear ip nat translation *
步骤 2:使用serial
0/0/1 接口公有 IP
地址在 R2
上配置PAT。
配置与动态NAT
相似,不同之处在于不是使用地址池,而是使用 interface 关键字来识别外部
IP 地址。因此没有定义 NAT
池。利用 overload 关键字可以将端口号添加到转换中。
因为已经配置ACL
来确定转换哪些内部 IP
地址,并且已经指定哪些接口是内部接口和外部接口,所以只需配置以下命令:
R2(config)#ip natinside source list NAT interface S0/0/1 overload
步骤 3:检验配置。
从PC1
和 PC2 ping ISP。然后在 R2
上使用 show ip nat translations 命令检验
NAT。
R2#show ip nattranslations
Pro Inside global Inside local Outside local Outside global
icmp 209.165.200.225:3 192.168.10.11:3 209.165.200.226:3 209.165.200.226:3
icmp 209.165.200.225:1024192.168.11.11:3 209.165.200.226:3 209.165.200.226:1024
--- 209.165.200.254 192.168.20.254 --- ---
注:前一任务中,您可以将关键字 overload 添加到 ip
nat inside sourcelist NAT pool MY-NAT-POOL 命令中,以允许六位以上的用户同时访问外部。
相关文章推荐
- asav931 ipv6 配置 nat-pt
- 配置静态IPV6 NAT-PT
- NAT-PT原理与配置
- 9.4.3 使用iptables配置目的NAT
- 做好企业NAT配置验证工作
- LVS集群的体系结构及NAT 模式配置
- juniper配置-静态NAT
- 配置lvs nat模式下real server服务器端lvsrs脚本
- VMWare虚拟机下为Ubuntu 12.04.1配置静态IP(NAT方式)
- Ubuntu ufw 配置nat
- NAT配置模版
- 乌邦图ubuntu配置iptables的NAT上网
- AR28/AR46系列路由器用出接口地址做Easy NAT的典型配置方法
- 交换机VLAN划分配置(PT模拟器)
- CISCO NAT 经典配置合集
- 感受VMware NAT对应用层协议的影响(配置guest机FTP server蛋疼实录)
- 防火墙配置十大任务之三,无NAT要素的两个接口配置
- 华为 配置NAT 配置PNAT
- virtualbox网络配置之NAT,NAT网络,桥接
- vmware 7虚拟机中的Redhat Enterprise Linux5通过NAT方式配置ip上网(通用)