3.2.15. nat¶
NAT configuration.
vrouter running config# vrf <vrf> nat
source-rule¶
A rule to change the source address/port of outgoing packets.
vrouter running config# vrf <vrf> nat
vrouter running nat# source-rule <uint64> description <string> \
... protocol [not] VALUE \
... destination \
... address [not] VALUE \
... port [not] VALUE \
... source \
... address [not] VALUE \
... port [not] VALUE \
... outbound-interface [not] <string> \
... translate-to map MAP output-address \
... address VALUE port PORT \
... port-range START END \
... address-range START END port PORT \
... port-range START END
<uint64> |
Priority of the rule. High number means lower priority. |
protocol¶
Match a protocol.
protocol [not] VALUE
VALUE (mandatory)¶
The protocol to match.
VALUE
|
Description |
---|---|
tcp |
TCP protocol. |
udp |
UDP protocol. |
icmp |
ICMP protocol. |
all |
All protocols. |
destination¶
Match a destination attribute.
destination \
address [not] VALUE \
port [not] VALUE
address¶
Match this destination address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
<domain-name> |
The domain-name type represents a DNS domain name. Fully quallified left to the models which utilize this type. Internet domain names are only loosely specified. Section 3.5 of RFC 1034 recommends a syntax (modified in Section 2.1 of RFC 1123). The pattern above is intended to allow for current practice in domain name use, and some possible future expansion. It is designed to hold various types of domain names, including names used for A or AAAA records (host names) and other records, such as SRV records. Note that Internet host names have a stricter syntax (described in RFC 952) than the DNS recommendations in RFCs 1034 and 1123, and that systems that want to store host names in schema nodes using the domain-name type are recommended to adhere to this stricter standard to ensure interoperability. The encoding of DNS names in the DNS protocol is limited to 255 characters. Since the encoding consists of labels prefixed by a length bytes and there is a trailing NULL byte, only 253 characters can appear in the textual dotted notation. Domain-name values use the US-ASCII encoding. Their canonical format uses lowercase US-ASCII characters. Internationalized domain names MUST be encoded in punycode as described in RFC 3492. |
<A.B.C.D> |
An IPv4 address. |
<A.B.C.D/M> |
An IPv4 prefix: address and CIDR mask. |
source¶
Match a source attribute.
source \
address [not] VALUE \
port [not] VALUE
address¶
Match this source address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
<domain-name> |
The domain-name type represents a DNS domain name. Fully quallified left to the models which utilize this type. Internet domain names are only loosely specified. Section 3.5 of RFC 1034 recommends a syntax (modified in Section 2.1 of RFC 1123). The pattern above is intended to allow for current practice in domain name use, and some possible future expansion. It is designed to hold various types of domain names, including names used for A or AAAA records (host names) and other records, such as SRV records. Note that Internet host names have a stricter syntax (described in RFC 952) than the DNS recommendations in RFCs 1034 and 1123, and that systems that want to store host names in schema nodes using the domain-name type are recommended to adhere to this stricter standard to ensure interoperability. The encoding of DNS names in the DNS protocol is limited to 255 characters. Since the encoding consists of labels prefixed by a length bytes and there is a trailing NULL byte, only 253 characters can appear in the textual dotted notation. Domain-name values use the US-ASCII encoding. Their canonical format uses lowercase US-ASCII characters. Internationalized domain names MUST be encoded in punycode as described in RFC 3492. |
<A.B.C.D> |
An IPv4 address. |
<A.B.C.D/M> |
An IPv4 prefix: address and CIDR mask. |
outbound-interface¶
Name of an interface via which a packet is going to be sent. Only for forward, output and postrouting.
outbound-interface [not] <string>
translate-to¶
Translate to.
translate-to map MAP output-address \
address VALUE port PORT \
port-range START END \
address-range START END port PORT \
port-range START END
map¶
Translate a whole network of addresses onto another network of addresses. All ‘one’ bits in the mask are filled in from the new address. All bits that are zero in the mask are filled in from the original address.
map MAP
MAP |
An IPv4 prefix: address and CIDR mask. |
address¶
Translate to an address and port/port range.
address VALUE port PORT \
port-range START END
port¶
Translate to a port.
port PORT
PORT |
A 16-bit port number used by a transport protocol such as TCP or UDP. |
destination-rule¶
A rule to change the destination address/port of incoming packets.
vrouter running config# vrf <vrf> nat
vrouter running nat# destination-rule <uint64> description <string> \
... protocol [not] VALUE \
... destination \
... address [not] VALUE \
... port [not] VALUE \
... source \
... address [not] VALUE \
... port [not] VALUE \
... inbound-interface [not] <string> \
... translate-to map MAP \
... address VALUE port PORT \
... port-range START END \
... address-range START END port PORT \
... port-range START END
<uint64> |
Priority of the rule. High number means lower priority. |
protocol¶
Match a protocol.
protocol [not] VALUE
VALUE (mandatory)¶
The protocol to match.
VALUE
|
Description |
---|---|
tcp |
TCP protocol. |
udp |
UDP protocol. |
icmp |
ICMP protocol. |
all |
All protocols. |
destination¶
Match a destination attribute.
destination \
address [not] VALUE \
port [not] VALUE
address¶
Match this destination address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
<domain-name> |
The domain-name type represents a DNS domain name. Fully quallified left to the models which utilize this type. Internet domain names are only loosely specified. Section 3.5 of RFC 1034 recommends a syntax (modified in Section 2.1 of RFC 1123). The pattern above is intended to allow for current practice in domain name use, and some possible future expansion. It is designed to hold various types of domain names, including names used for A or AAAA records (host names) and other records, such as SRV records. Note that Internet host names have a stricter syntax (described in RFC 952) than the DNS recommendations in RFCs 1034 and 1123, and that systems that want to store host names in schema nodes using the domain-name type are recommended to adhere to this stricter standard to ensure interoperability. The encoding of DNS names in the DNS protocol is limited to 255 characters. Since the encoding consists of labels prefixed by a length bytes and there is a trailing NULL byte, only 253 characters can appear in the textual dotted notation. Domain-name values use the US-ASCII encoding. Their canonical format uses lowercase US-ASCII characters. Internationalized domain names MUST be encoded in punycode as described in RFC 3492. |
<A.B.C.D> |
An IPv4 address. |
<A.B.C.D/M> |
An IPv4 prefix: address and CIDR mask. |
source¶
Match a source attribute.
source \
address [not] VALUE \
port [not] VALUE
address¶
Match this source address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
<domain-name> |
The domain-name type represents a DNS domain name. Fully quallified left to the models which utilize this type. Internet domain names are only loosely specified. Section 3.5 of RFC 1034 recommends a syntax (modified in Section 2.1 of RFC 1123). The pattern above is intended to allow for current practice in domain name use, and some possible future expansion. It is designed to hold various types of domain names, including names used for A or AAAA records (host names) and other records, such as SRV records. Note that Internet host names have a stricter syntax (described in RFC 952) than the DNS recommendations in RFCs 1034 and 1123, and that systems that want to store host names in schema nodes using the domain-name type are recommended to adhere to this stricter standard to ensure interoperability. The encoding of DNS names in the DNS protocol is limited to 255 characters. Since the encoding consists of labels prefixed by a length bytes and there is a trailing NULL byte, only 253 characters can appear in the textual dotted notation. Domain-name values use the US-ASCII encoding. Their canonical format uses lowercase US-ASCII characters. Internationalized domain names MUST be encoded in punycode as described in RFC 3492. |
<A.B.C.D> |
An IPv4 address. |
<A.B.C.D/M> |
An IPv4 prefix: address and CIDR mask. |
inbound-interface¶
Name of an interface via which a packet was received. Only for input, forward and prerouting.
inbound-interface [not] <string>
translate-to¶
Translate to.
translate-to map MAP \
address VALUE port PORT \
port-range START END \
address-range START END port PORT \
port-range START END
map¶
Translate a whole network of addresses onto another network of addresses. All ‘one’ bits in the mask are filled in from the new address. All bits that are zero in the mask are filled in from the original address.
map MAP
MAP |
An IPv4 prefix: address and CIDR mask. |
address¶
Translate to an address and port/port range.
address VALUE port PORT \
port-range START END
port¶
Translate to a port.
port PORT
PORT |
A 16-bit port number used by a transport protocol such as TCP or UDP. |