NAT (reverse) Advanced Configuration Case

Configuration Topology Case
Here Insert Picture Description
Case configuration requirements
1, IP-Internet XY.1.1.X / 24, Loopback IP 0 to XXXX, where X oriented device ID, Y for the remote device ID;
2, three routers communicate using the IGP OSPF (published Loopback 0 and the physical interface device);
3, arranged on the NAT R3, so that R1 and Loopback R5 can visits 1;
4, each only add a static route on R1, R2, R4, R5 implementation requirements ;
case configuration Roadmap
1. configure IP router on 5

R1(config)#interface fastEthernet 0/1       
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown                      
R1(config-if)#interface loopback 0             
R1(config-if)#ip address 1.1.1.1 255.255.255.0 
R1(config-if)#interface loopback 1             
R1(config-if)#ip address 11.11.11.11 255.255.255.0

R2(config)#interface fastEthernet 0/0       
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown                      
R2(config-if)#interface fastEthernet 0/1       
R2(config-if)#ip address 23.1.1.2 255.255.255.0
R2(config-if)#no shutdown                      
R2(config-if)#int lo0                          
R2(config-if)#ip address 2.2.2.2 255.255.255.0 

R3(config)#interface fastEthernet 0/0       
R3(config-if)#ip address 23.1.1.3 255.255.255.0
R3(config-if)#no shutdown                      
R3(config-if)#interface fastEthernet 0/1       
R3(config-if)#ip address 34.1.1.3 255.255.255.0
R3(config-if)#no shutdown                      
R3(config-if)#int lo0                          
R3(config-if)#ip address 3.3.3.3 255.255.255.0

R4(config)#interface fastEthernet 0/0       
R4(config-if)#ip address 34.1.1.4 255.255.255.0
R4(config-if)#no shutdown                      
R4(config-if)#interface fastEthernet 0/1       
R4(config-if)#ip address 45.1.1.4 255.255.255.0
R4(config-if)#no shutdown                      
R4(config-if)#int lo0                          
R4(config-if)#ip address 4.4.4.4 255.255.255.0

R5(config)#interface fastEthernet 0/0          
R5(config-if)#ip address 45.1.1.5 255.255.255.0   
R5(config-if)#no shutdown                         
R5(config-if)#interface loopback 0                
R5(config-if)#ip address 5.5.5.5 255.255.255.0    
R5(config-if)#interface loopback 1                
R5(config-if)#ip address 55.55.55.55 255.255.255.0  

2, disposed on the OSPF router 5, and released directly connecting port Loopback 0;

R1(config)#router ospf 100                  
R1(config-router)#router-id 91.1.1.1               
R1(config-router)#network 12.1.1.0 0.0.0.255 area 0
R1(config-router)#network 1.1.1.0 0.0.0.255 area 0

R2(config)#router ospf 100                  
R2(config-router)#router-id 92.2.2.2               
R2(config-router)#network 12.1.1.0 0.0.0.255 area 0
R2(config-router)#network 23.1.1.0 0.0.0.255 area 0
R2(config-router)#network 2.2.2.0 0.0.0.255 area 0


R3(config)#router ospf 100   
R3(config-router)#router-id 93.3.3.3               
R3(config-router)#network 34.1.1.0 0.0.0.255 area 0
R3(config-router)#network 23.1.1.0 0.0.0.255 area 0
R3(config-router)#network 3.3.3.0 0.0.0.255 area 0 

R4(config)#router ospf 100   
R4(config-router)#router-id 94.4.4.4            
R4(config-router)#network 34.1.1.0 0.0.0.255 area 0
R4(config-router)#network 45.1.1.0 0.0.0.255 area 0
R4(config-router)#network 4.4.4.0 0.0.0.255 area 0 

R5(config)#router ospf 100                  
R5(config-router)#router-id 95.5.5.5               
R5(config-router)#network 45.1.1.0 0.0.0.255 area 0
R5(config-router)#network 5.5.5.0 0.0.0.255 area 0 

3, configure static routes on the four routers, guidance data

ip route 55.55.55.0 255.255.255.0 12.1.1.2	/在R1上设置去往55.55.55.55的下一跳/
ip route 55.55.55.0 255.255.255.0 23.1.1.3	/在R2上设置去往55.55.55.55的下一跳/

ip route 11.11.11.0 255.255.255.0 45.1.1.4	/在R5上设置去往11.11.11.11的下一跳/
ip route 11.11.11.0 255.255.255.0 34.1.1.3	/在R4上设置去往11.11.11.11的下一跳/

4, configure NAT on R3, to achieve Loopback visits 1 R1 and R5 are :

interface FastEthernet0/0
ip nat outside											/设置接口为NAT出接口/
interface FastEthernet0/1
ip nat outside											/设置接口为NAT出接口/
ip nat inside source static 1.1.1.1 11.11.11.11				
/设置静态NAT,将源为1.1.1.1的数据包的源转换为11.11.11.11 /
ip nat inside source static 5.5.5.5 55.55.55.55

Case test results
1, the configuration is complete, view the NAT translation table on R3:
Here Insert Picture Description2, open the debug ICMP in the R1 and R5, with R5 visit Loopback Loopback 1 of 1 R1:
Here Insert Picture Description

Here Insert Picture Description
Summary and other
1, the static NAT configuration, generates a NAT translation table directly on the device;
2, when data interface enters from NAT Outside the device, priority with a destination address and a translation table of the data in the Inside global address matches, when the matching is successful, the destination address of the data is replaced by the corresponding entry Inside local address, a process called reverse path NAT query;
3, back and forth in this experiment twice reverse NAT path query, originally 55.55.55.55 to 11.11.11.11 communications, converted 5.5.5.5 to 1.1.1.1 of communication;

Published 231 original articles · won praise 222 · views 20000 +

Guess you like

Origin blog.csdn.net/qinshangwy/article/details/104836001