基于源和目标地址的NAT转换

   在有些应用场景中,我们需要对IP报文的源和目的同时做转换,据此我们做了如下的实验:


验证:
R2#
R2#ping 13.1.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/54/120 ms
R2#
R1#debug ip nat
IP NAT debugging is on
R1#
*Mar 1 00:29:34.799: NAT: s=12.1.1.2->13.1.1.11, d=13.1.1.5 [25]
*Mar 1 00:29:34.799: NAT: s=13.1.1.11, d=13.1.1.5->3.3.3.3 [25]
*Mar 1 00:29:34.883: NAT*: s=3.3.3.3->13.1.1.5, d=13.1.1.11 [25]
*Mar 1 00:29:34.883: NAT*: s=13.1.1.5, d=13.1.1.11->12.1.1.2 [25]
*Mar 1 00:29:34.907: NAT: s=12.1.1.2->13.1.1.11, d=13.1.1.5 [26]
*Mar 1 00:29:34.907: NAT: s=13.1.1.11, d=13.1.1.5->3.3.3.3 [26]
*Mar 1 00:29:34.939: NAT*: s=3.3.3.3->13.1.1.5, d=13.1.1.11 [26]
*Mar 1 00:29:34.939: NAT*: s=13.1.1.5, d=13.1.1.11->12.1.1.2 [26]
*Mar 1 00:29:34.951: NAT: s=12.1.1.2->13.1.1.11, d=13.1.1.5 [27]
*Mar 1 00:29:34.951: NAT: s=13.1.1.11, d=13.1.1.5->3.3.3.3 [27]
R1#
*Mar 1 00:29:34.967: NAT*: s=3.3.3.3->13.1.1.5, d=13.1.1.11 [27]
*Mar 1 00:29:34.971: NAT*: s=13.1.1.5, d=13.1.1.11->12.1.1.2 [27]
*Mar 1 00:29:34.995: NAT: s=12.1.1.2->13.1.1.11, d=13.1.1.5 [28]
*Mar 1 00:29:34.995: NAT: s=13.1.1.11, d=13.1.1.5->3.3.3.3 [28]
*Mar 1 00:29:35.007: NAT*: s=3.3.3.3->13.1.1.5, d=13.1.1.11 [28]
*Mar 1 00:29:35.007: NAT*: s=13.1.1.5, d=13.1.1.11->12.1.1.2 [28]
*Mar 1 00:29:35.023: NAT: s=12.1.1.2->13.1.1.11, d=13.1.1.5 [29]
*Mar 1 00:29:35.023: NAT: s=13.1.1.11, d=13.1.1.5->3.3.3.3 [29]
*Mar 1 00:29:35.043: NAT*: s=3.3.3.3->13.1.1.5, d=13.1.1.11 [29]
*Mar 1 00:29:35.047: NAT*: s=13.1.1.5, d=13.1.1.11->12.1.1.2 [29]
R1#
R3#
*Mar 1 00:29:27.651: IP: tableid=0, s=13.1.1.11 (FastEthernet0), d=3.3.3.3 (Loopback0), routed via RIB
*Mar 1 00:29:27.651: IP: s=13.1.1.11 (FastEthernet0), d=3.3.3.3, len 100, rcvd 4
*Mar 1 00:29:27.655: ICMP: echo reply sent, src 3.3.3.3, dst 13.1.1.11
*Mar 1 00:29:27.655: IP: tableid=0, s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), routed via FIB
*Mar 1 00:29:27.655: IP: s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), len 100, sending
*Mar 1 00:29:27.735: IP: tableid=0, s=13.1.1.11 (FastEthernet0), d=3.3.3.3 (Loopback0), routed via RIB
*Mar 1 00:29:27.735: IP: s=13.1.1.11 (FastEthernet0), d=3.3.3.3, len 100, rcvd 4
*Mar 1 00:29:27.735: ICMP: echo reply sent, src 3.3.3.3, dst 13.1.1.11
*Mar 1 00:29:27.739: IP: tableid=0, s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), routed via FIB
*Mar 1 00:29:27.739: IP: s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), len 100, sending
*Mar 1 00:29:27.775: IP: tableid=0, s=13.1.1.11 (FastEthernet0), d=3.3.3.3 (Loopback0), routed via RIB
*Mar 1 00:29:27.775: IP: s=13.1.1.11 (FastEthernet0), d=3.3.3.3, len 100, rcvd 4
*Mar 1 00:29:27.775: ICMP: echo reply sent, src 3.3.3.3, dst 13.1.1.11
*Mar 1 00:29:27.775: IP: tableid=0, s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), routed via FIB
*Mar 1 00:29:27.779: IP: s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), len 100, sending
*Mar 1 00:29:27.803: IP: tableid=0, s=13.1.1.11 (FastEthernet0), d=3.3.3.3 (Loopback0), routed via RIB
*Mar 1 00:29:27.807: IP: s=13.1.1.11 (FastEthernet0), d=3.3.3.3, len 100, rcvd 4
*Mar 1 00:29:27.807: ICMP: echo reply sent, src 3.3.3.3, dst 13.1.1.11
*Mar 1 00:29:27.807: IP: tableid=0, s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), routed via FIB
*Mar 1 00:29:27.807: IP: s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), len 100, sending
*Mar 1 00:29:27.835: IP: tableid=0, s=13.1.1.11 (FastEthernet0), d=3.3.3.3 (Loopback0), routed via RIB
*Mar 1 00:29:27.835: IP: s=13.1.1.11 (FastEthernet0), d=3.3.3.3, len 100, rcvd 4
*Mar 1 00:29:27.835: ICMP: echo reply sent, src 3.3.3.3, dst 13.1.1.11
*Mar 1 00:29:27.835: IP: tableid=0, s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), routed via FIB
*Mar 1 00:29:27.839: IP: s=3.3.3.3 (local), d=13.1.1.11 (FastEthernet0), len 100, sending
R3#
R3#

你可能感兴趣的:(基于源和目标地址的NAT转换)