3.2.22. nat¶
Note
requires a Product License.
NAT configuration.
vsr running config# vrf <vrf> nat
source-rule¶
A rule to change the source address/port of outgoing packets.
vsr running config# vrf <vrf> nat
vsr running nat# source-rule <uint64> description <string> \
... protocol [not] VALUE \
... destination \
... address [not] VALUE \
... port [not] VALUE \
... port-range [not] VALUE \
... group [not] <string> \
... source \
... address [not] VALUE \
... port [not] VALUE \
... port-range [not] VALUE \
... group [not] <string> \
... mark [not] <0x0-0xffffffff> mask <0x0-0xffffffff> \
... 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
|
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 protocol. |
|
UDP protocol. |
|
ICMP protocol. |
|
All protocols. |
destination¶
Match a destination attribute.
destination \
address [not] VALUE \
port [not] VALUE \
port-range [not] VALUE \
group [not] <string>
address¶
Match this destination address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
|
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. |
|
An IPv4 address. |
|
An IPv4 prefix: address and CIDR mask. |
port¶
Match this destination port.
port [not] VALUE
VALUE (mandatory)¶
The port to match.
VALUE
|
A 16-bit port number used by a transport protocol such as TCP or UDP. |
source¶
Match a source attribute.
source \
address [not] VALUE \
port [not] VALUE \
port-range [not] VALUE \
group [not] <string>
address¶
Match this source address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
|
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. |
|
An IPv4 address. |
|
An IPv4 prefix: address and CIDR mask. |
port¶
Match this source port.
port [not] VALUE
VALUE (mandatory)¶
The port to match.
VALUE
|
A 16-bit port number used by a transport protocol such as TCP or UDP. |
mark¶
Matches the mark field associated with a packet.
mark [not] <0x0-0xffffffff> mask <0x0-0xffffffff>
<0x0-0xffffffff> (mandatory)¶
The mark value. Packets in connections are matched against this value.
<0x0-0xffffffff>
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
|
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
|
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.
vsr running config# vrf <vrf> nat
vsr running nat# destination-rule <uint64> description <string> \
... protocol [not] VALUE \
... destination \
... address [not] VALUE \
... port [not] VALUE \
... port-range [not] VALUE \
... group [not] <string> \
... source \
... address [not] VALUE \
... port [not] VALUE \
... port-range [not] VALUE \
... group [not] <string> \
... mark [not] <0x0-0xffffffff> mask <0x0-0xffffffff> \
... 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
|
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 protocol. |
|
UDP protocol. |
|
ICMP protocol. |
|
All protocols. |
destination¶
Match a destination attribute.
destination \
address [not] VALUE \
port [not] VALUE \
port-range [not] VALUE \
group [not] <string>
address¶
Match this destination address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
|
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. |
|
An IPv4 address. |
|
An IPv4 prefix: address and CIDR mask. |
port¶
Match this destination port.
port [not] VALUE
VALUE (mandatory)¶
The port to match.
VALUE
|
A 16-bit port number used by a transport protocol such as TCP or UDP. |
source¶
Match a source attribute.
source \
address [not] VALUE \
port [not] VALUE \
port-range [not] VALUE \
group [not] <string>
address¶
Match this source address or prefix.
address [not] VALUE
VALUE (mandatory)¶
The address to match.
VALUE
|
Description |
---|---|
|
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. |
|
An IPv4 address. |
|
An IPv4 prefix: address and CIDR mask. |
port¶
Match this source port.
port [not] VALUE
VALUE (mandatory)¶
The port to match.
VALUE
|
A 16-bit port number used by a transport protocol such as TCP or UDP. |
mark¶
Matches the mark field associated with a packet.
mark [not] <0x0-0xffffffff> mask <0x0-0xffffffff>
<0x0-0xffffffff> (mandatory)¶
The mark value. Packets in connections are matched against this value.
<0x0-0xffffffff>
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
|
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
|
A 16-bit port number used by a transport protocol such as TCP or UDP. |