en:dpi:opt_cgnat:faq:cgnat_faq_6 [Документация VAS Experts]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:dpi:opt_cgnat:faq:cgnat_faq_6 [2023/08/28 14:08] – ↷ Page moved from en:dpi:opt_cgnat:cgnat_faq:cgnat_faq_6 to en:dpi:opt_cgnat:faq:cgnat_faq_6 elena.krasnobryzhen:dpi:opt_cgnat:faq:cgnat_faq_6 [2023/08/28 14:19] (current) – removed elena.krasnobryzh
Line 1: Line 1:
-====== How to allocate a specific address to a NAT 1:1 subscriber? ====== 
-{{indexmenu_n>6}} 
  
-If the subscriber has only one private address and you want to give him a specific public address, you need to take into consideration the dependance between private and public addresses caused by the non-blocking address dispatching algorithm in the DPI. 
- 
-<code>subscriber_public_address & mask = subscriber_private_address & mask</code> 
- 
-here, mask depends on the number of worker threads: 
-  * for 4 worker threads mask=3 (typically for Stingray SG >= 10) 
-  * for 2 worker threads mask=1 (typically for Stingray SG <= 6)  
- 
-In fact, for newer SSG versions, subscribers with even private addresses need to be given even public addresses, and odd ones - odd ones. It is enough to take into account only the lower byte NNN in the IP-address XXX.YYY.ZZZ.NNN 
- 
-Accordingly, for older versions, the equality of the 2 least significant bits of the IP address must be taken into account. 
- 
-With one worker thread, the dependency between addresses disappears. 
- 
-You can view the exact mask value in the DPI log: 
-<code>grep nat_hash_mask /var/log/dpi/fastdpi_alert.log</code> 
- 
-If the start was a long time ago, then reload 
-<code>service fastdpi reload</code> 
- 
-<note important>Thus, this partially deterministic allocation scheme assumes that private addresses will also be issued to the subscriber statically. 
-In cases where it is necessary to issue a specific public IP address (by contract) and the current private address of the subscriber does not match the above formula, then you will need to change the subscriber's private address to the one that corresponds to the formula.</note> 
- 
-**Example for SSG-20:** 
-We need to allocate a public address 188.99.99.27 to a subscriber with a private address 10.0.0.15\\  
-mask=3\\  
-15&3=3 equals 27&3=3 - this means that such an address can be issued (otherwise it would be necessary to change either the private address given to the subscriber, or the public one assigned to him) 
- 
-**Assign the address to the subscriber with the command:** 
-<code>fdpi_ctrl load profile --ip 10.0.0.15 --service 11 --profile.json '{ "nat_ip_pool" : "188.99.99.27/32", "nat_type" : 1 }'</code>