CiscoNAT技术之StaticNAT


先来一段配置吧,很简单的


ASR1002-15#show running-config interface gigabitEthernet 0/0/0

Building configuration...

Current configuration : 130 bytes
!
interface GigabitEthernet0/0/0
 ip address 5.1.0.1 255.255.255.0
 ip nat inside
 negotiation auto
 ipv6 enable
 cdp enable
end

ASR1002-15#show running-config interface gigabitEthernet 0/0/1

Building configuration...

Current configuration : 132 bytes
!
interface GigabitEthernet0/0/1
 ip address 50.1.1.1 255.255.255.0
 ip nat outside
 negotiation auto
 ipv6 enable
 cdp enable
end

ASR1002-15#show run
ASR1002-15#show running-config | s ip nat 
 ip nat inside
 ip nat outside
<strong>ip nat inside source static 5.1.0.10 50.1.1.22</strong>


该配置就是最简单的static nat的配置,目的是把inside接口收到的source ip address是5.1.0.10的数据包翻译成source ip address是50.1.1.22.


因为使用了VOICE流量,SIP ALG自动触发, 因此,存在3个数据流,一个是5060端口的SIP数据包,一个是RTP, 一个是RTCP。

ASR1002-15#show ip nat translations 
Pro  Inside global         Inside local          Outside local         Outside global
---  50.1.1.22             5.1.0.10              ---                   ---
udp  50.1.1.22:6058        5.1.0.10:6058         50.1.1.11:6058        50.1.1.11:6058
udp  50.1.1.22:6059        5.1.0.10:6059         50.1.1.11:6059        50.1.1.11:6059
<strong>udp  50.1.1.22:5060        5.1.0.10:5060         50.1.1.11:5060        50.1.1.11:5060</strong>
Total number of translations: 4

ASR1002-15#

很明显,inside local地址翻译成了inside global地址



此外,因为是ALG流量,NAT特意为ALG开了door,方便RTP以及RTCP通过

ASR1002-15#show platform hardware qfp active feature nat datapath door  

DOOR global stats: door_count 2  door_limit_fail_count 0
 Door 0x89b9f220  IL:5.1.0.10 IG:50.1.1.22 OL:50.1.1.11 OG:50.1.1.11 ILP:0 IGP:0 OLP:5060 OGP:5060 proto 17 flags 0x200 vrf_id 0 idx 2140
 Door 0x89b9f1c0  IL:5.1.0.10 IG:50.1.1.22 OL:50.1.1.11 OG:50.1.1.11 ILP:5060 IGP:5060 OLP:0 OGP:0 proto 17 flags 0x100 vrf_id 0 idx 2843
ASR1002-15#


由于是static NAT的缘故,在固定IP 地址基础上,还生产了一条新的记录。

这样,从outside那边可以直接ping到50.1.1.22了。这是static nat特有的


ASR1002-15#show ip alias
Load for five secs: 2%/0%; one minute: 2%; five minutes: 2%
Time source is NTP, *18:17:49.406 CST Fri Sep 12 2014

Address Type             IP Address      Port
Interface                5.1.0.1 
Interface                10.74.30.172 
Interface                50.1.1.1 
<strong>Dynamic                  50.1.1.22</strong> 
Interface                192.168.1.2 
ASR1002-15#




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值