diff options
| author | zdc <taras@vyos.io> | 2025-09-05 13:33:44 +0300 |
|---|---|---|
| committer | zdc <taras@vyos.io> | 2025-09-11 12:22:33 +0300 |
| commit | c125f5bb0afcaa21c20fa3ba7f3cdf5b5831035c (patch) | |
| tree | 6d6422271230fe3c7cc55a035092314aac12f022 /docs/vpp/configuration/nat | |
| parent | 7bf883d61beaaea28ab1cb5f0d24e55e55ce5bfb (diff) | |
| download | vyos-documentation-c125f5bb0afcaa21c20fa3ba7f3cdf5b5831035c.tar.gz vyos-documentation-c125f5bb0afcaa21c20fa3ba7f3cdf5b5831035c.zip | |
VPP: Kernel Tuning and Cosmetic Fixes
- Added missing Kernel Tuning section in system settings for VPP
- Fixed inconsistent section hierarchy in NAT44 configuration documentation
- Fixed lost `netlink` from configuration commands in LCP settings
- Clarified CPU settings logic
Diffstat (limited to 'docs/vpp/configuration/nat')
| -rw-r--r-- | docs/vpp/configuration/nat/nat44.rst | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/docs/vpp/configuration/nat/nat44.rst b/docs/vpp/configuration/nat/nat44.rst index 495cc27b..6a52b30f 100644 --- a/docs/vpp/configuration/nat/nat44.rst +++ b/docs/vpp/configuration/nat/nat44.rst @@ -21,7 +21,7 @@ Configuration of NAT44 involves few steps: 2. Create NAT rules for SNAT and/or DNAT. Dynamic and Static Operations -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +============================= NAT44 configuration can be done in one of two ways or in both ways simultaneously: @@ -33,12 +33,12 @@ To configure dynamic NAT, you need to define a pool of public IP addresses that Static rules are more suitable for scenarios where you need to provide consistent and predictable mappings between private and public IP addresses, also they are the only way to configure DNAT. Interfaces Configuration ------------------------- +======================== The first step in configuring NAT44 is defining which interfaces handle inside (private) and outside (public) traffic. VyOS uses these interface designations to determine the direction of translation. Inside Interfaces -^^^^^^^^^^^^^^^^^ +----------------- Inside interfaces connect to private networks where hosts need source NAT to access external networks. @@ -48,8 +48,8 @@ Inside interfaces connect to private networks where hosts need source NAT to acc Traffic flowing **from** inside interfaces gets source NAT applied, translating private source addresses to public addresses from the translation pool. -Outside Interfaces -^^^^^^^^^^^^^^^^^^ +Outside Interfaces +------------------ Outside interfaces connect to public networks where external hosts may need to access internal services. @@ -60,7 +60,7 @@ Outside interfaces connect to public networks where external hosts may need to a Traffic flowing **to** outside interfaces can trigger destination NAT based on static rules, allowing external access to internal services. Interface Roles and Traffic Flow -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-------------------------------- .. note:: @@ -79,7 +79,7 @@ Interface Roles and Traffic Flow 4. **Static NAT**: Requires explicit configuration for outside→inside traffic Multiple Interface Support -^^^^^^^^^^^^^^^^^^^^^^^^^^ +-------------------------- You can configure multiple interfaces as inside or outside to support complex network topologies: @@ -94,12 +94,12 @@ You can configure multiple interfaces as inside or outside to support complex ne set vpp nat44 interface outside eth3 Address Pool Configuration --------------------------- +========================== Address pools define ranges of IP addresses that can be used for NAT translations. VyOS NAT44 supports two types of address pools, each serving different purposes. Translation Pools -^^^^^^^^^^^^^^^^^ +----------------- Translation pools are used for dynamic source NAT (SNAT). They provide a range of public IP addresses that can be dynamically assigned to private hosts when they access external networks. @@ -125,7 +125,7 @@ Translation pools are used for dynamic source NAT (SNAT). They provide a range o set vpp nat44 address-pool translation interface eth1 Twice-NAT Pools -^^^^^^^^^^^^^^^ +--------------- Twice-NAT pools are used when performing both source and destination NAT on the same traffic flow. This is particularly useful in scenarios where you need to: @@ -152,7 +152,7 @@ Twice-NAT pools are used when performing both source and destination NAT on the set vpp nat44 address-pool twice-nat interface eth2 Pool Requirements -^^^^^^^^^^^^^^^^^ +----------------- .. important:: @@ -162,7 +162,7 @@ Pool Requirements * Interface-based pools automatically include main (first) IP address assigned to the specified interface Pool Selection Priority -^^^^^^^^^^^^^^^^^^^^^^^ +----------------------- When multiple pools are configured, VyOS uses the following selection priority: @@ -175,7 +175,7 @@ When multiple pools are configured, VyOS uses the following selection priority: As soon as you have configured interfaces and pool, the NAT44 is operational. Static Rules Configuration --------------------------- +========================== Static NAT rules provide predictable and consistent mappings between private and public IP addresses. They are essential for: @@ -186,7 +186,7 @@ Static NAT rules provide predictable and consistent mappings between private and Unlike dynamic NAT that uses a pool of addresses, static rules create one-to-one mappings that persist until explicitly removed. Basic Static Rule Configuration -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +------------------------------- To create a static NAT rule, you need to define the local (internal) and external (public) address mappings: @@ -207,7 +207,7 @@ Where: This basic configuration creates a static one-to-one mapping. Traffic from outside to the external IP will be translated to the internal IP, and vice versa. Port-based Static Rules -^^^^^^^^^^^^^^^^^^^^^^^ +----------------------- For more granular control, you can create port-specific static rules. This is useful when you want to publish specific services: @@ -237,12 +237,12 @@ Where: * ``<protocol>`` specifies the protocol (tcp, udp, icmp) - if not specified, the rule applies to all protocols Advanced Static Rule Options -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------------------- VyOS NAT44 supports several advanced options for static rules: Twice-NAT -~~~~~~~~~ +^^^^^^^^^ Twice-NAT performs both source and destination NAT. So when an external host accesses an internal service, a source IP of such connection is translated to an address from the twice-NAT address pool. @@ -255,7 +255,7 @@ The twice-NAT option can be enabled with the following command: set vpp nat44 static rule <rule-number> options twice-nat Self Twice-NAT -~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^ Self Twice-NAT is used when a local host needs to access itself via the external address: @@ -270,7 +270,7 @@ This option rewrites source IP addresses on packets sent only from a local addre Using self-twice-nat option requires to set interface connected to the local network as both inside and outside interface, because both source and destination NAT need to be applied. Out-to-In Only -~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^ Restricts the rule to only apply to traffic from outside to inside interfaces: @@ -281,7 +281,7 @@ Restricts the rule to only apply to traffic from outside to inside interfaces: This prevents the creation of sessions from the inside interface, making it purely a DNAT rule. Force Twice-NAT Address -~~~~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^^^^ When using twice-nat, you can force the use of a specific IP address from the twice-nat address pool: @@ -339,12 +339,12 @@ Configuration Examples ``set vpp nat44 address-pool twice-nat address <twice-nat-ip-range>`` Advanced NAT44 Settings ------------------------ +======================= VyOS provides additional NAT44 settings for fine-tuning performance and behavior. These settings are configured under the VPP settings hierarchy. Session Timeouts -^^^^^^^^^^^^^^^^ +---------------- NAT44 maintains translation sessions with configurable timeout values for different protocols: @@ -374,7 +374,7 @@ NAT44 maintains translation sessions with configurable timeout values for differ set vpp settings nat44 timeout icmp 30 Session Limits -^^^^^^^^^^^^^^ +-------------- Control the maximum number of concurrent NAT sessions: @@ -392,7 +392,7 @@ This setting helps prevent memory exhaustion and ensures predictable performance set vpp settings nat44 session-limit 100000 Forwarding Behavior -^^^^^^^^^^^^^^^^^^^ +------------------- By default, VyOS NAT44 forwards packets that don't match any NAT rules according to the routing table. This behavior can be controlled: @@ -410,7 +410,7 @@ By default, VyOS NAT44 forwards packets that don't match any NAT rules according * **Security isolation**: Preventing any non-NAT traffic from traversing the device Worker Assignment -^^^^^^^^^^^^^^^^^ +----------------- For advanced performance tuning, you can assign NAT44 processing to specific worker threads: @@ -433,7 +433,7 @@ For advanced performance tuning, you can assign NAT44 processing to specific wor Worker assignment is an advanced feature typically used in high-performance deployments where you want to dedicate specific CPU cores to NAT processing. Most deployments don't require this configuration. Complete Configuration Example ------------------------------- +============================== Here's a complete example showing how to configure VyOS NAT44 for a typical network setup: @@ -500,10 +500,10 @@ Here's a complete example showing how to configure VyOS NAT44 for a typical netw set vpp nat44 static rule 300 description "API service (No Internet access for it)" Best Practices and Troubleshooting ----------------------------------- +================================== Recommendations -^^^^^^^^^^^^^^^ +--------------- * **Use out-to-in-only** for services that do not need access to external networks * **Limit port ranges** in static rules to only necessary ports @@ -512,7 +512,7 @@ Recommendations * **Configure appropriate pool sizes** based on expected concurrent connections in your network Common Configuration Issues -^^^^^^^^^^^^^^^^^^^^^^^^^^^ +--------------------------- **Static rules not working:** @@ -527,7 +527,7 @@ Common Configuration Issues 3. Check that both translation and twice-nat pools are properly defined Operational Commands -^^^^^^^^^^^^^^^^^^^^ +==================== Monitor NAT44 status and active connections using VyOS operational commands: |
