Carrier Grade NAT Commands on Cisco IOS XR Software
This chapter describes the commands used to configure and use the Carrier Grade NAT (CGN).
For detailed information about CGN concepts, configuration tasks, and examples, see Cisco IOS XR Software
Carrier Grade NAT Configuration Guide for the
.
To enable the IPv4 address of the server that is used for logging the entries for the
Network Address Translation (NAT) table, use the address
command in CGN inside VRF external logging server configuration mode. To disable the
Netflow server configuration, use the no form of this
command.
addressaddressportnumber
noaddressaddressportnumber
Syntax Description
address
IPv4 address of the server.
port
Configures the port that is used for logging. The address corresponds to the
IPv4 address of the NetflowV9 logging server port, which corresponds to the
UDP port number in which the NetflowV9 logging server listens for the
Netflow logs.
number
Port number. Range is from 1 to 65535.
Command Default
If the address command is not configured, CGN NetflowV9
logging is disabled.
Command Modes
CGN inside VRF external logging server configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The CGN NetflowV9-based translation entry is used to create and delete the logs.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the IPv4 address and port number 45 for
NetFlow logging of the NAT table entries:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)# serverRP/0//CPU0:router(config-cgn-invrf-af-extlog-server)# address 2.3.4.5 port 45
To enable the inside IPv4 address and port number for static forwarding for a CGN
instance, use the address command in CGN inside VRF static
port inside configuration mode. To disable this feature, use the
no form of this command.
addressaddressportnumber
noaddressaddressportnumber
Syntax Description
address
IPv4 address of an inside host server.
port
Configures the inside port for static forwarding. The
port keyword allows a specific UDP, TCP, or
ICMP port on a global address to be translated to a specific port on a local
address.
number
Inside port number. For TCP and UDP, range is from 1 to 65535. For ICMP,
range is from and 0 to 65535.
Command Default
None
Command Modes
CGN inside VRF static port inside configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the inside IPv4 address and port for static
forwarding. CGN can dynamically allocate one free public IP address and port number from
the configured outside address pool for an inside address and port.
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf ivrfRP/0//CPU0:router(config-cgn-invrf)# protocol tcpRP/0//CPU0:router(config-cgn-invrf-proto)# static-forward insideRP/0//CPU0:router(config-cgn-ivrf-sport-inside)# address 10.20.30.10 port 1000
Displays the translation table entries for an inside-address to outside-address for a specified NAT44 CGN instance.
alg ActiveFTP (CGN)
To enable the Application-Level Gateway (ALG) of Active FTP for a CGN NAT44 instance,
use the alg ActiveFTP command in NAT44 configuration mode. To
disable the support of ALG for the Active FTP, use the no form
of this command.
algActiveFTP
noalgActiveFTP
Syntax Description
This command has no arguments or keywords.
Command Default
By default, ActiveFTP ALG is disabled.
Command Modes
NAT44 configuration mode
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure ALG for the active FTP connection for the
CGN instance:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# alg ActiveFTP
To clear all translation database entries that are created dynamically for the specific
CGN instance, use the clear cgn nat44 command in EXEC
mode.
clearcgnnat44instance-name
Syntax Description
instance-name
Instance name for NAT44.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included in the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Caution
Because the clear cgn nat44 command clears all translation
database entries and impacts the traffic on those translation entries, use this
command with caution.
Task ID
Task ID
Operations
cgn
read
Examples
The following example shows how to clear all the translation entries for the cgn1
instance:
RP/0//CPU0:router# show cgn nat44 nat2 statistics
Statistics summary of NAT44 instance: 'nat2'
Number of active translations: 45631
Translations create rate: 5678
Translations delete rate: 6755
Inside to outside forward rate: 977
Outside to inside forward rate: 456
Inside to outside drops port limit exceeded: 0
Inside to outside drops system limit reached: 0
Inside to outside drops resorce depletion: 0
Outside to inside drops no translation entry: 0
Pool address totally free: 195
RP/0//CPU0:router# clear cgn nat44 nat2RP/0//CPU0:router# show cgn nat44 nat2 statistics
Statistics summary of NAT44 Instance: 'nat2'
Number of active translations: 0 <<<<<<<<<<<<<< All the entries are deleted and provided no new translation entires are created
Translations create rate: 5678
Translations delete rate: 6755
Inside to outside forward rate: 977
Outside to inside forward rate: 456
Inside to outside drops port limit exceeded: 0
Inside to outside drops system limit reached: 0
Inside to outside drops resorce depletion: 0
Outside to inside drops no translation entry: 0
Pool address totally free: 195
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
clear cgn nat44 inside-vrf
To clear translation database entries that are created dynamically for the specified
inside VRF, use the clear cgn nat44 inside-vrf command in EXEC
mode.
clearcgnnat44instance-nameinside-vrfvrf-name
Syntax Description
instance-name
Instance name for NAT44.
vrf-name
Name for the inside VRF.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included in the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Caution
Because the clear cgn nat44 inside-vrf command clears all
translation database entries for the specified inside-vrf and impacts the traffic on
those translation entries, use this command with caution.
Task ID
Task ID
Operations
cgn
read
Examples
The following example shows how to clear the translation database entries for the inside
VRF named ivrf:
RP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 23 end 56
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
12.168.6.231 tcp 34 2356 alg 875364 65345
12.168.6.98 tcp 56 8972 static 78645 56343
12.168.2.12 tcp 21 2390 static 45638 89865
12.168.2.123 tcp 34 239 dynamic 809835 67854
RP/0//CPU0:router# clear cgn nat44 nat2 inside-vrf insidevrf1RP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 23 end 56
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
clear cgn nat44 ipaddress
To clear translation database entries that are created dynamically for the specified
IPv4 address, use the clear cgn nat44 ipaddress command in
EXEC mode.
clearcgnnat44instance-nameipaddressaddress
Syntax Description
instance-name
Instance name for NAT44.
address
Specifies the IPv4 address for which the translation entries must be
cleared.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included in the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Caution
Because the clear cgn nat44 ipaddress command clears all
translation database entries for the specified IPv4 address and impacts the traffic
on those translation entries, use this command with caution.
Task ID
Task ID
Operations
cgn
read
Examples
The following example shows how to clear the translation database entries for the
specified IPv4 address:
RP/0//CPU0:router# show cgn nat44 nat1 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 23 end 56
Inside-translation details
-----------------------------------
NAT44 instance : nat1
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
12.168.6.231 tcp 34 2356 alg 875364 65345
12.168.2.123 tcp 34 239 dynamic 809835 67854
RP/0//CPU0:router# clear cgn nat44 nat1 ipaddress 10.0.0.0RP/0//CPU0:router# show cgn nat44 nat1 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 23 end 56
Inside-translation details
-----------------------------------
NAT44 instance : nat1
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
clear cgn nat44 port
To clear the translation database entries that are created dynamically for the specified
inside port number, use the clear cgn nat44 port command in
EXEC mode.
clearcgnnat44instance-nameportnumber
Syntax Description
instance-name
Instance name for NAT44.
number
Port number. Range is from 1 to 65535.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included in the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Caution
Because the clear cgn nat44 port command clears all
translation database entries for the specified port and impacts the traffic on those
translation entries, use this command with caution.
Task ID
Task ID
Operations
cgn
read
Examples
The following example shows how to clear the translation database entries for port
number 1231:
RP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1
inside-address 192.168.6.23 port start 1231 end 1231
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
12.168.6.231 tcp 1231 2356 alg 875364 65345
RP/0//CPU0:router# clear cgn nat44 nat2 port 1231RP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 1231 end 1231
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
Specifies the protocol for which the translation entries must be
cleared.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included in the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Caution
Because the clear cgn nat44 protocol command clears all
translation database entries for the specified protocol and impacts the traffic on
those translation entries, use this command with caution.
Task ID
Task ID
Operations
cgn
read
Examples
The following example shows how to clear the translation database entries for the TCP
protocol:
RP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 1231 end 1231
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
12.168.6.231 tcp 1231 2356 alg 875364 65345
RP/0//CPU0:router# clear cgn nat44 nat2 protocol tcpRP/0//CPU0:router# show cgn nat44 nat2 inside-translation protocol tcp inside-vrf insidevrf1 inside-address 192.168.6.23 port start 1231 end 1231
Inside-translation details
-----------------------------------
NAT44 instance : nat2
Inside-VRF : insidevrf1
------------------------------------------------------------------------------------------
Outside Protocol Inside Outside Translation Inside Outside
Address Source Source Type to to
Port Port Outside Inside
Packets Packets
------------------------------------------------------------------------------------------
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
external-logging (CGN)
To enable the external-logging facility for an inside VRF of a CGN instance, use the
external-logging command in CGN inside VRF NAT44
configuration mode. To disable external-logging, use the no
form of this command.
external-loggingnetflowversion9
noexternal-loggingnetflowversion9
Syntax Description
netflow version 9
Netflow version 9 protocol is used for external logging.
Command Default
By default, external-logging is disabled.
Command Modes
CGN Inside VRF NAT44 configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
The keyword netflow v9 has been modified to netflow version 9.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The external-logging command enters CGN inside VRF address
family external logging configuration mode.
You can use NetFlow to export NAT table entries.
The external-logging facility supports only netflow version 9.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to enter the configuration mode for the netflowv9
external-logging facility:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)#
Configures the timeout for the ICMP session for a CGN instance.
hw-module service cgn location
To enable a CGN service role on a specified location, use the hw-module
service cgn location command in global configuration mode. To
disable the CGN service role at the specified location, use the
no form of this command.
hw-moduleservicecgnlocationnode-id
nohw-moduleservicecgnlocationnode-id
Syntax Description
node-id
Location of the service card for CGN that you want to configure. The
node-id argument is entered in the
rack/slot/module notation.
Command Default
None
Command Modes
Global configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
root-lr
read, write
Examples
The following example shows how to configure the CGN service for location 0/2/CPU0:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# hw-module service cgn location 0/2/CPU0
Enables the particular instance of the CGN application on the active and standby locations.
inside-vrf (CGN)
To enter inside VRF configuration mode for a CGN instance, use the
inside-vrf command in CGN configuration mode. To disable
this feature, use the no form of this command.
inside-vrfvrf-name
noinside-vrfvrf-name
Syntax Description
vrf-name
Name for the inside VRF.
Command Default
None
Command Modes
CGN configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The inside-vrf command enters CGN inside VRF configuration
mode.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to enter inside VRF configuration mode:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)#
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
interface ServiceApp
To enable the application SVI interface, use the interface
ServiceApp command in global configuration mode. To disable a
particular service application interface, use the no form of
this command.
interfaceServiceAppvalue
nointerfaceServiceAppvalue
Syntax Description
value
Number of service application interfaces to be configured. Range is from 1
to 2000.
Command Default
None
Command Modes
Global configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The total number of service application interfaces per multi-service PLIM card cannot
exceed 889.
Task ID
Task ID
Operations
interface
read, write
Examples
The following example shows how to configure one service application interface:
Enables the particular instance of the CGN application on the active and standby locations.
interface ServiceInfra
To enable the infrastructure SVI interface, use the interface
ServiceInfra command in global configuration mode. To disable a
particular service infrastructure interface, use the no form
of this command.
interfaceServiceInfravalue
nointerfaceServiceInfravalue
Syntax Description
value
Number of service infrastructure interfaces to be configured. Range is from
1 to 2000.
Command Default
None
Command Modes
Global configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Only one service infrastructure interface can be configured per multi-service PLIM
card.
Task ID
Task ID
Operations
interface
read, write
Examples
The following example shows how to configure one service infrastructure interface:
Enables the particular instance of the CGN application on the active and standby locations.
map (CGN)
To map an outside VRF and address pool to an inside vrf, use the
map command in CGN inside VRF NAT44 configuration submode.
To remove the outside VRF and address pool mapping for the specified inside VRF of a CGN
instance, use the no form of this command.
Network address and prefix for the address pool. The prefix must not be less
than 16.
Command Default
None
Command Modes
CGN inside VRF NAT44 configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The map command maps the inside VRF to an outside VRF and
assigns an outside address pool for the mapping.
If the outside VRF name is not specified, the default VRF is considered.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the outside VRF and to assign the outside
address pool for the mapping:
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
mss (CGN)
To enable the TCP maximum segment size (MSS) adjustment value for an inside VRF of a
specified CGN instance and to adjust the MSS value of the TCP SYN packets going through,
use the mss command in CGN inside VRF NAT44 protocol
configuration mode. To disable the packets to override the TCP MSS value, use the
no form of this command.
msssize
nomsssize
Syntax Description
size
Size, in bytes, to be applied for the MSS value. Range is from 28 to
1500.
Command Default
Default is disabled for the TCP maximum segment size (MSS) adjustment.
Command Modes
CGN inside VRF NAT44 protocol configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The MSS value, which is configured using the mss command,
overrides the MSS value that is set in the received TCP packets. The range for MSS value
is from 28 to 1500.
The mss command adjusts the MSS value of the TCP SYN
packets.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure TCP MSS value as 1100 for the CGN
instance:
To configure the path Maximum Transmission Unit (MTU) for the netflowv9-based
external-logging facility for the inside VRF of a CGN instance, use the
path-mtu command in CGN inside VRF address family
external logging server configuration mode. To revert back to the default of 1500, use
the no form of this command. This command restricts the
maximum size of the Netflow-version 9 logging packet
path-mtuvalue
nopath-mtuvalue
Syntax Description
value
Value, in bytes, of the path-mtu for the netflowv9-based external-logging
facility. Range is from 100 to 9200.
Command Default
By default, the value of the path-mtu for the netflowv9-based external-logging facility
is set to 1500.
Command Modes
CGN inside VRF address family external logging server configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The netflowv9-based external-logging facility can be exported by using the NAT table
entries.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the path-mtu with the value of 2900 for the
netflowv9-based external-logging facility:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)# serverRP/0//CPU0:router(config-cgn-invrf-af-extlog-server)# path-mtu 2900
To limit the number of translation entries per source address, use the
portlimit command in CGN configuration mode. To revert
back to the default value of 100, use the no form of this
command.
portlimitvalue
noportlimitvalue
Syntax Description
value
Value for the port limit. Range is from 1 to 65535.
Command Default
If the port limit is not configured, the default value is 100 per CGN instance.
Command Modes
CGN configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The portlimit command configures the port limit per subscriber
for the system, including TCP, UDP, and ICMP. In addition, the
portlimit command restricts the number of ports that is
used by an IPv4 address; for example, it limits the number of CNAT entries per IPv4
address in the CNAT table.
Task ID
Task ID
Operations
cgn
read, write
Examples
This example shows how the port-limit needs can increased from the default value of 100
to a higher value of 500:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# portlimit 500
To enter ICMP, TCP, and UDP protocol configuration mode for a given CGN instance, use
the protocol command in the appropriate configuration mode. To
remove all the features that are enabled under the protocol configuration mode, use the
no form of this command.
protocol
{
icmp | tcp | udp
}
noprotocol
{
icmp | tcp | udp
}
Syntax Description
icmp
Enters ICMP protocol configuration mode.
tcp
Enters TCP protocol configuration mode.
udp
Enters UDP protocol configuration mode.
Command Default
None
Command Modes
CGN inside VRF NAT44 configuration mode
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The protocol command enters the appropriate CGN NAT44
configuration mode.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the ICMP protocol for a CGN instance:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# protocol icmpRP/0//CPU0:router(config-cgn-proto)#
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
refresh-direction (CGN)
To configure the Network Address Translation (NAT) mapping refresh direction for the
specified CGN instance, use the refresh-direction command in
NAT44 configuration mode. To revert back to the default value of the bidirection, use
the no form of this command.
refresh-directionOutbound
norefresh-directionOutbound
Syntax Description
Outbound
Configures only the refresh direction for outbound.
Command Default
If the NAT refresh direction is not configured, the default is bidirectional.
Command Modes
NAT44 configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Translation entries that do not have traffic flowing for specific time period are timed
out and deleted to prevent unnecessary usage of system resources. Any traffic for a
particular translation entry refreshes the entry and prevents it getting timed out.
Usually, the refresh is based on packets coming from both inside and outside. This is
referred to as bi-directional refresh mechanism. However, bidirectional refresh can lead
to denial of service (DoS) attacks because someone from the outside can periodically
refresh the entries even though there is no inside traffic.
When NAT refresh direction is configured as Outbound, the translation entries are
refreshed only by traffic flowing from inside to outside and prevent DoS attacks.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the mapping refresh direction for
outbound:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# refresh-direction outbound
To configure the refresh rate to log NetFlow-based external logging information for an
inside VRF of a CGN instance, use the refresh-rate command in
CGN inside VRF external logging server configuration mode. To revert back to the default
value of 500 packets, use the no form of this command.
refresh-ratevalue
norefresh-ratevalue
Syntax Description
value
Value, in packets, for the refresh rate. Range is from 1 to 600.
Command Default
value: 500
Command Modes
CGN inside VRF external logging server configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The netflowv9-based logging facility requires that a logging template be sent to the
server periodically. After sending many packets to the server, the template is resent.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the refresh rate value of 50 for NetFlow
logging for the NAT table entries:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)# serverRP/0//CPU0:router(config-cgn-invrf-af-extlog-server)# refresh-rate 50
Displays the contents of the NAT44 CGN instance statistics.
server (CGN)
To enable the logging server information for the IPv4 address and port for the server
that is used for the netflowv9-based external-logging facility, use the
server command in CGN inside VRF external logging
configuration mode. To disable this feature, use the no form
of this command. External logging of NAT Entries gets disabled.
server
noserver
Syntax Description
This command has no arguments or keywords.
Command Modes
CGN inside VRF external logging configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The server command enters CGN inside VRF address family external logging server
configuration mode.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the logging information for the IPv4
address and server:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)# serverRP/0//CPU0:router(config-cgn-invrf-af-extlog-server)#
Configures the frequency at which the netflow-v9 template is refreshed or resent to the netflow-v9 server.
service cgn
To enable an instance for the CGN application, use the service
cgn command in global configuration mode. To disable the instance of
the CGN application, use the no form of this command.
servicecgninstance-name
noservicecgninstance-name
Syntax Description
instance-name
Name of the CGN instance that is configured.
Command Default
None
Command Modes
Global configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The service cgn command enters CGN configuration mode.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the instance named cgn1 for the CGN
application:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)#
service-location (CGN)
To enable the particular instance of the CGN application on the active and standby
locations, use the service-location command in CGN
configuration mode. To disable the instance that runs at the location of the CGN
application, use the no form of this command.
Specifies the location in which the active CGN application starts. The
node-id argument is entered in the
rack/slot/module notation.
preferred-standbynode-id
(Optional) Specifies the location in which the standby CGN application
starts. The node-id argument is entered in the
rack/slot/module notation.
Command Default
None
Command Modes
CGN configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to specify active and standby locations for the CGN
application:
To configure the location of the CGN service for the infrastructure service virtual
interface (SVI), use the service-location command in interface
configuration mode. To disable this feature, use the no form
of this command.
service-locationnode-id
noservice-locationnode-id
Syntax Description
node-id
Specifies the ID of the node. The node-id argument
is entered in the rack/slot/module notation.
Command Modes
Interface configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the service location for 0/1/CPU0:
Specifies the location from where the failover must start. The
node-id argument is entered in the
rack/slot/module notation.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 4.0.0
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to initiate the failover services for the preferred
standby location:
RP/0//CPU0:router# service redundancy failover service-type secgn preferred-active 0/1/cpu0RP/0//CPU0:router#
service redundancy revert service-type
To revert failed over services back to their preferred active location, use the
service redundancy revert service-type command in EXEC
mode.
Specifies the location from where the failover must start. The
node-id argument is entered in the
rack/slot/module notation.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 4.0.0
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to revert the failed over services for the preferred
active location:
RP/0//CPU0:router# service redundancy revert service-type secgn preferred-active 0/1/cpu0RP/0//CPU0:router#
service-type nat44
To enable a NAT 44 instance for the CGN application, use the service-type
nat44 command in CGN submode. To disable the NAT44 instance of the
CGN application, use the no form of this command.
service-typenat44instance-name
noservice-typenat44instance-name
Syntax Description
instance-name
Name of the NAT44 instance that is configured.
Command Default
None
Command Modes
CGN submode (config-cgn)
Command History
Release
Modification
Release 4.0.0
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the NAT44 instance named nat1 for the CGN
application:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1
session (CGN)
To configure the timeout values for both active and initial sessions for TCP or UDP, use
the session command in CGN NAT44 protocol configuration mode.
To revert back to the default value for the TCP or UDP session timeouts, use the
no form of this command.
session
{
active | initial
}
timeoutseconds
nosession
{
active | initial
}
timeoutseconds
Syntax Description
active
Configures the active session timeout for both TCP and UDP. The default
value for UDP active session timeout is 120 seconds.
initial
Configures the initial session timeout.
timeout
Configures the timeout for either active or initial sessions.
seconds
Timeout for either active or initial sessions. Range is from 1 to 65535.
Command Default
If the value for the UDP initial session timeout is not configured, the default value
for the UDP initial session timeout is 30.
If the value for the UDP active session timeout is not configured, the default value for
the UDP active session timeout is 120.
If the value for the TCP initial session timeout is not configured, the default value
for the TCP initial session timeout is 120.
If the value for the TCP active session timeout is not configured, the default value for
the TCP active session timeout is 1800 (30 minutes).
Command Modes
CGN NAT44 protocol configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
We recommend that you configure the timeout values for the protocol sessions carefully.
For example, the values for the protocol and NAT functions must be configured
properly.
If the no form of this command is specified, the following
guidelines apply:
UDP initial session timeout value reverts
back to the default value of 30.
UDP active session timeout value reverts
back to the default value of 120.
TCP initial session timeout value reverts
back to the default value of 120.
TCP active session timeout value reverts
back to the default value of 1800.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the initial session timeout value as 90 for
TCP:
Configures the timeout for the ICMP session for a CGN instance.
show cgn nat44 inside-translation
To display the translation table entries for an inside-address to outside-address for a
specified NAT44 CGN instance, use the show cgn nat44
inside-translation command in EXEC mode.
(Optional) Displays only the ALG translation entries.
all
(Optional) Displays all the translation entries, for example, alg, dynamic,
and static.
dynamic
(Optional) Displays only the dynamic translation entries.
static
(Optional) Displays only the static translation entries.
ipv4
(Optional) Displays information for the IPv4 address family.
inside-vrf
Displays the information for the inside VPN routing and forwarding (VRF) for
the necessary translation details.
vrf-name
Name of the inside VRF.
inside-address
Displays the inside address for the inside VRF.
address
Inside address.
port
Displays the range of the port numbers.
startnumber
The start port from which the translation table entries should be
displayed.
end number
The end port till which the translation table entries should be
displayed.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
NAT44 instance was included to the command.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The show cgn nat44 inside-translation command displays the
translation for entries that are based on the inside-vrf, inside IPv4 address, and the
pool of the inside ports. The inside-address keyword must have
a /32 address. Each entry is displayed with a field that informs whether it is static,
ALG, or dynamic translation.
If the value of the translation type is not specified, all types of entries are
displayed.
Task ID
Task ID
Operations
cgn
read
Examples
The following shows sample output from the show cgn
inside-translation command:
Displays the outside-address to inside-address translation details for a specified NAT44 instance.
show cgn nat44 outside-translation
To display the outside-address to inside-address translation details for a specified
NAT44 instance, use the show cgn nat44 outside-translation
command in EXEC mode.
(Optional) Displays only the ALG translation entries.
all
(Optional) Displays all the translation entries, for example, alg, dynamic,
and static.
dynamic
(Optional) Displays only the dynamic translation entries.
static
(Optional) Displays only the static translation entries.
outside-vrf
(Optional) Displays the information for the outside VPN routing and
forwarding (VRF) for the necessary translation details.
vrf-name
Name of the outside VRF.
outside-address
Displays the outside address for the inside VRF.
address
Outside address.
port
Displays the range of the port numbers.
startnumber
Displays the start of the port number.
endnumber
Displays the end of the port number.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
The NAT44 instance was included to the command. The address-family keyword was removed.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
If you want to display the entries for a single port, the value for the end port must be
equal to that of the start port. Each entry is displayed with a field that informs
whether it is static, ALG, or dynamic translation.
If no VRF is specified, the entries are displayed for the default VRF.
If the value of the translation type is not specified, all types of entries are
displayed.
Task ID
Task ID
Operations
cgn
read
Examples
The following shows sample output from the show cgn
outside-translation command:
Range for the start address of the outside address pool. The range of the
IPv4 addresses cannot be more than 255 consecutive IPv4 addresses.
end-address
Range for the end address of the outside address pool.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
The NAT44 instance was included to the command syntax.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The show cgn nat44 pool-utilization command displays the
utilization of the outside address pool. In addition, this command displays the number
of free and used ports per IPv4 address in the specified range.
Task ID
Task ID
Operations
cgn
read
Examples
The following sample output shows the number of free and used global addresses and port
numbers:
RP/0//CPU0:router# show cgn nat44 nat1 pool-utilization inside-vrf insidevrf4 address-range 17.16.6.23 20.12.23.1
Public-address-pool-utilization details
-------------------------------------------------------------------------
NAT44 instance: nat1
VRF : insidevrf4
-------------------------------------------------------------------------
Outside Number Number
Address of of
Free ports Used ports
-------------------------------------------------------------------------
17.16.6.23 123 64388
17.16.6.120 58321 6190
17.16.6.98 98 64413
17.16.6.2 1234 60123
.
.
.
.
.
.
.
.
.
18.12.6.12 678 52789
Table 1 describes
the significant fields shown in the display.
Table 3 show cgn pool-utilization Field Descriptions
Field
Description
NAT44 instance
Name of the NAT44 instance configured
VRF
Name of the Inside VRF configured
Outside Address
Outside IPv4 address.
Number of Free Ports
Total number of Free ports available for the given Outside IPv4
address
Number of Used Ports
Total number of Used ports for the given Outside IPv4 address
Maps an outside VRF and address pool to an inside vrf.
show cgn nat44 statistics
To display the contents of the NAT44 CGN instance statistics, use the show
cgn nat44 statistics command in EXEC mode.
showcgnnat44instance-namestatistics
Syntax Description
instance-name
Name of the NAT44 instance that is configured.
Command Default
None
Command Modes
EXEC
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Release 4.0.0
The summary keyword was removed.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
Statistics provides the total number of active translation for a given NAT44 instance
and other parameters. In addition, the outside IPv4 addresses, along with the current
number of ports in use, are used for translation.
Task ID
Task ID
Operations
cgn
read
Examples
The following sample output shows the statistics entries:
RP/0//CPU0:router# show cgn nat44 nat1 statistics
Statistics summary of NAT44 instance: 'nat1'
Number of active translations: 34
Translations create rate: 0
Translations delete rate: 0
Inside to outside forward rate: 3
Outside to inside forward rate: 3
Inside to outside drops port limit exceeded: 0
Inside to outside drops system limit reached: 0
Inside to outside drops resorce depletion: 0
Outside to inside drops no translation entry: 9692754
Pool address totally free: 62
Pool address used: 2
Pool address usage:
-------------------------------------------------
External Address Ports Used
-------------------------------------------------
24.114.18.53 4
24.114.18.55 30
-------------------------------------------------
static-forward inside (CGN)
To enable forwarding for the static port for an inside IPv4 address and inside port
combination, use the static-forward inside command in CGN
inside VRF NAT44 protocol configuration mode. To disable static forwarding, use the
no form of this command.
static-forwardinside
nostatic-forwardinside
Syntax Description
This command has no arguments or keywords.
Command Default
None
Command Modes
CGN inside VRF NAT44 protocol configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
The static-forward inside command enters CGN inside VRF static
port inside configuration mode.
If the static-forward inside command is executed successfully
along with the inside IPv4 address and port information, CGN can dynamically allocate
one free outside IPv4 address and outside port number from the outside address pool.
Common use for static PAT is to allow Internet users from the public network to access a
server located in the private network.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure forwarding for the static port:
Displays the contents of the NAT44 CGN instance statistics.
timeout (CGN)
To configure the timeout for the ICMP session for a CGN instance, use the
timeout command in CGN NAT44 protocol configuration
mode. To revert back to default value of 60 seconds, use the
no form of this command.
timeoutseconds
notimeoutseconds
Syntax Description
seconds
Timeout value. Range is from 1 to 65535.
Command Default
The default ICMP timeout value is 60.
Command Modes
CGN NAT44 protocol configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
We recommend that you configure the timeout values for the protocol sessions carefully.
For example, the values for the protocol and NAT functions must be configured
properly.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the timeout value as 908 for the ICMP
session:
Configures the timeout values for both active and initial sessions for TCP or UDP.
timeout (CGN logging)
To configure the frequency at which the netflow-v9 template is refreshed or resent to
the netflow-v9 server, use the timeout command in CGN inside
VRF external logging server configuration mode.
To revert back to the default value of 30 minutes, use the no
form of this command.
timeoutvalue
notimeoutvalue
Syntax Description
value
Value, in minutes, for the timeout. Range is from 1 to 3600.
Command Default
value: 30
Command Modes
CGN inside VRF external logging server configuration
Command History
Release
Modification
Release 3.9.1
This command was introduced.
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. If you suspect user group assignment is preventing you from using a command, contact your AAA administrator for assistance.
After a certain amount of minutes has elasped since the template was last sent, the
timeout value is resent to the logging server.
Task ID
Task ID
Operations
cgn
read, write
Examples
The following example shows how to configure the timeout value as 50 for the NetFlow
logging information for the NAT table entries:
RP/0//CPU0:router# configureRP/0//CPU0:router(config)# service cgn cgn1RP/0//CPU0:router(config-cgn)# service-type nat44 nat1RP/0//CPU0:router(config-cgn-nat44)# inside-vrf insidevrf1RP/0//CPU0:router(config-cgn-invrf)# external-logging netflow version 9RP/0//CPU0:router(config-cgn-invrf-af-extlog)# serverRP/0//CPU0:router(config-cgn-invrf-af-extlog-server)# timeout 50