Thursday, April 9, 2015

NAT over MPLS VPN

Step 1: config MPLS VPN
 - network: 10.1.xy.0/24
 - loopback address: x.x.x.0/24
 - R2, R3, R4 core MPLS. running ospf are 0.
 - R2 and R4 establish M-BGP
Step 2: config nat on R4.
R4#
interface Loopback1
 ip vrf forwarding VPN
 ip address 44.44.44.44 255.255.255.0
 ip nat outside
 ip virtual-reassembly
!
interface FastEthernet0/0
 ip vrf forwarding VPN
 ip address 192.168.45.4 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface Serial0/0
 ip address 10.1.34.4 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 ip ospf 1 area 0
 mpls ip
!
ip route vrf VPN 5.5.5.5 255.255.255.255 FastEthernet0/0 192.168.45.5
!
ip nat inside source list 1 interface Loopback1 vrf VPN overload
!
access-list 1 permit 5.5.5.5
-------------------------------------------------------------------------------------------
R5# 
interface FastEthernet0/0
 ip address 192.168.45.5 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.1.45.4

Step 3: verify
R5#ping 1.1.1.1 so l0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 5.5.5.5
!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/46/84

R4#debug ip nat
Mar  1 00:38:42.427: NAT*: s=5.5.5.5->44.44.44.44, d=1.1.1.1 [70]
*Mar  1 00:38:42.507: NAT*: s=1.1.1.1, d=44.44.44.44->5.5.5.5 [70]
*Mar  1 00:38:42.535: NAT*: s=5.5.5.5->44.44.44.44, d=1.1.1.1 [71]
*Mar  1 00:38:42.559: NAT*: s=1.1.1.1, d=44.44.44.44->5.5.5.5 [71]
*Mar  1 00:38:42.575: NAT*: s=5.5.5.5->44.44.44.44, d=1.1.1.1 [72]
*Mar  1 00:38:42.583: NAT*: s=1.1.1.1, d=44.44.44.44->5.5.5.5 [72]
*Mar  1 00:38:42.603: NAT*: s=5.5.5.5->44.44.44.44, d=1.1.1.1 [73]
*Mar  1 00:38:42.631: NAT*: s=1.1.1.1, d=44.44.44.44->5.5.5.5 [73]
*Mar  1 00:38:42.655: NAT*: s=5.5.5.5->44.44.44.44, d=1.1.1.1 [74]
*Mar  1 00:38:42.667: NAT*: s=1.1.1.1, d=44.44.44.44->5.5.5.5 [74]
R4#show ip nat translations vrf VPN
Pro Inside global      Inside local       Outside local      Outside global
icmp 44.44.44.44:14    5.5.5.5:14         1.1.1.1:14         1.1.1.1:14

No comments:

Post a Comment