03-Network Protocol Configuration Commands
03-Network Protocol Configuration Commands
Table of Contents
Table of Contents
-I-
Table of Contents
- II -
Table of Contents
- III -
Table of Contents
- IV -
04-Network Protocol Configuration Commands
1.1.1 arp
To configure the static ARP which will permanently be stored in the ARP cache,
run arp [vrf vrf-name] ip-address hardware-address [alias]. To delete the
configured static ARP, run no arp [vrf vrf-name] ip-address.
Parameter
Parameter Description
-1-
04-Network Protocol Configuration Commands
alias (optional) the router will answer the ARP request from the IP address.
Default
Command Mode
Instruction
A common host can support the dynamic ARP resolution; hence, you need not
specially configure the static ARP mapping for the host. The vrf subcommand is used
to specify which VRF the ARP item belongs to.
Example
The following command shows that the MAC address of the host with IP address
[Link] is set to [Link].
arp [Link] [Link]
Related Command
clear arp-cache
To configure the timeout value of the dynamic ARP item in the ARP cache, run arp
timeout seconds. To resume the default value of the ARP item, run no arp timeout
or default arp timeout.
no arp timeout
Parameter
Parameter Description
-2-
04-Network Protocol Configuration Commands
seconds Timeout value of the dynamic ARP item in the ARP cache. 0 means that
the ARP cache obtained through dynamic resolution on the port will not be
released at the timeout time
Default
14400seconds (4 hours)
Command Mode
Instruction
If the timeout value of the dynamic ARP item is configured on the non-arp interface,
the configuration is invalid. You can run show interface to display the timeout time of
the ARP items on the port. See the following information :
Example
The following example shows that the timeout time of the dynamic ARP mapping
on interface Ethernet 1/0 is set to 900 seconds, which enables the ARP cache to
be refreshed rapidly.
!
interface ethernet
1/0 arp timeout 900
!
Related Command
show interface
clear arp-cache
Parameter
Command Mode
EXEC
-3-
04-Network Protocol Configuration Commands
Example
Related Command
arp
1.1.4 ip address
To configure the IP address of the interface and the network mask simultaneously, run
ip address. Currently, the IP addresses can not be clearly classified into A type, B
type and C type. However, the multicast address and the broadcast address can not
be used(The host part is 1.). Except the Ethernet, multiple interfaces of other types of
network can work on the same network segment. The network segment configured by
the Ethernet interface cannot be same to that configured by other types of interfaces,
unnumbered interfaces excluded. One main address and multiple accessory
addresses can be configured on an interface. The accessory address can be
configured only after the main address is configured, while the main address can be
deleted only after all accessory addresses are deleted. If the upper-layer application
does not specify the source address of the system-generated IP packet, the router will
adopt the IP address (configured on the transmitter interface and is in the same
network segment as the gateway); if the IP address cannot be determined, the main
address of the transmitter interface will be adopted. If the IP address of an interface is
not configured and the interface is not an unnumbered interface, the IP packets will not
be handled on the interface.
no ip address
Parameter
Parameter Description
ip-address IP address
Default
-4-
04-Network Protocol Configuration Commands
Command Mode
Instruction
If you configure the accessory IP address on a physical network segment through the
router, you must configure the accessory IP address of the same logical network
segment for other systems on the same physical network segment; otherwise, the
routing loop will be easily generated.
When the OSPF protocol is used, make sure that the accessory address and the main
address of an interface must be in the same OSPF area.
Example
The following example shows that the main address on interface Ethernet1/0 is set to
[Link], network mask is set to [Link] and two accessory IP addresses are
set to [Link] and [Link] respectively.
interface ethernet1/0
ip address [Link] [Link]
ip address [Link] [Link] secondary
ip address [Link] [Link] secondary
1.1.5 ip directed-broadcast
ip directed-broadcast [access-list-namer]
no ip directed-broadcast
Parameter
Parameter Description
access-list-name Name of the access list, which is an optional parameterIf the access
list is defined, only broadcast packets permitted by the access list can
be forwarded.
Default
Command Mode
-5-
04-Network Protocol Configuration Commands
Example
The following example shows how to configure the directed IP broadcast forwarding
on interface Ethernet1/0.
!
interface ethernet 1/0
ip directed-broadcast
!
Parameter
Parameter Description
ISDN(BRI) (optional) destination port which the to-be-forwarded UDP packets is
transmitted to
Default
Command Mode
Instruction
The NETBIOS Name Service packet is forwarded by default; to stop forwarding the
NETBIOS Name Service packet, run either of the following two commands:
no ip forward-protocol udp
-6-
04-Network Protocol Configuration Commands
Example
Related Command
ip helper-address
1.1.7 ip helper-address
no ip helper-address [address]
Parameter
Parameter Description
address IP helper address
Default
Command Mode
Instruction
The command is invalid on the X.25 interface, because the router cannot identify
physical broadcasts.
Example
The following example shows how to set the IP helper address on interface
ethernet1/0 to [Link].
!
interface ethernet 1/0
ip helper-address [Link]
!
Related Command
ip forward-protocol udp
-7-
04-Network Protocol Configuration Commands
1.1.8 ip host
To define a static host name-to-address mapping in the host cache, use the ip host
command in global configuration mode. To remove the host name-to-address mapping,
use the no form of this command.
no ip host name
Default
No mapping is configured.
Command Mode
Global configuration
Example
The following example shows how to configure the host name of IP address [Link]
as dns-server.
ip host dns-server [Link]
1.1.9 ip proxy-arp
To enable the agent ARP on the interface, run ip proxy-arp. To disable the agent ARP
on the interface, run no ip proxy-arp.
ip proxy-arp
no ip proxy-arp
Parameter
-8-
04-Network Protocol Configuration Commands
Default
Command Mode
Instruction
When the router receives the ARP request, if the router has the route to the requested
IP address and the routing interface is different from the request-received interface, the
router will send the ARP response out through its own MAC address; after then, the
actual data packet will be forwarded after it is received. In this way, a host can
communicate with the remote host even if the host does not completely learn the
network topology or the correct router is not set for the host. The host is in the same
physical subnet as a remote host is.
If a host requires the router to provide the service, the host and the router must be in
the same IP network, or at least the router takes that the IP address of the host and
the router are in the same IP subnet, that is, they use different masks. The router,
otherwise, cannot provide the service.
Example
The following example shows how to enable the ARP agent on interface ethernet1/0.
!
interface ethernet
1/0 ip proxy-arp
!
1.1.10 ip unnumbered
no ip unnumbered
Parameter
Parameter Description
type number Type and number of an interface whose IP address is configured The
interface cannot be the unnumbered interface which has adopted the IP
address of other interfaces.
-9-
04-Network Protocol Configuration Commands
Default
Command Mode
Instruction
You need not configure the unique IP address for the point-to-point link interface. You
can run the command to directly handle the IP and specify the valid IP address of other
interfaces as the source address of the packets transmitted from the interface. The IP
address is thus saved. The point-to-point interface can be called as the unnumbered
interface. IP packets generated on the unnumbered interface, such as route-refresh
packets, will use the valid IP addresses configured on the command-designated
interface. The address must be used to determine which routing processes are
sending the refresh packets on the interface. However, it has the following limitations:
(1) The command can set serial interfaces/channel interfaces that are encapsulated
by HDLC, PPP, LAPB and SLIP to unnumbered interfaces. However, the
command cannot be used on the X.25 interface and the SMDS interface.
(2) You cannot check whether the interface works normally through the ping
command. However, you can use SNMP to check the state of the interface
remotely.
The command realizes its function based on the regulation in RFC 1195 that the
valid IP address cannot be configured on the interface.
Pay attention to the serial links (between different networks) that adopt the IP address
of other interfaces; any routing protocol running on the serial link cannot broadcast
any information about each subnet.
Example
- 10 -
04-Network Protocol Configuration Commands
1.1.11 keepalive
To test the reachablity of the host and the connectivity of the network, run the
following command:
Parameter
Parameter Description
group group-id Multiple keepalive commands can be configured and can be identified
by the group ID. The default value of the group ID is 0.
interval interval-time Interval for transmitting the packet, whose unit is second Default value: 1
second
Command Mode
Instruction
The keepalive command supports the broadcast address and the multicast address. If
the address is the limited broadcast address ([Link]) or the multicast
address, the ICMP response packet will be transmitted on all interfaces supporting
broadcasts and multicasts.
The command need not wait for the ICMP response packet, which only transmits the
designated number of ICMP packets to the destination address regularly.
Example
You can make a configuration that 10 ICMP request packets are transmitted from
source address [Link] to destination address [Link] every 10 seconds.
The packet-transmitting port is determined through destination address [Link]
and the routing protocol.
keepalive group 1 destination [Link] source [Link] interval 10 number 10
You can make a configuration that five ICMP request packets are transmitted from
source address [Link] to destination address [Link] every second. The
- 11 -
04-Network Protocol Configuration Commands
1.1.12 ip route-cache-timeout
Parameter
Command Mode
Global configuration
Instruction
The command is to set route timeout value. The longer the route timeout value, the
shorter the same data flow (source address and destination address are the same.).
When the data flow is small (less than 10000) and stable, prolong the route timeout
value appropriately can improve the route forwarding rate. However, when the data
flow is big (over 10000) and unstable, prolong the timeout value may reduce the route
forwarding rate. It is recommended to adopt the default value (it is, the user spares the
trouble to set the route timeout value). For 1705 broadband routers of our company, it
is recommended to set the route timeout value to 16 (80 seconds) in two-way mode.
Example
The following command is to set the route cache timeout value to 10 seconds.
router#config
router_config#
router_config#ip route-cache-timeout 2
The following command is to delete the configuration of the route cache timeout
value as 10 seconds:
router#config
router_config#
router_config#no ip route-cache-timeout 2
Then the route cache timeout value resumes to the default value 1.
- 12 -
04-Network Protocol Configuration Commands
To display all ARP items, including the ARP mapping of the IP address for the
interface, static ARP mapping and dynamic ARP mapping, run the following command:
Parameter
None
Command Mode
EXEC
Instruction
Parameter Description
Protocol Protocol type, such as the IP protocol
Age Lifetime, that is, the duration of ARP item from its generation (unit: minute)
The fact that the router uses the ARP item does not affect the value.
Hardware Address Physical address corresponding to the network address, which is null for
the unresolved item
Type Type of packet encapsulation used by the interface, including ARPA and
SNAP
Example
To display all items in the hostname-address cache, run the following command:
- 13 -
04-Network Protocol Configuration Commands
show hosts
Parameter
Command Mode
EXEC
Example
Related Command
clear host
Run arp learn strict to set “arp learn strict”. Run no arp learn-strict To disable the function.
arp learn-strict
no arp learn-strict
Parameter
None
Default
Mode
Interface configuration
Instruction
Enable arp learn-strict and prevent ARP attack: the host will
update the route ARP item continuously.
Example
- 14 -
04-Network Protocol Configuration Commands
Router_config_g0/0#arp learn-strict
Run arp source-filter to set ARP source address filtration. Run no arp source-filter to resume to
the default mode.
arp source-filter
no arp source-filter
Parameter
None
Default
Command Mode
Port configuration
Instruction
Enable ARP source address filtration to check route according to the ARP source address. If
the destination port is not the port, ARP packet will be dropped.
Example
The following example shows how to enable ARP source address filtration.
Router_config_g0/0#arp source-filter
To configure the exist time that a dynamic ARP entry remains in the Address Resolution Protocol
(ARP) cache, use the arp timeout. To restore the default value, use the no form of this command
or default arp timeout command.
arp timeout <seconds>
no arp timeout
Parameter
<10-4294967>
- 15 -
04-Network Protocol Configuration Commands
Default
180seconds
Command Mode
Interface configuration
Instruction
Example
To set arp learning dynamic, run arp dynamic. To disable the function, run no arp dynamic.
arp dynamic
no arp dynamic
Parameter
None
Default
Command Mode
Port configuration
Instruction
Enable ARP dynamic learning, receive ARP packet and update ARP table according to the
source address IP & MAC.
Example
- 16 -
04-Network Protocol Configuration Commands
To set route ARP, run arp proxy <all | range>. To disable the function, run no arp proxy <all
| range> to disable the function.
Parameter
Default
Disable ARP
Command Mode
Port configuration
Instruction
Enable ARP and the route will response ARP request of Proxy IP.
Example
To set route ARP scan, run arp scan <all | range>. To disable the [Link] no arp scan <all |
range>.
Parameter
- 17 -
04-Network Protocol Configuration Commands
Default
Command Mode
Port configuration
Instruction
Enable ARP scan. The route will actively request for the IP address within the scan range
and formulate static ARP item.
Example
To set route ARP anti-attack, run arp guard. To disable the function, run no arp guard.
arp guard
no arp guard
Parameter
None
Default
Command Mode
Interface configuration
Instruction
Enable ARP guard, check its validity and drop the illegal packet.
- 18 -
04-Network Protocol Configuration Commands
Example
Router_config_g0/0#arp guard
To set route ARP packet rate limit, run arp guard rate-limit <num>. To disable the function, run
no arp guard rate-limit.
Parameter
Default
1000
Command Mode
Interface configuration
Instruction
Enable ARP rate limit, calculate number of ARP and drop ARP packet exceeding
the threshold.
Example
To set route forward free ARP regularly, run arp free-arp <time>. To disable the function, run
no arp free-arp.
no arp free-arp
- 19 -
04-Network Protocol Configuration Commands
Parameter
0~600 (0.1s)
Default
Command Mode
Port configuration
Instruction
Example
To set route static ARP, run arp <ip> <mac>. To disable the function, run no arp <ip> <mac>.
Parameter
Default
None
Command Mode
Global configuration
- 20 -
04-Network Protocol Configuration Commands
Instruction
Enable static ARP: the route will not request for ARP of IP and the state will not be
modified.
Example
Show arp
Parameter
None
Default
None
Command Mode
Global configuration
Instruction
Example
Router_config#show arp
- 21 -
04-Network Protocol Configuration Commands
Show arp
Parameter
None
Default
None
Command Mode
Global configuration
Instruction
Example
Router_config#clear arp
Parameter
Parameter Description
type Type of the interface, which is optional
Command Mode
EXEC
- 22 -
04-Network Protocol Configuration Commands
Instruction
If the link layer of an interface can effectively transmit and receive the data, the
interface is available, whose state is Protocol Up. If an IP address is configured on the
interface, the router will add an direct-through route to the routing table. If the link-layer
protocol is disabled, that is, if the link-layer protocol is Protocol Down, the direct-
through route will be deleted. If the interface type and the number of the interface is
specified, only the information about the specified interface is displayed. Otherwise,
the information about the IP configuration of all interfaces is displayed.
Example
The following example shows that the IP configuration of interface e0/1 is displayed.
Router#show ip interface e0/1
Ethernet1/0 is up, line protocol is up
IP address : [Link]/24
Broadcast address : [Link]
Helper address : not set
MTU : 1500(byte)
Forward Directed broadcast : OFF
Multicast reserved groups joined:
[Link] [Link] [Link] [Link]
[Link]
Outgoing ACL : not set
Incoming ACL : not set
IP fast switching : ON
IP fast switching on the same interface : OFF
ICMP unreachables : ON
ICMP mask replies : OFF
ICMP redirects : ON
Domain Description
Ethernet1/0 is up If the hardware of the interface is available, the interface will be
identified as up. If the interface is available, its hardware and line
protocols must be in the up state.
line protocol is up If the interface can provide bidirectional communication, the line
protocol will be identified as up. If the interface is available, its
hardware and line protocols of the interface must be in the up
state.
- 23 -
04-Network Protocol Configuration Commands
- 24 -
04-Network Protocol Configuration Commands
2.1.1 ip nat
Parameter
Parameter Description
inside Shows that the interface connects the internal network (NAT is applied on
the network).
outside Shows that the interface connects the exterior network (NAT is applied on
the network).
mss MSS-value Sets MSS to MSS-value after ip nat outside must be configured.
- 25 -
04-Network Protocol Configuration Commands
Default
The communication volume transmitted or received by the interface does not obey
the NAT regulation.
Command Mode
Instruction
Only the packets forwarded between interior interfaces and exterior interfaces can be
translated. Each boundary router where the NAT function is applied must be
specified at least one interior interface and one exterior interface.
You can run IP NAT to specify that the communication volume coming from the
interface or transmitted to the interface obeys NAT; to forbid the NAT function on
the interface, run no IP nat.
Note:
The ip nat mss command can be configured only on the interface of IP NAT
outside. Its function is to modify the maximum segment size (MSS) in the
synchronous TCP packets that are transmitted from the interior network. To forbid the
interface to modify MSS, run no ip nat mss.
Example
The following example shows that the IP address of packets from host [Link]
or host [Link] is translated to the unique IP address of network
[Link]/28 and MSS is modified to 1432.
!
ip nat pool net-208 [Link] [Link] [Link]
ip nat inside source list a1 pool net-208
!
interface ethernet 0
ip address [Link] [Link]
ip nat outside
ip nat mss 1432
!
interface ethernet 1
ip address [Link] [Link]
ip nat inside
!
ip access-list standard a1
permit [Link] [Link]
permit [Link] [Link]
!
- 26 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
icmp Icmp packet
Default
None
Command Mode
Instruction
The command is used to the NAT regulations. By default, all ICMP/UDP/TCP packets
to access the local router are permitted on the router's interface which is identified as
the NAT exterior port. The command can limitedly prevent exterior network users
from viciously attack the router; however, the packets which normally access the
router will be dropped.
To forbid the local ICMP/UDP/TCP packets to access the local router through the
router's interface which is identified as the NAT exterior port, you need configure the
ip nat local-service {icmp | udp | tcp } disable command. You can use the “no” form
of the command to resume the default state.
Note:
The command
can be
configured
only on
the router’s
interface
where the
NAT-identified exterior port lies and can be used to disable only the interface to
receive the ICMP/UDP/TCP packets.
2.1.3 ip fastaccess
Parameter
Parameter Description
deny Defines the regulations of the deny packets.
Port number Number of the TCP/UDP port, ranging between 1 and 10000
Default
None
Command Mode
Instruction
Because the ip fastaccess command is used to limit packet forwarding on the basis
of the transmission layer, the general access list will be used if packet forwarding is
limited based on the IP address.
Note:
If you want to constrain interior users through general access lists in the premises of
using dynamic NAT regulations, you are strongly recommended to use the NAT-
adopted access list. This method can greatly improve the performance especially for
the access lists which require to define many regulations.
no ip fastnat
Parameter
Parameter Description
outside interface-type number Designated network interface which is identified as
NAT OUTSIDE, which is the exit of the main line
- 28 -
04-Network Protocol Configuration Commands
line
Default
None
Command Mode
Instruction
The command has requirements for network environment. For details, see
the configuration manual.
If the private service or expanded access control list is not used, do not use
the privateservices option or the extend option.
To enable the NAT of the interior destination address, run ip nat inside
destination. To delete the dynamic connection with the address pool, run no ip nat
inside destination.
Parameter
Parameter Description
list name Name of the standard IP access control list, which is used to translate the
packets with the destination address through the global address in the
designated address pool
Default
- 29 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
The command is used to create the dynamic address translation in the access control
list form. For the packets from the address matched with the standard access control
list, the global address allocated by the designated address pool will be used to
translate. The address pool is specified by the ip nat pool command.
Example
The following example shows that the packets from network [Link] are
translated to the address of the interior host whose destination address lies at network
segment [Link].
!
ip nat pool net-208 [Link] [Link] [Link]
ip nat inside destination list a1 pool net-208
!
interface ethernet 0
ip address [Link] [Link]
ip nat outside
!
interface ethernet 1
ip address [Link] [Link]
ip nat inside
!
ip access-list standar a1
permit [Link] [Link]
!
To enable the NAT of the interior source address, run ip nat inside source. To
delete the static translation or the dynamic connection with the address pool,
run no ip nat inside source.
Dynamic NAT:
ip nat inside source {list access-list-name} {interface type number | pool pool-name}
[overload]
- 30 -
04-Network Protocol Configuration Commands
ip nat inside source {static {tcp | udp local-ip local-port {global-ip | interface type
number} global-port}
no ip nat inside source {static {tcp | udp local-ip local-port {global-ip | interface
type number} global-port}
Parameter
Parameter Description
List access-list-name Name of the IP access control list The packets whose source
addresses matches the access control list will be translated by the
global address of the address pool.
pool name Name of the address pool where the global IP addresses are
dynamically distributed
overload (optional) enables the router to use one global address for multiple
local addresses. After the overload parameter is set, multiple
sessions of similar hosts or different hosts will be differentiated by
TCP numbers or UDP numbers.
local-port Sets the local TCP/UDP number, ranging between 1 and 65535.
static global-ip Creates independent static address translation. That is, it is used to
create an IP address through which an exterior network can access
uniquely.
global-port Sets the global TCP/UDP number, ranging between 1 and 65535.
- 31 -
04-Network Protocol Configuration Commands
network local-network Sets the translation for the local network segment.
mask Sets the network mask for the network segment translation.
Default
Command Mode
Instruction
The command has two modes: dynamic address translation and static address
translation. The dynamic translation is created for the access control list form. For the
packets from the address matched with the standard access control list, the global
address allocated by the designated address pool will be used to translate. The
address pool is specified by the ip nat pool command.
To enable the static NAT to support the PASV mode of FTP, those commands to
match the overload type are required. When a static FTP mapping of NAT is set, the
overload type transfer is needed and one of the addresses of the exterior-network
interface following the PAT regulations must be the same as the exterior-network
address of the static FTP.
Example
The following example shows that the IP address of packets from host [Link] or host
[Link] is translated to the unique IP address of network [Link]/28.
!
ip nat pool net-208 [Link] [Link] [Link]
ip nat inside source list a1 pool net-208
!
interface ethernet 0
ip address [Link] [Link]
ip nat outside
!
interface ethernet 1
ip address [Link] [Link]
ip nat inside
!
ip access-list standard a1
permit [Link] [Link]
- 32 -
04-Network Protocol Configuration Commands
The following is an example of using the PASV mode of the static FTP.
ip nat inside source static tcp [Link] 21 [Link] 8021 ip
nat inside source static tcp [Link] 20 [Link] 8020 ip
nat inside source list test1 interface f0/0
To enable the NAT of the exterior source address, run ip nat outside source.
To delete the static items or dynamic connection, run no ip nat outside source.
Dynamic NAT:
ip nat outside source {static {tcp | udp global-ip global-port local-ip local-port} no ip
nat outside source {static {tcp | udp global-ip global-port local-ip local-port}
Parameter
Parameter Description
List access-list-name Name of the standard IP access control list The packets whose source
addresses matches the access control list will be translated by the global
address of the address pool.。
pool name Name of the address pool where the global IP addresses are dynamically
distributed
- 33 -
04-Network Protocol Configuration Commands
global-port Sets the global TCP/UDP number, ranging between 1 and 65535.
Static local-ip Creates independent static address translation. That is, it is used to create
an local IP address of the exterior host through which an interior network
can access uniquely. The address can be distributed in the address space
which can be routed by the interior network.
local-port Sets the local TCP/UDP number, ranging between 1 and 65535.
mask Sets the network mask for the network segment translation.
Default
The translation between the source addresses of the exterior network and the
interior network address does not exist.
Command Mode
Instruction
You probably use the illegal and abnormally-distributed IP address. You also probably use
the IP address which is normally distributed to other networks. The fact that the IP
address is legally used by the exterior network and also illegally used by the interior
network is defined as address overlapping. The NAT can be used to translate the interior
addresses which are overlapped with the exterior addresses. If the IP address of your
single-connection network is same to the legal IP address of another network and you
need communicate with these hosts or routers, you can use the function.
The command has two modes: dynamic address translation and static address
translation. The dynamic translation is created for the access control list form. For the
packets from the address matched with the standard access control list, the local
address allocated by the designated address pool will be used to translate. The
address pool is specified by the ip nat pool command.
Example
The following example shows that the IP address of packets among hosts in network
[Link] is translated to the unique global IP address of network [Link]/28.
- 34 -
04-Network Protocol Configuration Commands
To define an IP address pool for NAT, run ip nat pool. To delete the IP address
pool with a designated name, run no ip nat pool.
Parameter
Parameter Description
name Name of the IP address pool
start-ip Start IP address for defining the range of the IP address pool
end-ip End IP address for defining the range of the IP address pool
netmask Subnet mask showing which bytes belong to the network and subnet and
which bytes belong to the host parts; it can be used to specify the subnet
mask of the network to which the addresses of the IP address pool
belongs.
Default
- 35 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
The command is used to define an IP address pool with the start IP address, end
IP address and subnet mask.
Note: The rotary regulations of the IP address pool in the PAT regulations are shown
in the following: only when all connections of an address are aging, the next
address is required. That is, there is only one interior global address at the
same time.
Example
The following example shows that the IP address of packets from host [Link] or host
[Link] is translated to the unique IP address of network [Link]/28.
!
ip nat pool net-208 [Link] [Link] [Link]
ip nat inside source list a1 pool net-208
!
interface ethernet 0
ip address [Link] [Link]
ip nat outside
!
interface ethernet 1
ip address [Link] [Link]
ip nat inside
!
ip access-list standard a1
permit [Link] [Link]
permit [Link] [Link]
!
The command is an entrance function provided for all services that NAT supports.
Currently, only three kinds of services are provided. All services are disabled by
default.
Parameter
None
- 36 -
04-Network Protocol Configuration Commands
Default
Shut down
Command Mode
Instruction
Private service is a kind of support that the NAT does to the internal game server of the
cyber bar, such as the legend. It can control the NAT support of the private service.
The peek parameter realizes the NAT support to the game monitor server in the
cyber bar. Through the client soft of , you can monitor internal users' surfing.
Example
Modifying the timeout value of the NAT translation. You can run no ip nat
translation to close the timeout.
Modifying the values of some parameters for NAT translation items. You can use the
“no” form of the command to delete the previous configuration or resume the default
values.
Parameter
Parameter Description
- 37 -
04-Network Protocol Configuration Commands
Timeout Specifies the timeout value of the dynamic translations except the
overload translation. The default value is 3600 seconds.
udp-timeout Specifies the timeout value for the UDP port. The default value is 300
seconds.
dns-timeout Specifies the timeout value to connect the DNS. The default value is 60
seconds.
tcp-timeout Specifies the timeout value for the TCP port. The default value is 3600
seconds.
finrst-timeout Specifies the timeout value of the finish and reset TCP message, which
is used to terminate a translation item. The default value is 60 seconds.
icmp-timeout Sets the timeout time of the NAT of ICMP; the default value is 60 seconds.
max-entries Sets the maximum number of the NAT translation items; the default value
is 3000.
syn-timeout Sets the NAT timeout time of the TCP SYN state; the default value is 60
seconds.
seconds Specifies the timeout value of the port translation. The default value is the
value listed out at the default part.
max-entries host For the specified internal IP address, you can control the maximum
A.B.C.D number of the NAT translation items. There is no default value. You can
use the “no” form of the command not to control the maximum number of
the NAT translation items.
max-entries host For all internal IP addresses, the maximum number of the NAT translation
any items can be controlled by limiting the single IP address. The default value
is same to max-entries.
Default
Command Mode
Instruction
After the port translation is configured, you can further control the translation items for
each translation item contains more information about the communication volume. The
- 38 -
04-Network Protocol Configuration Commands
UDP translation of the DNS times out five minutes later, while that of the domain
system times out one minute later. If there is no RST or FIN in the data flow, TCP
translation times out one hour later; if there is RST or FIN, it will time out one
minute later.
Example
Example 1:
The following example shows that the UDP port translation times out 10 minutes later.
ip nat translation udp-timeout 600
Example 2:
The following example shows that the maximum number of the NAT translation
items created by IP [Link] is set to 100.
ip nat translation max-entries host [Link] 100
Parameter
None
Command Mode
EXEC
Instruction
You can use the command to resume all NAT statistics information to the original state.
Note:
Only the statistics parameter behind the packets dropped option can be deleted.
Example
FastEthernet0/1
- 39 -
04-Network Protocol Configuration Commands
Inside interfaces:
FastEthernet0/0
Dynamic mappings:
--Inside Source
access-list nat
pool natp: netmask [Link]
start [Link] end [Link]
total addresses 3, misses 0
--Inside Destination
--Outside Source
Link items:
FastEthernet0/1
Inside interfaces:
FastEthernet0/0
Dynamic mappings:
--Inside Source
access-list nat
pool natp: netmask [Link]
start [Link] end [Link]
total addresses 3, misses 0
--Inside Destination
--Outside Source
Link items:
- 40 -
04-Network Protocol Configuration Commands
To delete dynamic NAT from the translation item, run the following commands: clear
Parameter
Parameter Description
* Deletes all dynamic translation items.
Inside Deletes the internal translation consisting of the global IP address and the
local IP address.
tcp|udp Protocol
Command Mode
EXEC
Instruction
You can run the command to delete the dynamic translation items before they time out.
Example
The following example shows that the NAT translation items are displayed first
and then the UDP translation items are deleted.
- 41 -
04-Network Protocol Configuration Commands
Parameter
Command Mode
EXEC
Example
The following information is displayed after you run show ip nat statistics.
FastEthernet0/1
Inside interfaces:
FastEthernet0/0
Dynamic mappings:
--Inside Source
access-list nat
pool natp: netmask [Link]
start [Link] end [Link]
total addresses 3, misses 0
--Inside Destination
--Outside Source
Link items:
- 42 -
04-Network Protocol Configuration Commands
The important fields in the output results are listed in table 2-1.
Field Description
Total active translations: Number of designated translations activated in the system When
an address translation regulation is created, the value increases
by 1; when an address translation regulation is deleted or times
out, the value decreases by 1.
Outside interfaces: List of outside interfaces which are identified by the ip nat
outside command.
Inside interfaces: List of inside interfaces which are identified by the ip nat inside
command.
Total addresses Number of addresses in the pool, which can be used for address
translation
Protocol Number, protocol type and NAT direction of the dropped packets
- 43 -
04-Network Protocol Configuration Commands
To display the activated NAT address translation, run show ip nat translations.
Parameter
Parameter Description
host A.B.C.D (optional) Displays translation items A, B, C and D which have the inside
local address.
tcp (optional) Displays translation items which bear the TCP session.
udp (optional) Displays translation items which bear the TCP session.
icmp (optional) Displays translation items which bear the ICMP session.
Verbose (optional) Displays extra information about each translation item, including
how long it has been created and how long it times out.
Command Mode
EXEC
Instruction
Example
The following information is displayed after you run show ip nat translations.
Two inside hosts and some outside hosts are switching packets without overload.
Router# show ip nat translations
Pro Inside local Inside global Outside local Outside global
--- [Link] [Link] --- ---
--- [Link] [Link] --- --
(3) The following example shows that, at the overload condition, three address
translation items are activated, among which one is for DNS and the other two are for the
TELNET session. Note: two different inside hosts can appear with the same outside address.
Router# show ip nat translations
Pro Inside local Inside global Outside local Outside global
udp [Link]:1220 [Link]:1220 [Link]:53 [Link]:53
tcp [Link]:11012 [Link]:11012 [Link]:23 [Link]:23
tcp [Link]:1067 [Link]:1067 [Link]:23 [Link]:23
The following example shows the information with the verbose keyword.
Router# show ip nat translations verbose
Pro Inside local Inside global Outside local Outside global
- 44 -
04-Network Protocol Configuration Commands
Table 2‑ 2 Fields of output results for the show IP NAT Translations command
Field Description
Pro Defines the port protocol of the address.
Inside global Legal IP address, standing for one or multiple inside local IP
addresses connecting the exterior network
Outside local IP address of an outside host when it looks like an inside network,
which may not be a legal address provided by NIC or SP
Outside global IP address of the outside host which is distributed by the owner
Create time Creation time of the translation item (its unit is hour: minute: second)
Parameter
None
Command Mode
EXEC
Instruction
You can run debug ip nat detail to export the details about the translation
procedure, including the source/destination IP address, port number and the reason
of the failed translation.
You also can run debug ip nat h323 to export the details about the NAT translation
of the H323 packets, including the H323 information identified by NAT, the IP
address of the message or the translated address for the inside address.
- 45 -
04-Network Protocol Configuration Commands
Example
Example 1:
Field Description
Ethernet1/0 Type and number of the interface
send/recv Send/receive
no link found Means that the NAT translation item is not matched.
no matched rule Means that the NAT regulations are not matched.
The first command line shows that the ICMP packets (the source address is [Link],
the destination address is [Link]; ICMP ) are received by interface Ethernet1/1
and the corresponding NAT translation items are not found.
The second command line shows that the TCP packets (the source address is
[Link], the destination address is [Link]; the source port is 2000, the
destination port is 21) are transmitted from interface Ethernet1/0 and the matched
NAT regulations are not found.
Example 2:
Router# debug ip nat h323
NAT:H225:[I] processing a Setup message
NAT:H225:[I] found Setup sourceCallSignalling
NAT:H225:[I] fix TransportAddress addr-[Link]:11140
NAT:H225:[I] found Setup fastStart
NAT:H225:[I] Setup fastStart PDU length:18
NAT:H245:[I] processing OpenLogicalChannel message, forward channel 1
- 46 -
04-Network Protocol Configuration Commands
Field Description
NAT Means the packet has been translated by NAT.
- 47 -
04-Network Protocol Configuration Commands
To obtain an IP address for the Ethernet interface through DHCP, run ip address
dhcp. To delete the obtained IP address, run no ip address dhcp.
ip address dhcp
no ip address dhcp
Parameter
None
Default
None
Command Mode
Instruction
The ip address dhcp command allows the interface to obtain the IP address through
the DHCP protocol, which is useful for dynamically connecting the Internet service
provider (ISP) through the Ethernet interface. Once the dynamic IP address is
obtained, the Ethernet interface can adopt the PAT technology to realize the network
address translation (NAT).
- 48 -
04-Network Protocol Configuration Commands
If the ip address dhcp command is configured on the router, the router will
transmit the DHCPDISCOVER message to the DHCP server.
Example
The following example shows that interface Ethernet1/1 obtains its IP address
through the DHCP protocol.
!
interface Ethernet1/1
ip address dhcp
!
Related Command
ip dhcp client
ip dhcp-server
To configure the parameter about the DHCP client of the local router, run ip
dhcp client.
Parameter
Parameter Description
minlease seconds (optional) the minimum lease time, ranging from 60 to 86400 seconds
retransmit count (optional) retransmit times of the protocol packets, ranging between 1 and
10
retry_interval (optional) Interval for retriggering the DHCP request, ranging between 1
and 1440 minutes
select seconds (optional) interval for the select operation, ranging between 0 and 30
Default
- 49 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
You can adjust these parameters according to the network structure and the
DHCP server’s requirements.
If the “no” forms of these commands are configured, the parameters are reset to
the default values defined by the system.
Example
The following example shows that the receivable minimum lease time of the DHCP
client on the router is set to 100 seconds.
ip dhcp client minlease 100
The following example shows how to set the retransmission times of the
protocol packets on the DHCP client to three times.
ip dhcp client retransmit 3
The following example shows how to set the interval of retriggering the DHCP
request on the DHCP client to 10 minutes.
ip dhcp client retry_interval 10
The following example shows how to set the interval of selecting on the DHCP client to
10 seconds.
ip dhcp client select 10
Related Command
ip address dhcp
ip dhcp-server
3.1.3 ip dhcp-server
- 50 -
04-Network Protocol Configuration Commands
ip dhcp-server ip-address
no ip dhcp-server ip-address
Parameter
Parameter Description
Default
Command Mode
Instruction
The command can be used to specify the IP address of the DHCP server, while
the previously-designated IP address of the DHCP server will not be replaced.
You can use the “no” form of the command to delete the previously-configured
IP address of the DHCP server.
Example
The following example shows how to set the server with IP [Link] to the
DHCP server.
ip dhcp-server [Link]
Related Command
ip address dhcp
ip dhcp client
To check the DHCP server distribution information used by the current router,
run show dhcp lease.
- 51 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Command Mode
EXEC
Instruction
The command can be used to check the DHCP server distribution information used by
the current router.
Example
The following example shows the DHCP server distribution information used by the
router.
router#show dhcp lease
Related Command
ip address dhcp
ip dhcp client ip
dhcp-server
debug dhcp
- 52 -
04-Network Protocol Configuration Commands
To display the known DHCP server information, run show dhcp server.
Parameter
None
Default
None
Command Mode
EXEC
Instruction
The command is used to display the information about the known DHCP server.
Example
The following example shows the information about the known DHCP server.
router#show dhcp sever
DHCP Server [Link]
Leases: 0
Discovers: 62 Requests: 0 Declines: 0 Releases: 0
Offers: 0 Acks: 0 Naks: 0 Bad: 0
Subnet: [Link], Domain name:
Related Command
ip address dhcp
ip dhcp client
ip dhcp-server
To check the treatment condition of the DHCP protocol, run debug dhcp.
- 53 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command Mode
EXEC
Instruction
The following example shows some important information about DHCP treatment:
router#debug dhcp
router#2000-4-22 [Link] DHCP: Move to INIT state, xid: 0x7
2000-4-22 [Link] DHCP: SDISCOVER attempt # 1, sending 277 byte DHCP packet
2000-4-22 [Link] DHCP: B'cast on Ethernet1/1 interface from [Link]
Related Command
- 54 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
pkgs A parameter used by the DHCP server to check whether the address has
distributed the number of the transmitted ICMP packets.
Default
Command Mode
Instruction
You can run the following command to configure whether the DHCP server has
transmitted n ICMP packets when it check whether the address is distributed.
- 55 -
04-Network Protocol Configuration Commands
Example
You can run the following command to configure whether the DHCP server has
transmitted n ICMP packets when it check whether the address is distributed.
ip dhcpd ping packets 1
Parameter
Parameter Description
timeout Timeout time for waiting the ICMP echo message when the DHCP server
is used to check whether the address is distributed (unit: 100 ms)
Default
Command Mode
Global configuration
Instruction
You can run the following command to set the timeout time for waiting the ICMP
echo packet to n*100ms when it check whether the address is distributed.
Example
You can run the following command to set the timeout time for waiting the ICMP
echo packet to 300ms when it check whether the address is distributed.
ip dhcpd ping timeout 3
Parameter
Parameter Description
time Interval for the DHCP server to save the address distribution information
to the database (unit: minute)
- 56 -
04-Network Protocol Configuration Commands
Default
Command Mode
Global configuration
Instruction
The following command can be used to set the DHCP server to write the
address distribution information to the database every n minutes.
ip dhcpd write-time n
Example
The following example shows that the DHCP server is set to write the
address distribution information to the database every two days.
ip dhcpd write-time 1440
Parameter
Parameter Description
name Name of the DHCP address pool
Default
None
Command Mode
Instruction
You can run the following command to add the name DHCP address pool and
enter the DHCP address pool configuration mode.
- 57 -
04-Network Protocol Configuration Commands
Example
The following command in the example is used to add a test DHCP address pool and
enter the DHCP address pool configuration mode.
ip dhcpd pool test
Parameter
None
Default
Command Mode
Instruction
You can run the following command to enable the DHCP service. After the DHCP
service is enabled, the DHCP server supports the relay operation; for those
address requests that cannot be distributed by themselves, the DHCP requests will
be forwarded on the port where the ip-helper-address is configured.
Example
ip dhcpd enable
Parameter
None
Default
None
- 58 -
04-Network Protocol Configuration Commands
Command Mode
Global configuration
Instruction
ip dhcpd disable
Example
ip dhcpd disable
4.2.1 network
Parameter
Parameter Description
- 59 -
04-Network Protocol Configuration Commands
Default
None
Command Mode
Instruction
You can use the command to configure the network address of the address pool
for automatic distribution.
Before the command is configured, make sure that the network number of the IP
address for a port on the interface receiving the DHCP packet must be same to
the network.
Example
The following example shows how to set the network address of the DHCP
address pool to [Link] and the subnet mask to [Link].
network [Link] [Link]
4.2.2 range
Parameter
Parameter Description
low-addr Start address of the automatic address distribution range
Default
None
Command Mode
- 60 -
04-Network Protocol Configuration Commands
Instruction
You can use the command to configure the automatic address distribution range.
You can configure up to eight ranges for each address pool, while each range must
be in the network. The command is used only for the automatic distribution mode.
Example
The following example shows how to configure the address distribution range of
the DHCP address pool to [Link]~[Link].
range [Link] [Link]
4.2.3 default-router
default-router ip-addr
Parameter
Parameter Description
ip-addr Default route which is distributed to the client
Default
None
Command Mode
Instruction
You can run the command to configure the default route which is distributed to the
client; up to four default routes can be configured which are separated through space.
Example
The following example shows how to configure the default route of the DHCP client to
[Link].
default-router [Link]
4.2.4 dns-server
dns-server ip-addr …
- 61 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
ip-addr DNS server address distributed to the client
Default
None
Command Mode
Instruction
You can run the command to configure the address of the DNS server which is
distributed to the client; up to four DNS servers can be configured which are
separated through space.
Example
The following example shows how to configure the address of the DNS
server distributed to the client to [Link].
dns-server [Link]
4.2.5 domain-name
domain-name name
Parameter
Parameter Description
name Domain name distributed to the client
Default
None
Command Mode
- 62 -
04-Network Protocol Configuration Commands
Instruction
You can run the command to configure the domain name which is distributed to
the client.
Example
The following example shows how to configure the domain name to [Link].
domain-name [Link]
4.2.6 lease
Parameter
Parameter Description
days Days distributed by the address
Default
one day
Command Mode
Instruction
You can run the command to configure the time limitation of the address which
is distributed to the client.
Example
The following example shows how to configure the time limitation of the address which
is distributed to the client to 12 hours and two days.
Lease 2 12
4.2.7 netbios-name-server
netbios-name-server ip-addr
- 63 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
ip-addr Address of the netbios name server distributed to the client
Default
None
Command Mode
Instruction
You can run the command to configure the address of the netbios name server which
is distributed to the client; up to four netbios name servers can be configured which
are separated through space.
Example
The following example shows how to configure the address of the DNS
server distributed to the client to [Link].
netbios-name-server [Link]
4.2.8 host
Parameter
Default
None
Command Mode
- 64 -
04-Network Protocol Configuration Commands
Instruction
Run the command to configure the manually distributed host ip address of the address
pool. The command can only be applied in manually distributed mode. host and range
cannot be configured in the same address pool simultaneously.
Example
4.2.9 hardware-address
Parameter
Default
Command Mode
Instruction
Run the command to configure the hardware address used for matching the
client machine. The address format is two 16 hexadecimal number system, such
as [Link]gh. The command is only used in the manually distributed mode.
Example
The following command is to configure the hardware address used for matching
the client machine: [Link].
hardware-address [Link]
4.2.10 client-identifier
- 65 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
unique-identifier Matches the ID of the client.
Default value
None
Command Mode
Instruction
This command is used to configure the client ID which is used to match the client.
The format of the client ID is like [Link]. This command is used only in manual
distribution mode.
Example
The following example shows how to set the client ID of the manual-DHCP-distribution
address pool to [Link].
ip-bind ip-addr client-identifier 01.10.a0.0c.13.64.7d
4.2.11 client-name
Parameter
Parameter Description
name Means the name of the client.
Default value
None
Command Mode
- 66 -
04-Network Protocol Configuration Commands
Instruction
This command is used to configure the host name which is distributed to the
client. This command is used only in manual distribution mode.
Example
The following example shows how to set the name of the client to test.
ip-bind ip-addr client-name test
Parameter
None
Default
None
Command Mode
EXEC
Instruction
You can run the command to open the debugging switch of the DHCPD packet.
Example
The following command is used to enable the debugging switch of the DHCPD packet.
debug ip dhcpd packet
- 67 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Command Mode
EXEC
Instruction
You can run the command to open the debugging switch of the DHCPD event.
Example
The following command is used to enable the debugging switch of the DHCPD event.
debug ip dhcpd event
Parameter
None
Default
None
- 68 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
You can run the command to display the DHCPD statistics information, including
the number of all types of packets and the number of automatically- or manually-
distributed addresses.
Example
Parameter
Parameter Description
ip-addr Address whose binding information requires to be displayed
Default
Command Mode
Instruction
You can run the following command to display the binding information, IP
address, hardware address, binding type and timeout time about the DHCPD.
Example
- 69 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Command Mode
Instruction
You can run the command to display the information about the DHCPD address
pool, including the network number of the address pool, address range, number of
the distributed addresses, number of the temporarily-deserted addresses, number of
the addresses that can be distributed, manually-distributed IP address and hardware
address.
Example
The following command is used to display the statistics information about the DHCPD
address pool.
show ip dhcpd pool
Parameter
None
Default
None
Command Mode
EXEC
- 70 -
04-Network Protocol Configuration Commands
Instruction
You can run the command to delete the statistics information about the number of
the packets.
Example
The following command is used to delete the statistics information about the number
of the packets.
Parameter
Parameter Description
ip-addr Address whose binding information requires to be deleted
Default
Command Mode
EXEC
Instruction
You can run the command to delete the binding information about the
designated address.
Example
- 71 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Command Mode
EXEC
Instruction
Example
Parameter
None
- 72 -
04-Network Protocol Configuration Commands
Default
None
Command Mode
Instruction
Run the command to show the statistics of DHCPD including numbers of all
packets, the address number of automatic distribution and manual distribution.
Example
Parameter
Default
Command Mode
Instruction
Run the command to show DHCPD statistics such as address binding information,
IP address, hardware address, binding type and timeout.
Example
- 73 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Command Mode
Instruction
Run the command to show DHCPD statistics including the network number of the
address pool, the address range, the number of distributed address, the number
of abandoned address, the address number to be distributed, manual distributed
IP address and hardware address.
Example
Parameter
None
Default
None
Command Mode
Management
Instruction
Run the command to delete statistics about the packet number of DHCPD:
- 74 -
04-Network Protocol Configuration Commands
Example
Parameter
Default
Command Mode
Management
Instruction
Example
Parameter
None
- 75 -
04-Network Protocol Configuration Commands
Default
None
Command Mode
Management
Instruction
Example
- 76 -
04-Network Protocol Configuration Commands
To enable Dhcp-relay snooping function, run ip dhcp-relay snooping; to disable the function,
run the negative form of the command.
ip dhcp-relay snooping
no ip dhcp-relay snooping
Parameter
None
Default
- 77 -
04-Network Protocol Configuration Commands
Description
None
Example
Parameter
Default
None
Instruction
Example
Description
- 78 -
04-Network Protocol Configuration Commands
Parameter
Default
Instruction
Configure available max number of DHCP snooping VLAN. Execute the principle of
“First come, first served”. That is, new client cannot be distributed if the user
number has reached the maximum.
Example
Run following command to snooping DHCP packe ton VLAN2. The max user
number is 3.
Switch_config#ip dhcp-relay snooping vlan 2 max-client 3
Switch_config#
Description
Parameter
None
Default
Instruction
No DHCP snooping on DHCP trust port. The negative form of the command is the
default value.
Example
- 79 -
04-Network Protocol Configuration Commands
Description
Parameter
None
Default
Instruction
Disable DHCP snooping detection on the port. Enable dhcp snooping trust, ip-source
trust and arp inspection trust after configuration. The negative form of the command
is the default value.
Example
Description
Parameter
None
Default
None
- 80 -
04-Network Protocol Configuration Commands
Instruction
Example
Description
Parameter
None
Default
None
Instruction
Example
Description
- 81 -
04-Network Protocol Configuration Commands
Parameter
None
Default
None
Instruction
Example
Description
Parameter
None
Default
None
Instruction
Example
- 82 -
04-Network Protocol Configuration Commands
Description
Parameter
None
Default
None
Instruction
Example
- 83 -
04-Network Protocol Configuration Commands
- 84 -
04-Network Protocol Configuration Commands
show tcp brief
show tcp statistics
show tcp tcb
clear tcp {local host-name port remote host-name port | tcb address}
Parameter
Parameter Description
local host-name port IP address and TCP port of the local host
remote host-name port IP address and TCP port of the remote host
tcb address Address of the transmission control block (TCB) for the to-be-deleted TCP
connection TCB is an internal identifier of the TCP connection, which can
be obtained through the show tcp brief command.
Command Mode
EXEC
Instruction
The clear tcp command is mainly used to delete the terminated TCP connection.
Sometimes, because of communication line faults, TCP connection or the peer host is
restarted and the TCP connection is actually closed. The TCP connection has no
communication, so the system does not know that the TCP connection is already
closed. In this case, the clear tcp command is used to close the invalid TCP
connection. The clear tcp local host-name port remote host-name port command is
used to close the TCP connection between the IP address or port of the local host and
the IP address or port of the remote host. The clear tcp tcb address command is
used to close the TCP connection identified by the designated TCB address.
Example
The following example shows that the TCP connection between [Link]:23
(local) and [Link]:4420 (remote). The show tcp brief command is used to
display the information of the local and remote hosts of the current TCP connection.
- 85 -
04-Network Protocol Configuration Commands
The following example shows how to clear the TCP connection whose TCB address
is 0xea38c8. The show tcp brief command displays the TCB address of the TCP
connection.
Router#show tcp brief
TCB Local Address Foreign Address State
0xEA38C8 [Link]:23 [Link]:1583 ESTABLISHED
Router#clear tcp tcb 0xea38c8
Router#show tcp brief
TCB Local Address Foreign Address State
Related Command
show tcp
To clear the statistics data about TCP, run the following command:
Parameter
Command Mode
EXEC
Example
Related Command
- 86 -
04-Network Protocol Configuration Commands
To display the ARP interaction information, such as ARP request transmitting, ARP
response receiving, ARP request receiving and ARP response transmitting, run debug
arp. When the router and host cannot communicate with each other, you can run the
command to analyze the ARP interaction information. You can run no debug arp to
stop displaying the ARP interaction information.
debug arp
no debug arp
Parameter
Command Mode
EXEC
Example
Router#debug arp
Router#IP ARP: rcvd req src [Link] [Link], dst [Link],
Ethernet1/0 IP ARP: req filtered src [Link] [Link], dst [Link] 00:
The first information line shows that the router receives an ARP request from
Ethernet 1/0. The ARP is sent from a host whose IP address is [Link] and
MAC address is [Link] and received by a host whose IP address is
[Link]. The ARP request requires the MAC address of the destination host.
IP ARP: rcvd req src [Link] [Link], dst [Link], Ethernet1/0
The second information line shows that the router receives an ARP address request
with IP [Link] from interface Etherner 1/1. However, according to the
interface configuration of the router, the interface is not in the network claimed by the
host. The reason may lie in the incorrect host configuration. If the router creates an
ARP cache according to the information, it cannot communicate with a host having
the same address though the host connects an interface normally.
IP ARP: req filtered src [Link] [Link], dst [Link] 00:
The third line shows that, before the router resolves the MAC address of host
[Link], an incomplete ARP item must be created in the ARP cache for the host;
after the ARP response is received, the MAC address is entered. According to the
configuration of the router, the host connects interface Ethernet1/0.
- 87 -
04-Network Protocol Configuration Commands
The fourth information shows that the router transmits the ARP request from interface
Ethernet 1/0, the IP address of the router is [Link], the MAC address of the
interface is [Link] and the IP address of the requested host is [Link].
The four information line has connection with the third information line.
IP ARP: sent req src [Link] [Link], dst [Link], Ethernet1/0
The fifth information line shows the router receives the ARP response which is
transferred from host [Link] to the router’s interface [Link] on
interface Ethernet 1/0, telling that the MAC address is [Link]. The fifth
information line has connection with the third and fourth information lines.
IP ARP: rcvd reply src [Link] [Link], dst [Link], Ethernet1/0
debug ip icmp
no debug ip icmp
Parameter
Command Mode
EXEC
Instruction
The command is used to display the received and transmitted ICMP packets, helping
to resolve the end-to-end connection problem. To understand the detailed meaning
of the debug ip icmp command, see RFC 792, “Internal Control Message Protocol”.
Example
Router#debug ip icmp
Router#ICMP: sent pointer indicating to [Link] (dst was [Link]), len 48
- 88 -
04-Network Protocol Configuration Commands
Domain Description
ICMP: Displays the information about ICMP.
pointer indicating Type of the ICMP packet, which shows the original IP packet is incorrect
and specifies the incorrect domain Other types of ICMP packet include:
echo reply
dst unreachable,including:
---net unreachable
---host unreachable
---protocol unreachable
---port unreachable
---net unknown
---net prohibited
---host prohibited
source quench
redirect, including:
---net redirect
---host redirect
echo
router advertisement
router solicitation
time exceeded,including:
---ttl exceeded
- 89 -
04-Network Protocol Configuration Commands
---reassembly timeout
parameter problem,including:
---pointer indicating
---option missed
---bad length
timestamp
timestamp reply
information request
information reply
mask request
mask reply
If it is the unknown ICMP type, the system will display the ICMP type and
its code.
(dst was The destination address of the original packet leading to the ICMP packet
[Link]) is [Link].
len 48 The length of the ICMP packet is 48 bytes, the length of IP header
excluded.
dst [Link] Means the destination address of the ICMP packet is [Link].
Different types of ICMP packets have different formats when the ICMP packet
is generated.
For example, the ICMP redirect packet adopts the following format:
ICMP: rcvd host redirect from [Link], for dst [Link] use gw [Link], len 36
ICMP: sent host redirect to [Link], for dst [Link] use gw [Link], len 36
- 90 -
04-Network Protocol Configuration Commands
The first information line shows that the redirect ICMP packet from host
[Link] is received and gateway [Link] is recommended to forward
the packet to destination host [Link]; the length of the ICMP packet is 36 bytes.
The second information line shows the redirect ICMP packet is sent to host
[Link]. The redirect ICMP packet notifies the host of using gateway
[Link] to send packets to host [Link]. The length of the ICMP packet is
36 bytes.
For the DST unreachable ICMP packet, the following format is adopted for printing:
ICMP: sent dst ([Link]) host unreachable to [Link], len 36
The first information line shows that, because the router cannot route a certain IP
packet, the destination-unreachable ICMP packet will be sent to source host
[Link]. The length of the ICMP packet is 36 bytes.
The second information line shows that the router receives an ICMP packet from
host [Link], notifying that the destination host [Link] cannot be reached.
The length of the ICMP packet is 36 bytes.
To display the IP interaction information, run debug ip packet. You can run no
debug ip packet to stop displaying the IP interaction information.
no debug ip packet
Parameter
Parameter Description
detail (optional) exports the protocol information encapsulated in the IP packet,
including protocol number, UDP, number of the TCP port and type of the
ICMP packet.
ip-access-list-name (optional) name of the IP access list for filtering and exporting information
Only the information about the IP packet which meets the requirement of
the designated IP access list can be exported.
access-group (optional) name of the IP access list for filtering and exporting information
Only the information about the IP packet which meets the requirement of
the designated IP access list can be exported.
interface (optional) name of the port for filtering and exporting information Only the
information about the IP packet which meets the requirement of the
designated port can be exported.
Command Mode
EXEC
- 91 -
04-Network Protocol Configuration Commands
Instruction
The command helps you to know the final direction of each received or locally-
generated IP packet flow and detect the reason of communication problems.
If you use the command, lots of output information will appear; you had better run the
router at a relatively free time, or the system’s performance may be badly affected.
Additionally, you had better filter the information output through the access
list, enabling the system to display the information that interests users.
Command Mode
EXEC
- 92 -
04-Network Protocol Configuration Commands
Example
router#debug ip packet
router#IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), g=[Link], len=60,
redirected
IP: s=[Link] (local), d=[Link] (Ethernet1/0), g=[Link], len=56,
sending
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), g=[Link], len=60, forward
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=56, rcvd
Domain Description
IP Means that the information is about the IP packet.
s=[Link] Source address of the IP packet and the name of the interface receiving
(Ethernet1/0) the packet
d=[Link] Destination address of the IP packet and the name of the interface
(Ethernet1/0) transmitting the packet (if the routing succeeds)
g=[Link] Destination address of the next hop of the IP packet, which may be the
gateway address or the destination address
redirected Means the router will send the ICMP redirected packet to the source host
of the ICMP packet. The following are other cases:
unroutable---The addressing of the packet fails and and the packet will be
dropped.
rejected source route---Because the system does not support the source
route, the packets with the IP source route are rejected.
need frag but DF set---The local packet need be fragmented; however, the
DF is reset.
- 93 -
04-Network Protocol Configuration Commands
The first information line shows that the router has received an IP packet; its source
address is [Link] and destination address is [Link]; it is from the network
segment connected by interface Ethernet 1/0; the transmitter interface determined by
the routing table is interface Ethernet1/0; the gateway's address is [Link] and
the length of the packet is 60 bytes. The gateway and the source host which transmits
the IP packet are connected on the same network, that is, the network connected by
interface Ethernet 1/0 of the router. Hence, the router transmits the ICMP redirect
packet.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), g=[Link], len=60,
redirected
The second information line describes the transmission of the ICMP redirect packet.
The source address is the local address [Link] and the destination address is
the source addresss of the previous packet, that is, [Link]. The ICMP
redirect packet is transmitted from interface Ethernet1/0 to the destination directly, so
the address of the gateway is the destination address [Link]. The length of
the ICMP redirect packet is 56 bytes.
IP: s=[Link] (local), d=[Link] (Ethernet1/0), g=[Link],
len=56, sending
The third information line shows that the IP layer receives an IP packet. The
source address of the packet is [Link]; the transmitter interface is
interface Ethernet1/0; the destination address of the packet is [Link]. Through
the routing table, the packet is found to forward to interface Ethernet1/0; the
address of the gateway is [Link] and the length of the packet is 60 bytes.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), g=[Link], len=60, forward
The fourth information line shows that the IP layer receives an IP packet. The source
address is [Link] and the receiver interface is Ethernet1/0; the destination
address is [Link], which is an IP address configured on interface Ethernet1/0
of the router; the length of the packet is 56 bytes.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=56, rcvd
The output of the debug ip packet detail command is described in the following.
Only newly-added parts are described.
router#debug ip packet detail
router#IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=328, rcvd,
UDP: src=68, dst=67
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=68, rcvd, proto=89
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=84, rcvd, ICMP: type=0,
code = 0
IP: s=[Link] (local), d=[Link] (Ethernet1/0), g=[Link], len=40,
sending, TCP: src=1024, dst=23, seq=75098622, ack=161000466, win=17520, ACK
Domain Description
UDP Protocol name, such as UDP, ICMP or TCPOther protocols are presented
with the protocol number.
- 94 -
04-Network Protocol Configuration Commands
src, dst Source port and destination port of the UDP/TCP packet
ACK ACK in the control bit of the TCP packet is reset, indicating that the
acknowledge number is valid. Other control bits include SYN, URG, FIN,
PSH and RST.
The first information line shows that the UDP packet is received. The source port is
68 and the destination port is 67.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=328, rcvd, UDP: src=68,
dst=67
The second information line shows that the protocol number of the received packet
is 89.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=68, rcvd, proto=89
The third information line shows that the ICMP packet is received. Both the packet
type and the code are 0.
IP: s=[Link] (Ethernet1/0), d=[Link] (Ethernet1/0), len=84, rcvd, ICMP: type=0,
code = 0
The fourth information line shows that the TCP packet is transmitted. The source port
is 1024, the destination port is 23, the sequence number is 75098622, the
acknowledge number is 161000466, the size of the receiver window is 17520 and the
ACK bit is reset. For the meanings of these domains, see RFC 793— TRANSMISSION
CONTROL PROTOCOL.
IP: s=[Link] (local), d=[Link] (Ethernet1/0), g=[Link], len=40,
sending, TCP: src=1024, dst=23, seq=75098622, ack=161000466, win=17520, ACK
The following describes how to use the ACL. For example, to display the information
about the packet whose source address is [Link], you need to define the
abc ACL and then allow the IP packets whose source address is [Link]. At
last, you can use the ACL through the debug ip packet command.
Router#config
Router_config#ip access-list standard abc
Router_config_std_nacl#permit [Link]
Router_config_std_nacl#exit
Router_config#exit
Router#debug ip packet abc
Router#IP: s=[Link] (Ethernet0/1), d=[Link] (Ethernet0/1), len=48, rcvd
In the previous commands, the standard ACL is used. However, the expanded
ACL can also be used.
Related Command
- 95 -
04-Network Protocol Configuration Commands
To display the information about IP interaction, run debug ip raw [detail] [access-
list-group] [interface]. To stop displaying information about IP interaction, run no
debug ip raw.
no debug ip raw
Parameter
Parameter Description
detail (optional) exports the protocol information encapsulated by the IP packet,
such as the protocol number, number of the UDP port and the TCP port,
and type of the TCP packet.
access-group (optional) name of the IP ACL which is used to filter the output
informationOnly the information about the IP packets that comply with the
designated IP ACL can be exported.
interface (optional) interface name which is used to filter the output informationOnly
the information about the IP packets that comply with the designated port
can be exported.
Command Mode
EXEC
Instruction
The command helps you to know the final destination of each received or
locally-generated IP flows and to find the reason of the communication problem.
- 96 -
04-Network Protocol Configuration Commands
Receiving the packets.
Receiving IP fragments
Transmitting the packet
Transmitting the broadcast/multicast
Failed addressing of locally-generated packets
Locally-generated packets being fragmented
Received packets being filtered
Transmitted packets being filtered
Encapsulation of the link layer failed (only for Ethernet)
Unknown protocol
If you use the command, lots of output information will appear; you had better run the
router at a relatively free time, or the system’s performance may be badly affected.
Additionally, you had better filter the information output through the access
list, enabling the system to display the information that interests users.
Example
Related Command
To display the information about the header compression, run debug ip rtp
{header-compression|packets |rtcp}. You can run no debug ip rtp
{header-compression|packets |rtcp} to stop displaying the information about
the header compression.
Parameter
Parameter Description
header-compress RTP/UDP/IP header compression
- 97 -
04-Network Protocol Configuration Commands
Command Mode
EXEC
Instruction
The command helps you to understand the whole process of header compression
and interaction.
If you use the command, lots of output information will appear; you had better run the
router at a relatively free time, or the system’s performance may be badly affected.
Example
- 98 -
04-Network Protocol Configuration Commands
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7087, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4025, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4026, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7088, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7089, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4027, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7090, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4028, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7091, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4029, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7092, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4030, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7093, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7094, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4032, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7095, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4033, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7096, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4034, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7097, Gen
=0
2002-1-9 [Link]
- 99 -
04-Network Protocol Configuration Commands
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7098, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4036, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7099, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4037, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7100, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4038, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7101, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: tossing error packet
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7102, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4040, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7103, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4041, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7104, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4042, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7105, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7106, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4044, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7107, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4045, Gen =
0 2002-1-9 [Link]
[Link] RHC Serial1/0: output uncompressed, conn 0, cksum 0x0000, seq 7108, Gen = 0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 4046, Gen = 0
- 100 -
04-Network Protocol Configuration Commands
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7109, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 7110, Gen
=0
2002-1-9 [Link]
[Link] RHC Serial1/0: recv uncompress, conn 0, cksum 0x0000, seq 4048, Gen = 0
no deb all
To display the information about receiving and transmitting the TCP packet, run debug ip
tcp packet. To stop displaying relative information, run no debug ip tcp packet.
Parameter
Command Mode
EXEC
Example
- 101 -
04-Network Protocol Configuration Commands
ESTABLISHED Current state of the TCP connectionFor the description of the TCP
connection’s state, see the description of the debug ip tcp transactions
command.
[Link]:23 The source address of the packet is [Link] and the source port is
23.
DATA 1 Means that the packet contains only one effective byte.
Other control bits include ACK, FIN, SYN, URG and RST.
WIN 4380 Window domain of the packet used to notify the peer end to receive the
cache size, which is 4380 bytes currently
If a domain of the previous domains does not appear, the domain has no
effective value in the TCP packet.
Related Command
To display the important interaction information about TCP, such as the state change
of the TCP connection, run debug ip tcp transactions. To stop displaying relative
information, run no debug ip tcp transactions.
- 102 -
04-Network Protocol Configuration Commands
Parameter
Command Mode
EXEC
Example
Domain Description
TCP: Displays the TCP interaction information.
rcvd connection Receives the connection request from the peer port 23, that is, the
attempt to port 23 TELNET port.
TCB 0xE88AC8 Generates a new control block for the TCP connection, which is identified
created as 0xE88AC8.
state was LISTEN Means that the TCP state machine changes from LISTEN to SYN_RCVD.
-> SYN_RCVD
The states of the TCP include:
LISTEN—waiting for the TCP connection request from any remote host
- 103 -
04-Network Protocol Configuration Commands
The third domain (3828) stands for the remote TCP port.
sending SYN Transmits a connection request out (the SYN of the control bit in the TCP
header is reset). Other TCP control bits include SYN, ACK, FIN, PSH,
RST and URG..
rcvd FIN Means that the connection termination request is received (FIN in the
control bit of the TCP header is reset).
connection closed Means that the upper-layer application requires closing the TCP
- 104 -
04-Network Protocol Configuration Commands
by user connection.
connection timed Means that the connection is closed because it times out.
out
Related Command
To display the information about UDP interaction, run debug ip udp. To stop
displaying the information about UDP interaction, run no debug ip udp.
debug ip udp
no debug ip udp
Parameter
Command Mode
EXEC
Example
Router#debug ip udp
Router#UDP: rcvd src [Link](520), dst [Link](520), len = 32
Domain Description
UDP: Means that the information is about the UDP packet.
src Stands for the source IP address and UDP port of the UDP packet.
dst Stands for the destination IP address and UDP port of the UDP packet.
The first information shows that the UDP packet is received. Its source address
is [Link] and its source port is port 520; its destination address is
[Link] and its destination port is port 520; the length of the packet is 32
bytes.
The second information shows that the UDP packet is transmitted. Its source
address is [Link] and its source port is port 20001; its destination address is
- 105 -
04-Network Protocol Configuration Commands
[Link] and its destination port is port 1001; the length of the packet is 1008
bytes.
6.1.11 ip mask-reply
To enable the router to answer the request of the IP mask on the designated
interface, run ip mask-reply. To disable this function, run no ip mask-reply.
ip mask-reply no
ip mask-reply
default ip mask-reply
Parameter
Default
Command Mode
Example
!
interface ethernet
1/1 ip mask-reply
!
6.1.12 ip mtu
To set the MTU of the IP packet transmitted from an interface, run ip mtu bytes.
To reuse the default value of MTU, run no ip mtu.
ip mtu bytes
no ip mtu
Parameter
Parameter Description
bytes Maximum IP transmission length which is counted with bytes
- 106 -
04-Network Protocol Configuration Commands
Default
The physical media of the interfaces are different, while the MTU on the interfaces
are same. Sixty-eight bytes is the minimum MTU.
Command Mode
Instruction
If the length of the IP packet exceeds the IP MTU configured on the interface, the
router will fragment the packet. Devices on the same physical media can communicate
with each other only when they are configured with the same MTU. The MTU value will
affect the value of the IP MTU. If the value of IP MTU and that of MTU are same, the
value of IP MTU will automatically change to the new value of MTU when the MTU
value changes. However, the value of MTU will not change if the value of IP MTU
changes.
The minimum value of the IP MTU is 68 bytes, and its maximum value cannot exceed
the MTU value configured on the interface.
Example
The following example shows how to set the IP MTU of the interface to 200:
!
interface serial0/0
ip mtu 200
!
Related Command
mtu
6.1.13 ip redirects
To transmit the IP ICMP redirect packet, run ip redirects. To stop transmitting the
IP ICMP redirect packet, run no ip redirects.
ip redirects
no ip redirects
Parameter
- 107 -
04-Network Protocol Configuration Commands
Default
Command Mode
Instruction
When the router detects that the forwarding interface of the gateway is the same as
that of the received packet during the transmission of packets and if the packet-
transmitting host directly connects the logic network of the interface, the router can
transmit an ICMP redirect packet according to the protocol, notifying the source host
of directly taking that router as the gateway for the destination address of the packet
without packet forwarding through this router.
Example
The following example shows how to enable the function of transmitting the
ICMP redirect passage on interface ethernet1/0:
!
interface ethernet
1/0 ip redirects
!
6.1.14 ip route-cache
To enable the route cache on an interface to forward the IP packet, run ip route-cache.
To forbid the route cache on an interface, run no ip route-cache.
ip route-cache no
ip route-cache
ip route-cache same-interface no
ip route-cache same-interface
Parameter
Parameter Description
- 108 -
04-Network Protocol Configuration Commands
same-interface Allows the IP packet to be rapidly forwarded from the received interface.
Default
Command Mode
Instruction
The route cache can conduct the load balance to the forwarded packets based on
the source/destination address.
If the route cache is enabled, the packet forwarding rate of the router will be improved.
However, the route cache should be forbidden on the low-speed line (64k or even less
than 64k).
You can run ip route-cache same-interface to allow rapid IP switching on the same
interface, that is, the receiver interface is same to the transmitter interface. In general,
the function is not recommended to be enabled because the function conflicts with the
redirect function of the router. If you has a incompletely-connected network, such as a
frame-relay network, you can enable the function on the frame-relay interface. For
example, in a frame-relay network consisting of routers A, B and C, there are only
links from A to B and from B to C, the communication between router A and router C
must be forwarded through router B. In this case, router B receives a packet from
router A through a DLCI of an interface, and then transmits the packet to router C
through another DLCI of the same interface.
Example
The following command is used to allow fast switching on the same interface.
ip route-cache same-interface
The following command is used to forbid fast switching even on the same interface.
no ip route-cache
The following command is used to forbid fast switching only on the same interface.
no ip route-cache same-interface
The following command is used to enable the default setting (allowing fast
switching, the same interface excluded).
ip route-cache
Related Command
show ip cache
- 109 -
04-Network Protocol Configuration Commands
6.1.15 ip source-route
To enable the router to handle the IP packet with the source IP route option, run
ip source-route. To enable the router to drop the IP packet with the source IP
route option, run no ip source-route.
ip source-route
no ip source-route
Parameter
Default
Command Mode
Example
The following example shows how to enable the router to handle the IP packet with the
source IP route option.
ip source-route
Related Command
ping
To set the timeout time for the router to wait for the successful TCP connection, run
ip tcp synwait-time seconds. To resume the default timeout time, run no ip tcp
synwait-time.
no ip tcp synwait-time
Parameter
Parameter Description
seconds Time for the TCP connection, whose unit is second The valid vale ranges
between 5 and 300 seconds. The default value is 75.
- 110 -
04-Network Protocol Configuration Commands
Default
75 seconds
Command Mode
Instruction
When the router triggers the TCP connection and if the TCP connection is not
established in the designated wait time, the router views that the connection fails and
then sends the result to the upper-layer program. You can set the wait time for
creation of the TCP connection. The default value of the wait time is 75 seconds. The
option has no relation with the TCP connection packet which is forwarded through the
router, but has relation with the TCP connection of the router itself.
To know the current value, you can run ip tcp synwait-time?. The value in the
square bracket is the current value.
Example
The following example shows how to set the wait time of creating TCP connection
to 30 seconds:
Router_config#ip tcp synwait-time 30
Router_config#ip tcp synwait-time ?
<5-300>[30] seconds -- wait time
To set the size of the TCP window, run ip tcp window-size bytes. To resume the
default size of the TCP window, run no ip tcp window-size.
no ip tcp window-size
Parameter
Parameter Description
bytes Size of the windowThe maximum window size is 65535 bytes. The default
window size is 2000 bytes.
Default
2000 bytes
- 111 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
Do not change the window size at will unless you have a definite purpose. To know the
current value, you can run ip tcp synwait-time ?. The value in the square bracket is
the current value.
Example
The following example shows how to set the size of the TCP window to 6000 bytes.
Router_config#ip tcp window-size 6000
Router_config#ip tcp window-size ? <1-
65535>[6000] bytes -- Window size
6.1.18 ip unreachables
To enable the router to transmit the ICMP unreachable packet, run ip unreachable.
To enable the router to stop transmitting this packet, run no ip unreachable.
ip unreachable
no ip unreachable
Parameter
Default
Command Mode
Instruction
When the router forwards the IP packet, the packet may be dropped because there
is no relative route in the routing table. In this case, the router can send the ICMP
unreachable packet to the source host, notifying the source host and enabling it to
detect the host timely and correct the fault rapidly.
- 112 -
04-Network Protocol Configuration Commands
Example
The following example shows how to enable the ICMP unreachable packet to
be transmitted on interface Ethernet 1/0:
!
interface ethernet
1/0 ip unreachables
!
Parameter
Default
Command Mode
Interface configuration
Instruction
VRF is a prerequisite to configure the command, as the command will delete the ip
address configuration under the interface. The command is to configure VRF first
and then configure ip address.
Example
To display the route cache which is used for fast IP switching, run show ip
cache [prefix mask] [type number].
- 113 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
prefix mask Displays the items whose destination addresses match up the designated
prefixes/masks users enter. It is optional.
type number Displays the items whose transmitter interfaces match up the designated
interface types/numbers users enter. It is optional.
Command Mode
EXEC
Example
Router#show ip cache
Source Destination Interface Next Hop
[Link] [Link] Serial1/0 [Link]
[Link] [Link] Serial1/0 [Link]
[Link] [Link] Ethernet1/1 [Link]
Domain Description
Source Source address
The following example shows the route cache whose destination address matches up
the designated prefix/mask.
Router#show ip cache [Link] [Link]
Source Destination Interface Next Hop
[Link] [Link] Ethernet0/1 [Link]
The following example shows the route cache whose transmitter interface matches up
the designated interface type/mask.
- 114 -
04-Network Protocol Configuration Commands
Parameter
Command Mode
EXEC
Example
show ip sockets
Parameter
- 115 -
04-Network Protocol Configuration Commands
Command Mode
EXEC
Example
Router#show ip sockets
17 [Link] 0 [Link] 0 69 0
6 [Link] 0 [Link] 0 23 0
Domain Description
Proto Number of the IP protocol
If the value is 17, it means the UDP protocol; if the value is 6, it means the
TCP protocol.
show ip traffic
Parameter
Command Mode
EXEC
- 116 -
04-Network Protocol Configuration Commands
Example
Router#show ip traffic
IP statistics:
UDP statistics:
TCP statistics:
IGMP statistics:
Rcvd: 0 total, 0 format errors, 0 checksum
errors 0 host queries, 0 host reports
- 117 -
04-Network Protocol Configuration Commands
ARP statistics:
bad hop count If the router finds that the TTL value of the packet decreases to zero when
it forwards the packet, the packet will be dropped.
To display the states of all TCP connections, run the following command:
show tcp
Parameter
Command Mode
EXEC
Example
Router#show tcp
TCB 0xE9ADC8
Connection state is ESTABLISHED, unread input bytes: 934
Local host: [Link], Local port: 1023
Foreign host: [Link], Foreign port: 513
- 118 -
04-Network Protocol Configuration Commands
Rcvd: 102 (out of order: 0), with data: 92, total data bytes: 81396
Sent: 104 (retransmit: 0), with data: 31, total data bytes: 61
Domain Description
TCB 0xE77FC8 Internal identifier of the control block for the TCP connection
SYN_SENT---Means that the response from the peer is being waited after
the connection request is transmitted to the peer.
- 119 -
04-Network Protocol Configuration Commands
unread input bytes: Data that is submitted to but not yet received by the upper-layer
application after the lower-layer TCP handles
Enqueued bytes for Bytes in the transmission queue, including the transmitted but
transmit: unacknowledged data bytes and not-yet-transmitted data bytes
input: Data in the receiver queue which is waiting for being received by the
upper-layer application after sorting
The information about the currently-displayed timer will then be displayed, including
start-up times, timeout times and next timeout time. Each connection has its
independent timers. The timeout times of the timer are generally less than the start-up
times of the timer because the timer may be reset when it is running. For example, if
the system receives the peer’s acknowledgement of all transmitted data when the re-
sending timer runs, the re-sending timer will stop running.
Timer Starts Wakeups Next(ms)
Retrans 33 1 0
TimeWait 0 0 0
SendWnd 0 0 0
KeepAlive 102 0 7199500
Domain Description
Timer Name of the timer
Retrans Retransmission timer which is used to retransmit the data The timer is
restarted after the data is transmitted. If the data is not acknowledged by
the peer during the timeout time, the data will be resent.
TimeWait Time-wait timer which is used to ensure that the peer receives the
acknowledgement of the connection termination request.
- 120 -
04-Network Protocol Configuration Commands
SendWnd Timer of the transmission timer, used to ensure that the receiver window
resumes the normal size after the TCP acknowledgement is lost.
KeepAlive KeepAlive timer used to ensure that the communication link is normal and
the peer is still in the connection state It will trigger the transmission of the
test packet to detect the state of the communication link and the peer’s
state.
The sequence number of the TCP connection will then be displayed. The reliable
and ordered data transmission is guaranteed through the sequence number. The
local/remote host conducts flow control and transmission acknowledgement through
the sequence number.
iss: 29139463 snduna: 29139525 sndnxt: 29139525 sndwnd: 17520
irs: 709124039 rcvnxt: 709205436 rcvwnd: 4380
Domain Description
iss: Initial transmission sequence number
snduna: Transmission sequence number of the first byte in the data which has
been transmitted but the peer’s acknowledgement is not received
sndnxt: Transmission sequence number of the first byte in the data which will be
transmitted next time
irs: Initial reception sequence number, that is, initial transmission sequence
number of the remote host
The transmission time recorded by the local host is then displayed. The system can
adapt to different networks according to the data.
SRTT: 15 ms, RXT: 2500 ms, RTV: 687 ms
minRXT: 1000 ms, maxRXT: 64000 ms, ACK hold: 200 ms
Domain Description
SRTT: Round-trip time after smooth handlement
ACK hold: Maximum latency time for delaying the acknowledgement and enabling it
to be transmitted together with the data
- 121 -
04-Network Protocol Configuration Commands
is
Rcvd: Number of packets received by the local host through the connection and
the number of mis-ordered packets
Sent: Total number of packets transmitted by the local host during the
connection and the number of resent packets
Related Command
To display the brief information about the TCP connection, run the following command:
Parameter
Parameter Description
all (optional) Displays all ports. If the keyword is not entered, the system will
not display the port in listening mode.
Command Mode
EXEC
Example
Domain Description
TCB Internal identifier of the TCP connection
State State of the connectionFor details, see the show tcp command.
- 122 -
04-Network Protocol Configuration Commands
Related Command
show tcp
To display the statistics data about TCP, run the following command:
Parameter
Command Mode
EXEC
Example
- 123 -
04-Network Protocol Configuration Commands
Domain Description
Rcvd: Statistics data of the packets received by the
router
packets with data after window Number of received packets whose data
exceeds the received window of the router
ack packets with unsent data Number of packets which are received but not
sent
- 124 -
04-Network Protocol Configuration Commands
packets
Related Command
Parameter
Parameter Description
address Address of the transmission control block (TCB) for the to-be-displayed
TCP connection TCB is an internal identifier of the TCP connection, which
can be obtained through the show tcp brief command.
Command Mode
EXEC
Example
The following information is displayed after the show tcp command is run:
- 125 -
04-Network Protocol Configuration Commands
TCB 0xEA38C8
Connection state is ESTABLISHED, unread input bytes: 0
Local host: [Link], Local port: 23
Foreign host: [Link], Foreign port: 1583
Related Command
show tcp
- 126 -
04-Network Protocol Configuration Commands
6.2.1 deny
To configure the deny rules in IP ACL configuration mode, run deny source
[source-mask] [log]; to remote the deny rules from the IP access control list, run no
deny source [source-mask] [log].
- 127 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
protocol Protocol name or IP protocol number It can be icmp, igmp, igrp, ip, ospf,
tcp or udp, or it can be an integer from 0 to 255 which stands for the IP
protocol. To match up any Internet protocol, including ICMP, TCP and
UDP, you can use the ip keyword. Some protocol can be further limited,
which can be further described.
source-mask Mask of the source address The any keyword can be the abbreviation of
the source and the source's mask of host [Link].[Link].
destination Source network or host number, which can designated by the decimal
numbers or the binary numbers
The any keyword can be the abbreviation of the destination and the
destination's mask of host [Link].[Link].
destination-mask Mask of the destination network The any keyword can be the abbreviation
of the destination and the destination's mask of host [Link].[Link].
precedence Filters the packets based on the precedence. The precedence of the
precedence packet can be designated by an integer from 0 to 7. This parameter is
optional.
tos tos An optional parameter, meaning that the packets can be filtered at the
service layer It is designated by any number between 0 and 15.
icmp-type An optional parameter, which means that the ICMP packet can be filtered
based on the type of the ICMP packetThe type of the ICMP packet can be
designated by a number between 0 and 255.
igmp-type An optional parameter, which means that the IGMP packets can be filtered
based on the type and name of the IGMP packet The type of the IGMP
packet can be designated by a number between 0 and 15.
port Decimal number or name of the TCP/UDP port, which is optional The port
number ranges between 0 and 65535. The name of the TCP port is listed
in the Usage Explanation part. When the TCP is filtered, only the name
of the TCP port can be used. The names of the UDP ports are also listed
in the Usage Explanation part. When the TCP is filtered, only the name
- 128 -
04-Network Protocol Configuration Commands
of the TCP port can be used. When the UDP is filtered, only the name of
the UDP port can be used.
Command Mode
Instruction
You can control the packet transmission on an interface, virtual terminal line access and routing
choice update through the access control list. After the match-up is conducted, you shall stop
checking the expanded access control [Link] segmented IP packet, not the initial segment, will
be immediately accepted by any expanded IP access control list. The expanded ACL is used to
control the access of the virtual terminal line or limit the content of the routing choice update
without matching up the source TCP port, the type of the service value or the packet’s priority.
Note:
After an access control list is initially created, any content added later (or entered through the
terminal) will be placed at the end of the list.
The following are the names of the TCP port. For reference of these protocols, see RFC of
these protocols. You can search the corresponding port number of these protocols by entering
a question mark behind the relative command.
bgp
ftp
ftp-data
login
pop2
pop3
smtp
telnet
www
The following are the names of the UDP port. For reference of these protocols, see RFC of
these protocols. You can search the corresponding port number of these protocols by entering
a question mark behind the relative command.
domain
- 129 -
04-Network Protocol Configuration Commands
snmp
syslog
tftp
Example
The following example shows that network segment [Link] is being forbidden.
!
ip access-list standard filter
deny [Link] [Link]
!
Note:
Related Command
ip access-group
ip access-list
permit
show ip access-list
6.2.2 ip access-group
Parameter
Parameter Description
access-list-name Name of the access control list, which is a string with up to 20
characters
Command Mode
- 130 -
04-Network Protocol Configuration Commands
Instruction
The access control list can be used on the incoming or outgoing interface. For the
standard incoming access control list, the source address of the packet will be checked
according to the access control list after the packet is received. For the expanded
access control list, the router will check the destination address. If the access is the
address, the software continues to handle the packet. If the access control list forbids
the address, the software drops the packet and returns an ICMP unreachable packet.
For the standard access control list, after a packet is received and routed to a control
interface, the software checks the source address of the packet according to the
access control list. For the expanded access control list, the router will also check the
access control list at the receiver terminal. If the access control list at the receiver
terminal permits the packet, the software will then forward the packet. If the access
control list forbids the address, the software drops the packet and returns an ICMP
unreachable packet.
If the designated access control list does not exist, all packets will be allowed.
Example
The following example shows how to apply the filter application list on interface
Ethernet 0.
!
interface ethernet 0
ip access-group filter out
!
Related Command
ip access-list
show ip access-list
6.2.3 ip access-list
To add the IP access control list, run ip access-list {standard | extended} name.
Parameter
Parameter Description
standard Specifies the standard access control list.
- 131 -
04-Network Protocol Configuration Commands
name Name of the access control list, which is a string with up to 20 characters
Default
Command Mode
Instruction
After the command is run, the system enters the IP access control list mode. You
then can run permit or deny to configure the access rules.
Example
The following example shows that a standard access control list is configured.
!
ip access-list standard filter
deny [Link] [Link]
permit any
!
Related Command
deny
ip access-group
permit
show ip access-list
6.2.4 permit
To configure the permit rules in IP ACL configuration mode, run permit source [source-mask]
[log]; to remote the permit rules from the IP access control list, run no permit source
[source-mask] [log].
- 132 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
protocol Protocol name or IP protocol number It can be icmp, igmp, igrp, ip, ospf,
tcp or udp, or it can be an integer from 0 to 255 which stands for the IP
protocol. To match up any Internet protocol, including ICMP, TCP and
UDP, you can use the ip keyword. Some protocol can be further limited,
which can be further described.
- 133 -
04-Network Protocol Configuration Commands
source Source network or host number Two methods can be used to designate
the source: 32-byte binary-system numbers and decimal-system numbers
which are separated by four points. The any keyword can be the
abbreviation of the source and the source's mask of host [Link].[Link].
source-mask Mask of the source address The any keyword can be the abbreviation of
the source and the source's mask of host [Link].[Link].
destination Source network or host number, which can designated by the decimal
numbers or the binary numbers There are two methods to express the
destination network or the host’s number:
The any keyword can be the abbreviation of the destination and the
destination's mask of host [Link].[Link].
destination-mask Mask of the destination network The any keyword can be the abbreviation
of the destination and the destination's mask of host [Link].[Link].
precedence Filters the packets based on the precedence. The precedence of the
precedence packet can be designated by an integer from 0 to 7. This parameter is
optional.
tos tos An optional parameter, meaning that the packets can be filter at the
service layer It is designated by any number between 0 and 15.
icmp-type An optional packet, which means that the ICMP packet can be filtered
based on the type of the ICMP packetThe type of the ICMP packet can be
designated by a number between 0 and 255.
igmp-type An optional parameter, which means that the IGMP packets can be filtered
based on the type and name of the IGMP packet The type of the IGMP
packet can be designated by a number between 0 and 15.
port Decimal number or name of the TCP/UDP port, which is optional The port
number ranges between 0 and 65535. The name of the TCP port is listed
in the Usage Guide part. When the TCP is filtered, only the name of the
TCP port can be used. The names of the UDP ports are also listed in the
Usage Explanation part. When the TCP is filtered, only the name of the
TCP port can be used. When the UDP is filtered, only the name of the
UDP port can be used.
- 134 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
You can control the packet transmission on an interface, virtual terminal line
access and routing choice update through the access control list. After the match-
up is conducted, you shall stop checking the expanded access control list.
The segmented IP packet, not the initial segment, will be immediately accepted by any
expanded IP access control list. The expanded ACL is used to control the access of
the virtual terminal line or limit the content of the routing choice update without
matching up the source TCP port, the type of the service value or the packet’s priority.
Note:
After an access control list is initially created, any content added later (or
entered through the terminal) will be placed at the end of the list.
The following are the names of the TCP port. For reference of these protocols,
see RFC of these protocols. You can search the corresponding port number of
these protocols by entering a question mark behind the command.
bgp
ftp
ftp-data
login
pop2
pop3
smtp
telnet
www
The following are the names of the UDP port. For reference of these protocols,
see RFC of these protocols. You can search the corresponding port number of
these protocols by entering a question mark behind the command.
domain
snmp
syslog
tftp
- 135 -
04-Network Protocol Configuration Commands
Example
Note:
Related Command
deny
ip access-group ip
access-list show
ip access-list
Parameter
Default
Command Mode
Interface configuration
Instruction
- 136 -
04-Network Protocol Configuration Commands
To display the content of the current IP access control list, run the following command:
show ip access-list[access-list-name]
Parameter
Parameter Description
access-list-name Name of the access control list, which is a string with up to 20 characters
Default
Command Mode
EXEC
Instruction
The show ip access-list command enables you to specify an access control list.
Example
The following information is displayed after the show ip access-list command is run
while an access control list is not specified:
Router# show ip access-list
ip access-list standard aaa
permit [Link]
permit [Link] [Link]
ip access-list extended bbb
permit tcp any any eq
www permit ip any any
The following information is displayed after you run the show ip access-list command
with an access control specified:
ip access-list extended bbb
permit tcp any any eq www
To configure route IP&MAC ACL, run imp access-list <num>. To disable the function, run no imp
access-list <num>.
- 137 -
04-Network Protocol Configuration Commands
Parameter
<1-255>
Default
None
Command Mode
Global Configuration
Instruction
Configure IMP ACL used for matching IP&MAC, for instance, IP address binding and MAC
address binding.
Example
To configure permit item of route IP&MAC ACL, run permit <ip | any> <mac | any>. To
disable the function, run permit <ip | any> <mac | any>.
Parameter
Default
None
- 138 -
04-Network Protocol Configuration Commands
Command Mode
Instruction
Example
The following example shows how to configure permit item of IMP ACL.
To configure deny item of IP&MAC ACL, run deny <ip | any> <mac | any>no. To disable the
function, run deny <ip | any> <mac | any>no.
Parameter
Default
None
Command Mode
Instruction
Example
The following example shows how to configure permit item of IMP ACL:
- 139 -
04-Network Protocol Configuration Commands
To enable IMP ACL, run imp access-group <num>. To disable the function, run no imp
access-group <num>.
Parameter
<1-255>
Default
None
Command Mode
Interface configuration
Instruction
Apply IMP ACL to the authentic interface. Ethernet analyzes IP packet and filter by IMP ACL.
Example
Router_config_g0/0#imp access-group 1
Configure the route to adopt with special acl algorithm and accelerate the rate of
acl list check.
Parameter
None
Default
- 140 -
04-Network Protocol Configuration Commands
Command Mode
Global configuration
Instruction
Add keyword “massive” to the common extended access list, that is, deal with the access list with
special acl algorithm and accelerate the rate of acl list check.
The algorithm cannot take effect if ip address range and df item have been configured in the
access list.
Example
The following example shows how to enable the fast forwarding function:
Router_config#ip access-list extended test massive
[Link] Router_config_ext_nacl#exit
Router_config#
Enable algorithm in Test and localize each rule in Test with the algorithm.
Enable URPF function on the interface. URPF has loose URPF and tight URPF. Run the no
verify ipv4 unicast source reachable-via to disable the function.
Parameter
Default
- 141 -
04-Network Protocol Configuration Commands
Command Mode
Interface configuration
Instruction
Network administrators can use Unicast Reverse Path Forwarding (Unicast RPF)
to help limit the malicious traffic on an enterprise network. This security feature works
by enabling a router to verify the reachability of the source address in packets being
forwarded. This capability can limit the appearance of spoofed addresses on a network.
If the source IP address is not valid, the packet is discarded. Unicast RPF works in one
of three different modes: strict mode, loose mode, or VRF mode. Note that not all
network devices support all three modes of operation.
When administrators use Unicast RPF in strict mode, the packet must be received
on the interface that the router would use to forward the return packet. Unicast RPF
configured in strict mode may drop legitimate traffic that is received on an interface that
was not the router's choice for sending return traffic. Dropping this legitimate traffic
could occur when asymmetric routing paths are present in the network.
When administrators use Unicast RPF in loose mode, the source address must
appear in the routing table. Administrators can change this behavior using the allow-
default option, which allows the use of the default route in the source verification
process. Additionally, a packet that contains a source address for which the return
route points to the Null 0 interface will be dropped. An access list may also be specified
that permits or denies certain source addresses in Unicast RPF loose mode.
Note: URPF shall take effect when enabling verify ipv4 in global configuration mode.
Example
The following example shows how to configure loose URPF on the interface of G0/1
and allow the default route:
!
interface GigaEthernet0/1
Ip address [Link] [Link]
verify ipv4 unicast source reachable-via any allow-default
!
The following example shows how to configure strict URPF on the interface of G0/0:
!
interface GigaEthernet0/1
Ip address [Link] [Link]
verify ipv4 unicast source reachable-via rx
!
- 142 -
04-Network Protocol Configuration Commands
6.4 ip fastswitch
To deal with IPv4 forwarding packet in fast switch mode, run ip fastswitch [number]. To
disable the function, run no ip fastswitch.
ip fastswitch [number]
no ip fastswitch
Parameter
The length of number system receiving buffer queue: adjust the length to affect the forwarding
delay.
Default
Command Mode
Global configuration
Instruction
Enable fast switch mode. Some services will be enhanced, for instance: IPv4 forwarding,
IPACL and NAT and some services don't change, such as IPSec.
Example
The following example shows how to enable fast switch function and configure system
receiving buffer queue as 1024:
Router_config#ip fastswitch 1024
To enable ftp server, run ftp-server enable to enable ftp server. To disable the function, run no
ftp-server enable.
ftp-server enable
no ftp-server enable
- 143 -
04-Network Protocol Configuration Commands
Parameter
None
Default
Command Mode
Global configuration
Instruction
Enable ftp server, the router will monitor ftp client in port 21. The router will also
monitor ftp over SSL/TLS client in port 990, if ftp-server certificate is configured at the
same time.(Refer to 1.6 for more detail.)
Example
To configure the max number of login, run “ftp-server maxlogin maxlogin”. To disable
the function, run no ftp-server maxlogin.
no ftp-server maxlogin
Parameter
Default
Command Mode
Global configuration
- 144 -
04-Network Protocol Configuration Commands
Instruction
Enable ftp server and configure max number of simultaneous login users. When the the
connected ftp dialogues reach or exceed the number, system will not accept any other ftp
connection.
Example
The following example shows how to configure the max number of simultaneous login users
as 5:
Router_config#ftp-server maxlogin 5
To enable ftp server attack defense, run ftp-server attack-defense. To disable the function, run
“no ftp-server attack-defense”. ftp-
server attack-defense
no ftp-server attack-defense
Parameter
None
Default
Command Mode
Global configuration
Instruction
Enable ftp server and configure attack defense. If there appears username or password input
error for 5 times within 60 seconds, ftp server will enable the silent mode and no new connection
will be accepted in 60s.
- 145 -
04-Network Protocol Configuration Commands
Example
The following example shows how to enable ftp server attack defense:
Router_config#ftp-server attack-defense
To enable ftp server anonymous login, run ftp-server anonymous-permission. To resume the
default mode, run no ftp-server anonymous-permission.
ftp-server anonymous-permission
no ftp-server anonymous-permission
Parameter
None
Default
Command Mode
Global configuration
Instruction
Enable “ftp-server anonymous-permission” and any user can login the ftp server.
Example
The following example shows how to enable ftp server attack defense:
Router_config#ftp-server attack-defense
no ftp-server certificate
- 146 -
04-Network Protocol Configuration Commands
Parameter
Default
Command Mode
Global configuration
Instruction
Configure the authentication certificate of FTP over SSL/TLS. Enable ftp server command if
the document is justifiably authenticated. ftp client can login ftps server under port 990 in the mode
of FTP over SSL/TLS.
The command cannot verify validity of the document. Reconfigure if there is a prompt “FTP
over SSL/TLS socket listen failure”.
Example
The following example shows how to enable the authentication document of FTP
over SSL/TLS and ftps:
Router_config#ftp-server certificate [Link]
Router_config#ftp-server enable
Parameter
- 147 -
04-Network Protocol Configuration Commands
Default
Command Mode
Global configuration
Instruction
The command is to configure user group. It allows the user to add or delete
user name and password.
When the user group is deleted, all usernames and passwords will be deleted
simultaneously.
Example
Router_config_ftpd_usergroup#
6.5.7 ftp-user
no ftp-user username
Parameter
Default
Command Mode
- 148 -
04-Network Protocol Configuration Commands
Instruction
The command allows the user to add or delete FTP login user name
and password in the mode of ftp server user group configuration.
Example
6.5.8 privilege
To configure the authority of ftp server user group, run privilege [read | write | execute]. To
resume to the default mode, run privilege read.
Parameter
Default
Command Mode
Instruction
Modify the read access and the write access in ftp server user group configuration mode.
Write access: upload the file (There should be no file of the same name in the server. Otherwise,
the execute access is needed.)
Execute access: delete file/files; rename file (the files cannot be renamed); create/delete files
- 149 -
04-Network Protocol Configuration Commands
Example
The following example shows how to configure the accesses of ftp server group including
read, write and execute:
Router_config_ftpd_usergroup# privilege read write execute
Parameter
None
Default
Command Mode
Global configuration
Instruction
The command is to prevent the host from following attacks including ping flood attack,
ping scan attack,syn flood attack, syn port scan attack, fin port scan attack, rst flood
attack, udp flood attack, udp port scan attack,ping of death, teardrop attack.
Example
- 150 -
04-Network Protocol Configuration Commands
Parameter
None
Default
Command Mode
Global configuration
Instruction
The log alarm information will be showed when a host is under attack.
Example
The following example shows how to enable attack-proof log alarm function:
Parameter
None
Default
Command Mode
Global configuration
- 151 -
04-Network Protocol Configuration Commands
Instruction
Enable attack-proof filtration function and the corresponding packet will be deleted
when a host is detected to under attack. For instance, when a host is detected to under
the attack of syn flood, the packet over the threshold will be dropped; while when
enabling the packet filtration function, all corresponding packets will be dropped when
a host is detected to under the attack of syn flood.
Example
The following example shows how to enable attack-proof packet filtration function:
Parameter
None
Default
Command Mode
Global configuration
Instruction
Enable ping flood attack proof and ping scan attack proof.
- 152 -
04-Network Protocol Configuration Commands
Parameter
Default
Disable ping flood attack proof and pin scan attack proof.
Command Mode
Global configuration
Instruction
The command shows how to configure the threshold of ping flood attack-proof and limit
the number of ping packets a host received in one second. The default is 300. The
command also configures the time of ping scanning. The default time is 3 seconds. If
within 3 seconds ping scans up to 32 different addresses, it will be taken as a ping scan
attack.
Example
The following example shows how to enable ping flood attack proof and ping scan
attack proof:
!
verify ipv4 icmp ping-flood 300
verify ipv4 icmp ping-sweep 3
Enable following functions including syn flood, syn port scan, fin port scan and rst
flood attack.
- 153 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command Mode
Global configuration
Instruction
The command shows how to configure the threshold of syn flood attack-proof and limit
the number of syn packets a host received in one second. The default is 300. The
command also configures the time of syn scanning. The default time is 3 seconds. If
within 3 seconds syn scans up to 32 different addresses, it will be taken as a syn scan
attack. The case also applies to fin scan attack-proof and rst flood attack-proof.
Example
The following command shows how to enable syn flood attack-proof, syn port
scan attack-proof, fin port scan attack-proof and rst flood attack-proof.
!
verify ipv4 tcp syn-flood 300
verify ipv4 tcp syn-sweep 3
verify ipv4 tcp fin-scan 3
verify ipv4 tcp rst-flood 300
- 154 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command Mode
Global configuration
Instruction
The command shows how to configure the threshold of udp flood attack-proof and limit
the number of udp packets a host received in one second. The default is 300. The
command also configures the time of udp scanning. The default time is 3 seconds. If
within 3 seconds udp scans up to 32 different addresses, it will be taken as a udp scan
attack.
Example
The following example shows how to enable udp flood attack-proof function and udp
scan attack-proof function:
!
verify ipv4 udp udp-flood 300
verify ipv4 udp udp-sweep 3
Enable xmas-tree, null-scan, land, smurf, winnuke, ping of death, teardrop, fraggle attack-proof
functions:
- 155 -
04-Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command Mode
Global configuration
Instruction
The command shows how to configure the time of xmas-tree attack-proof. The default
is 3s. If within 3 seconds TCP scanned ports with FIN, PUSH and URG reach 32, it will
be taken as a xmas-tree attack.
The command also configures the time of null-scan. The default time is 3 seconds. If
within 3 seconds udp scans TCP scanned ports with 0 reach 32, it will be taken as a
null-scan attack.
Example
The following example shows how to enable xmas-tree, null-scan, land, smurf,
winnuke, ping of death, teardrop, fraggle attack-proof functions:
!
verify ipv4 attack Xmas-Tree
3 verify ipv4 attack Null-scan
3 verify ipv4 attack Land
verify ipv4 attack Smurf
verify ipv4 attack WinNuke
verify ipv4 attack Ping-of-Death
verify ipv4 attack TearDrop
verify ipv4 attack Fraggle
- 156 -
04-Network Protocol Configuration Commands
6.7.1 packet-handle-pause
The command shows how to configure the number of successive handling packets.
The handling process pauses per number.
no packet-handle-pause
Parameter
Default
Command Mode
Global configuration
Instruction
The command shows how to configure the number of successive handling packets.
Run “no packet-handle-pause” and the packets are in handling until the waiting
handling queue is empty.
Example
- 157 -
04-Network Protocol Configuration Commands
6.8.1 pip-watcher
Parameter
match-value match-value
Default
None
Command Mode
Global configuration
Instruction
Protocol packets for the route protocol, for instance, BGP, OSPF and ISIS.
Example
Related command
- 158 -