nat: use correct data types for memory sizes
[vpp.git] / src / plugins / nat / nat64_doc.md
1 # Stateful NAT64: Network Address and Protocol Translation from IPv6 Clients to IPv4 Servers {#nat64_doc}
2
3 ## Introduction
4
5 Stateful NAT64 in VPP allows IPv6-only clients to contact IPv4 servers using unicast UDP, TCP, or ICMP based on RFC 6146.
6
7 ## Configuration
8
9 ### Enable/disable NAT64 feature on the interface
10
11 > set interface nat64 in|out <intfc> [del]
12
13 in: inside/local/IPv6 network
14 out: outside/external/IPv4 network
15 intfc: interface name
16
17 ### Add/delete NAT64 pool address
18
19 One or more public IPv4 addresses assigned to a NAT64 are shared among several IPv6-only clients.
20
21 > nat64 add pool address <ip4-range-start> [- <ip4-range-end>] [tenant-vrf <tenant-vrf-id>] [del]
22
23 ip4-range-start: First IPv4 address of the range 
24 ip4-range-end: Last IPv4 address of the range (optional, not used for single address)
25 tenant-vrf-id: VRF id of the tenant associated with the pool address (optional, if not set pool address is global)
26
27 ### Add/delete static BIB entry
28
29 Stateful NAT64 also supports IPv4-initiated communications to a subset of the IPv6 hosts through staticaly configured bindings.
30
31 > nat64 add static bib <ip6-addr> <in-port> <ip4-addr> <out-port> tcp|udp|icmp [vfr <table-id>] [del]
32
33 ip6-addr: inside IPv6 address of the host
34 in-port: inside port or ICMPv6 identifier
35 ip4-addr: outside IPv4 address of the host
36 out-port: outside port or ICMPv4 identifier
37 table-id: VRF id of the tenant associated with the BIB entry (optional, default use global VRF)
38
39 ### Set NAT64 session timeouts
40
41 Session is deleted when timer expires. If all sessions corresponding to a dynamically create BIB entry are deleted, then the BIB entry is also deleted. When packets are flowing sessiom timer is refreshed to keep the session alive.
42
43 > set nat64 timeouts udp <sec> icmp <sec> tcp-trans <sec> tcp-est <sec> tcp-incoming-syn <sec> | reset
44
45 udp: UDP session timeout value (default 300sec)
46 icmp: ICMP session timeout value (default 60sec)
47 tcp-trans: transitory TCP session timeout value (default 240sec)
48 tcp-est: established TCP session timeout value (default 7440sec)
49 tcp-incoming-syn: incoming SYN TCP session timeout value (default 6sec)
50 reset: reset timers to default values
51
52 ### Set NAT64 prefix 
53
54 Stateful NAT64 support the algorithm for generating IPv6 representations of IPv4 addresses defined in RFC 6052. If no prefix is configured, Well-Known Prefix (64:ff9b::/96) is used. 
55
56 > nat64 add prefix <ip6-prefix>/<plen> [tenant-vrf <vrf-id>] [del]
57
58 ip6-prefix: IPv6 prefix
59 plen: prefix length (valid values: 32, 40, 48, 56, 64, or 96)
60 tenant-vrf: VRF id of the tenant associated with the prefix
61
62 ### Show commands
63
64 > show nat64 pool
65 > show nat64 interfaces
66 > show nat64 bib tcp|udp|icmp
67 > show nat64 session table tcp|udp|icmp
68 > show nat64 timeouts
69 > show nat64 prefix
70
71 ## Notes
72
73 Multi thread is not supported yet (CLI/API commands are disabled when VPP runs with multiple threads).