Got it

How many private IPs can be NATed to one public IP?

Latest reply: Nov 17, 2021 05:11:59 14538 8 5 0 1

When we do source IP address-based NAT, such as NAPT, Easy IP, Intranet users can share one or multiple public IP addresses. So how many intranet users can share one public IP?

As we know, the firewall session table records the connection status of protocols and plays a key role in forwarding packets. For example, intranet users 10.1.1.1 and 10.1.1.2 are ping 210.1.1.1 servers and NAT is performed on the USG using the public IP address 200.10.10.1. The session table is displayed as follows:

##########

<USG6000> display firewall session table

Current total sessions: 2

Slot: 1 CPU: 1

icmp VPN: public --> public 10.1.1.1:1280[200.10.10.1:10324] --> 210.1.1.1:2048

icmp VPN: public --> public 10.1.1.2:1280[200.10.10.1:6025] --> 210.1.1.1:2048

##########

Because the IP addresses and port numbers of different users on the intranet must be different. The firewall can identify a data flow based on the source address and source port number to establish a forward NAT address. In reverse address restoration, the quintuple information (source address + source port + destination address + destination port + protocol) is used to uniquely identify a data flow.

Then, according to the implementation mechanism of the session table, as long as different users in the intranet access any parameter of the 'destination address + destination port +protocol' triple, even if the same port of the same public network address in the address pool is allocated to multiple users in the intranet at the same time, there will be no conflict.

For example:

source

address

source

 port

NAT

address

NAT

 port

Destination

address

Destination port

protocol

10.1.1.1

80

210.1.1.1

8080

www.google.com

8080

https

10.1.1.2

80

210.1.1.1

8080

forum.huawei.com

8080

https

Therefore, as long as one parameter of the 'destination address + destination port + protocol' triple is different. The unique NAT address and port can be reused. which is not restricted by port 65535. At this point, no matter how the ports are allocated, there will be no problem.

In addition, when different intranet users access the same 'destination address + destination port + protocol' triple. The hash algorithm ensures that they will not be allocated to the same NAT address port. the session table is aged in real-time. The allocated port is reused after the session table ages. Therefore, there is a possibility that the port is not limited. Moreover, the session table is aged in real-time, and the assigned port is reused after the session table is aged. Therefore, So ports are almost unrestricted.

In conclusion, theoretically, there is no limit on the number of private IP maps to a single public IP.

For routers, the number should be calculated.
View more
  • x
  • convention:

OK
View more
  • x
  • convention:

Thanks for sharing!
View more
  • x
  • convention:

Nice
View more
  • x
  • convention:

Very useful
View more
  • x
  • convention:

Great explain!
Thank you very much!
View more
  • x
  • convention:

This is really interesting!
Thank you @Popeye_Wang
View more
  • x
  • convention:

Great. Thanks for sharing
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.