cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2237
Views
15
Helpful
5
Replies

Static NAT changes source port.

ranga2002
Level 1
Level 1

Hi team,

 

I have a requirement, where I have to allow communication between two devices in two remote networks, which is going through a NAT device keeping original source and destination ports.

 

Site A ---------------  NAT Firewall------------------The Internet---------------------Site B 

S:10.131.1.2                S:10.131.5.2                                                                                D:10.101.1.2

UDP port 2000         UDP Port 10381                                                                              UDP port 2000

 

Original source IP is source NAT'd to 10.131.5.2. Then it communicates with the destination IP 10.101.1.2.

 

Once we configured a static source NAT, we observed the NAT device keep changing the source port(UDP 2000) to a random number (in this case UDP 10381), which violates the customer requirement. However, the destination port remains the same.

 

Is there a way I can keep the source port unchanged as UDP 2000 and the destination port as UDP 2000? 

 

Thanks in advance.

 

 

1 Accepted Solution

Accepted Solutions

Hello,

 

as far as I recall, in JunOS, port randomization is enabled by default. Try and disable that:

 

set security nat source port-randomization disable

View solution in original post

5 Replies 5

Hello,

 

what is the 'NAT device', is that an ASA firewall ?

It is a Juniper (JunOS) firewall.

Hello,

 

as far as I recall, in JunOS, port randomization is enabled by default. Try and disable that:

 

set security nat source port-randomization disable

Thanks Georg. I will try this out. My gut feeling is this should resolve it.

balaji.bandi
Hall of Fame
Hall of Fame

Not tried  myself - try "no-payload"

 

 example : (change this to UDP as per the requirement)

 

ip nat inside source static tcp x.x.x.x 80 y.y.y.y 80 [no-payload]

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help