04-Network Protocol Command
04-Network Protocol Command
Content
Table of Content
Chapter 1 IP Address Command.......................................................................................................................................... 1
1.1 IP Address Command............................................................................................................................................ 1
1.1.1 arp ............................................................................................................................................................. 1
1.1.2 arp timeout ................................................................................................................................................ 2
1.1.3 clear arp-cache.......................................................................................................................................... 3
1.1.4 ip address.................................................................................................................................................. 3
1.1.5 ip host........................................................................................................................................................ 5
1.1.6 ip default-gateway ..................................................................................................................................... 6
1.1.7 show arp.................................................................................................................................................... 6
1.1.8 show hosts ................................................................................................................................................ 7
1.1.9 show ip interface ....................................................................................................................................... 8
Chapter 2 IP Service Command......................................................................................................................................... 10
2.1.1 clear tcp................................................................................................................................................... 10
2.1.2 clear tcp statistics.................................................................................................................................... 11
2.1.3 debug arp ................................................................................................................................................ 12
2.1.4 debug ip icmp.......................................................................................................................................... 13
2.1.5 debug ip packet....................................................................................................................................... 16
2.1.6 debug ip raw............................................................................................................................................ 20
2.1.7 debug ip tcp packet ................................................................................................................................. 22
2.1.8 debug ip tcp transactions ........................................................................................................................ 23
2.1.9 debug ip udp............................................................................................................................................ 25
2.1.10 ip mask-reply......................................................................................................................................... 26
2.1.11 ip mtu..................................................................................................................................................... 27
2.1.12 ip redirects............................................................................................................................................. 28
2.1.13 ip tcp synwait-time................................................................................................................................. 29
2.1.14 ip tcp window-size ................................................................................................................................. 30
2.1.15 ip unreachables..................................................................................................................................... 31
2.1.16 show ip irdp ........................................................................................................................................... 31
2.1.17 show ip sockets..................................................................................................................................... 32
2.1.18 show ip traffic ........................................................................................................................................ 33
2.1.19 show tcp ................................................................................................................................................ 34
2.1.20 show tcp brief ........................................................................................................................................ 38
2.1.21 show tcp statistics ................................................................................................................................. 39
2.1.22 show tcp tcb .......................................................................................................................................... 41
Chapter 3 Access-list Command ........................................................................................................................................ 43
3.1.1 deny......................................................................................................................................................... 43
3.1.2 ip access-group....................................................................................................................................... 46
3.1.3 ip access-list............................................................................................................................................ 47
3.1.4 permit ...................................................................................................................................................... 48
3.1.5 show ip access-list .................................................................................................................................. 51
-I-
04-Network Protocol command
You can use command in this chapter to configure and check the addressing of IP
network. If you want to know more information about the configuration of IP addressing,
please refer to chapter “the configuration of IP addressing”.
1.1.1 arp
When configuring static ARP map, the static ARP map will be permanently saved in
ARP cache. If you want to delete the configured static ARP map, use command “no
arp”.
Syntas
no arp ip-address
Parameter
Parameter Description
ip-address IP address of local data link interface.
alias (Optional) the router responds to the ARP request of this IP address, just
like it owns this IP address.
Default
Command mode
Explanation
All general hosts can support dynamic ARP analysis, so generally user does not need
to specifically configure static ARP map for the host.
-1-
04-Network Protocol command
Example
The following command configures the MAC address of host with IP address of 1.1.1.1
as 00:12:34:56:78:90.
arp 1.1.1.1 00:12:34:56:78:90
Ralated command
clear arp-cache
Configure the duration of dynamic ARP entry in ARP cache. If you want to reset it to
default value, use command no arp timeout or default arp timeout.
Syntas
no arp timeout
Parameter
Parameter Description
seconds Duration (second) of dynamic ARP entry in ARP cache. 0 means that ARP
cache dynamically resoluted from this interface will not be released
timeout.
Default
Command mode
Explanation
If you do not configure on interface without (with)ARP, then the configuration will not be
effective.
Command “show interface” will display the ARP entry timeout configured on this
interface, it is shown as follows:
-2-
04-Network Protocol command
Example
The following command configures the duration of dynamic ARP map as 900 seconds
on interface Ethernet 1/0, in order to more quickly refresh ARP cache.
interface ethernet 1/0
arp timeout 900
Ralated command
show interface
Syntas
clear arp-cache
Parameter
none
Command mode
Supervisor mode
Example
Ralated command
arp
1.1.4 ip address
-3-
04-Network Protocol command
address. IP address generated by the system itself, if the upper layer application does
not designate the source address, the router will use the IP address on the same
network as the gateway and configured on the outgoing interface, as the source
address, if you are not sure about this IP address (such as interface router), then you
can use the primary address of the outgoing interface. If one interface is not a
configured IP address, and is not unnumbered interface, then this interface does not
process IP packet.
Syntas
no ip address
Parameter
Parameter Description
ip-address IP address
Default
Command mode
Explanation
When using OSPFprotocol, you should guarantee that the secondary address and its
primary address are in the same OSPF area.
-4-
04-Network Protocol command
Example
The following command configures the primary address 202.0.0.1, network mask
255.255.255.0 on vlan 10 interface, in addition, configures two IP secondary address
203.0.0.1 and 204.0.0.1.
interface vlan 10
ip address 202.0.0.1 255.255.255.0
ip address 203.0.0.1 255.255.255.0 secondary
ip address 204.0.0.1 255.255.255.0 secondary
1.1.5 ip host
Define static host name-address map. If you want to delete host name-address map,
use command “no ip host”.
Syntas
no ip host name
Parameter
Parameter Description
name host name
address IP address.
Default
No maps configured
Command mode
Example
The following example configures the host name as dns-server with IP address
202.96.1.3.
ip host dns-server 202.96.1.3
-5-
04-Network Protocol command
1.1.6 ip default-gateway
Syntas
ip default-gateway address
no ip default-gateway
Parameter
Parameter Description
address IP address.
Default
Disable
Command mode
Explanation
Example
Show all ARP entrys entries , including ARP map of interface IP address, static ARP
map, dynamic ARP map configured by the user.
Syntas
show arp
Parameter
none
-6-
04-Network Protocol command
Command mode
Supervisor mode
Explanation
age Survival time, the time between the generation and current of ARP entry,
minute as the unit. The router use this ARP entry will not affect this value.
hardware Address Physical address, the physical address corresponds to the network
address, for irresoluted entry the value is empty.
type Type, means the packet encapsulation type used by the interface,
including ARPA, SNAP and etc…
Example
Syntas
show hosts
Parameter
Command mode
-7-
04-Network Protocol command
Example
Ralated command
clear host
Syntas
Parameter
Parameter Description
type (Optional) interface type
Command mode
Explanation
If the link layer of the interface can effectively send or receive data, it is a usable
interface and the mode is “protocol up”. If you configure IP address on this interface,
the router will add a directly connected route in the routing table. If the link layer
protocol disconnects, which is “protocol down”, this directly connected route will be
deleted. If you designate interface type and serial, it only displays interface information.
Or, it displays IP configuration information of all interfaces.
Example
-8-
04-Network Protocol command
Show description:
Domain Description
vlan10 is up If the interface hardware is usable, the interface is tagged “up”. If the
interface is usable, its hardware and line protocol must all be “up”.
line protocol is up If the interface can provide intercommunication, its line protocol would
be tagged “up”. If the interface is usable, both the interface hardware
and line protocol must be “up”.
Outgoing access list Outgoing access control list used by the interface.
Inbound access list Inbound access control list used by the interface.
ICMP mask replies Whether to send ICMP mask reply packets on the interface.
-9-
04-Network Protocol command
Use the following commands to configure various IP services. For more configuration
information about IP services, please refer to the chapter “configure IP services”.
Syntas
clear tcp {local host-name port remote host-name port | tcb address}
Parameter
Parameter Description
local host-name IP address of the local host and TCP port.
port
tcb address The convert control block(TCB) of TCP connection to be deleted. TCB is
the identifier of TCP connection which can be obtained by command
“show tcp brief”.
Command mode
Supervisor mode
Explanation
Command “clear tcp” is mainly used to clear the closed TCP connection. In some
cases, such as communication line problem, TCP connection or restart of the dealing
host, TCP connection is actually stopped, but as there is no communication on TCP
connection, the system cannot timely discover this situation, here you can use
command “clear TCP” to close the invalid TCP connection. Among them, command
clear tcp local host-name port remote host-name port is used to stop the TCP
connection between designated IP address/port of local host and remote host.
Command clear tcp tcb address is used to stop the TCP connection tagged by the
designated TCB address.
Example
The following example clears the TCP connection between 192.168.20.22:23 local
&192.168.20.120:4420 remote . Command “show tcp brief” shows the local and
remote host information of current TCP connection.
- 10 -
04-Network Protocol command
The following example clears the TCP connection with TCB address 0xea38c8.
Command “show tcp brief” shows the TCB address of TCP connection.
switch#show tcp brief
TCB Local Address Foreign Address State
0xEA38C8 192.168.20.22:23 192.168.20.125:1583 ESTABLISHED
switch#clear tcp tcb 0xea38c8
switch#show tcp brief
TCB Local Address Foreign Address State
Relevant command
show tcp
Syntas
Parameter
none
Command mode
Supervisor mode
Example
- 11 -
04-Network Protocol command
Relevant command
Show ARP interactive information, such as sending ARP request, receiving ARP
response, receiving ARP request, sending ARP response and etc… When the switch
cannot communicate with the host, the command can be used to analyse the ARP
interactive information. Use “no debug arp” to stop showing the information.
Syntas
debug arp
no debug arp
Parameter
none
Command mode
Supervisor mode
Example
switch#debug arp
switch#IP ARP: rcvd req src 192.168.20.116 00:90:27:a7:a9:c2, dst 192.168.20.111, vlan 10
IP ARP: req filtered src 192.168.20.139 00:90:27:d5:a9:1f, dst 192.168.20.82 00:
00:00:00:00:00, wrong cable, vlan 11
IP ARP: created an incomplete entry for IP address 192.168.20.77, vlan 10
IP ARP: sent req src 192.168.20.22 08:00:3e:33:33:8a, dst 192.168.20.77, vlan 10
IP ARP: rcvd reply src 192.168.20.77 00:30:80:d5:37:e0, dst 192.168.20.22, vlan 10
The first information indicates: the switch receives an ARP request on interface
Ethernet1/0, IP address of the host sending the request is 192.168.20.116, the MAC
address is 00:90:27:a7:a9:c2, it requests the MAC address of host with IP address
192.168.20.111:
IP ARP: rcvd req src 192.168.20.116 00:90:27:a7:a9:c2, dst 192.168.20.111, vlan 10
The second information means: the switch receives an ARP address request from
192.168.20.139 on interface VLAN11. But, according to the interface configuration of
the switch, this interface is not on the network on which the host claims to be. So,
there might be an error in configuration of the host. If the switch sets up ARP cache
according to this information, it may be unable to communication with certain host
configured at the same address on the normal interface.
IP ARP: req filtered src 192.168.20.139 00:90:27:d5:a9:1f, dst 192.168.20.82 00:
00:00:00:00:00, wrong cable, vlan 11
- 12 -
04-Network Protocol command
The third information means, the switch wants to resolute the MAC address of host
192.168.20.77, so it creates an incomplete ARP entry for the host, and then fills in
MAC address while receiving ARP response. According to the configuration of the
switch, this host connects on the interface VLAN10.
IP ARP: created an incomplete entry for IP address 192.168.20.77, vlan 10
The fourth information means: the switch sends ARP request on interface VLAN10, IP
address of the switch is 192.168.20.22, MAC address of the interface is
08:00:3e:33:33:8a, the IP address of the requested host is 192.168.20.77. This
information is related to the third information.
IP ARP: sent req src 192.168.20.22 08:00:3e:33:33:8a, dst 192.168.20.77, vlan10
The fifth information means, the switch receives ARP response from 192.168.20.77 to
switch interface 192.168.20.22 on interface VLAN10, which tells that its MAC address
is 00:30:80:d5:37:e0. This information is related to the third and fourth information.
IP ARP: rcvd reply src 192.168.20.77 00:30:80:d5:37:e0, dst 192.168.20.22, vlan10.
Show the interactive information of Internet Control Message Protocol (ICMP). Use
command “no debug ip icmp” to disable debug output.
Syntas
debug ip icmp
no debug ip icmp
Parameter
none
Command mode
Supervisor mode
Explanation
This command can show the ICMP packet the system received and sent, in order to
solve the connection problem between port to port of the network. If you want to know
the detailed information about command output “debug ip icmp”, please refer to RFC
792, “Internet Control Message Protocol ”.
Example
switch#debug ip icmp
switch#ICMP: sent pointer indicating to 192.168.20.124 (dst was 192.168.20.22), len 48
ICMP: rcvd echo from 192.168.20.125, len 40
ICMP: sent echo reply, src 192.168.20.22, dst 192.168.20.125, len 40
- 13 -
04-Network Protocol command
pointer indicating ICMP packet type, this ICMP packet means that original IP packet
parameter error, and also indicates the error domain. Other types of ICMP
packets include:
echo reply
---net unreachable
---host unreachable
---protocol unreachable
---port unreachable
---net unacknowledged
---net prohibited
---host prohibited
source quench
redirect,includes
---net redirect
---host redirect
echo
switch advertisement
switch solicitation
- 14 -
04-Network Protocol command
---ttl exceeded
---reassembly timeout
---pointer indicating
---option missed
---bad length
timestamp
timestamp reply
information request
information reply
mask request
mask reply
to 192.168.20.124 The destination address of ICMP packet is 192.168.20.124, and also the
source address of the original packet which initiates ICMP packet.
(dst was The destination address of the original packet initiates ICMP packet is
192.168.20.22) 192.168.20.22.
len 48 The length of ICMP packet is 48 bytes, not including the length of IP
header.
Parameter Description
rcvd Received ICMP packet.
Domain Command
src 192.168.20.22 Source address of ICMP packet is 192.168.20.22.
According to the different types of ICMP packets, the generated ICMP packet
information use different formats in the convenience of showing the packet content.
For example, for ICMP redirect packet, you can use the following format to print:
ICMP: rcvd host redirect from 192.168.20.77, for dst 22.0.0.3 use gw 192.168.20.26,
len 36
- 15 -
04-Network Protocol command
ICMP: sent host redirect to 192.168.20.124, for dst 22.0.0.5 use gw 192.168.20.77, len
36
The first information means, it receives the redirect packet of ICMP host from host
192.168.20.77, suggests that you can use gateway 192.168.20.26 to reach the
destination host 22.0.0.3, the length of ICMP packet is 36 bytes.
The second information means, it sends the redirect packet of ICMP host to
192.168.20.124, informs it to use 192.168.20.77 to reach host 22.0.0.5, the length of
ICMP packet is 36 bytes.
For destination unreachable packet of ICMP, use the following formats to print:
The first information means, the switch can not route a certain IP packet, so it sends
destination host 202.96.209.133 unreachable packet of ICMP to the source host
192.168.20.124 of the packet, the length of ICMP packet is 36 bytes.
The second information means, the switch receives an ICMP packet from host
192.168.20.26, informs that the destination host (2.2.2.2) is unreachable, and the
length of ICMP packet is 36 bytes.
Show the interactive information of internet protocol (IP). Use “no debug ip packet” to
stop showing the information.
Syntas
no debug ip packet
Command mode
Supervisor mode
Explanation
This command can help to realize the final destination of every IP packets received or
produced local and realize the reason of communication trouble.
Forwarded
- 16 -
04-Network Protocol command
Source route
Receive packet
Receive IP fragment
Send packet
Send broadcast/multicast
Unknown protocol
Using this command may result in great traffic of output information. So you’d better
use it in the relatively leisure time of the switch, or it will seriously affect the system
performance. What is more, you’d better use access list to filter the output, so that the
system shows only the packet information that interest the user.
Example
switch#debug ip packet
switch#IP: s=192.168.20.120 (vlan 10), d=19.0.0.9 (vlan 10), g=192.168.20.1, len=60, redirected
IP: s=192.168.20.22 (local), d=192.168.20.120 (vlan 10), g=192.168.20.120, len=56, sending
IP: s=192.168.20.120 (vlan 10), d=19.0.0.9 (vlan 10), g=192.168.20.1, len=60, forward
IP: s=192.168.20.81 (vlan 10), d=192.168.20.22 (vlan 10), len=56, rcvd
Parameter Description
IP Means that this information is about IP packet.
s=192.168.20.120 The source address of IP packet and the vlan interface name to receive
(vlan 10) the packet (if it is not the packet generated local)
d=19.0.0.9 (vlan Destination address of IP packet and vlan interface name of sent packet (if
10) the routing is successful)
g=192.168.20.1 Net hop destination address of IP packet, may be gateway address, may
be destination address.
- 17 -
04-Network Protocol command
redirected Means that the switch will send ICMP redirect packet to the source host of
this packet. Other situations include:
The first information means, the switch receives an IP packet, its source address is
192.168.20.120, and is from the session connected to interface vlan10, the destination
address is 19.0.0.9, the sending interface defined by the routing table is vlan10,
gateway address is 192.168.20.1 and the length of the packet is 60 bytes. The source
hosts to discover gateway and to send IP packets are connected on the same network,
which is the network connected with interface Ethernet1/0 of the switch, so the switch
sends out ICMP redirect packet.
The second information, describes the sending of ICMP redirect packet, the source
address is local address 192. 168. 20.22, the destination address is the above packets’
source address 192.168.20.120, sent from interface vlan10, as it is directly arriving at
the destination, the gateway address is the destination address 192.168.20.120 and
the length of ICMP redirect packet is 56 bytes.
The third information means, the IP layer receives an IP packet and the source
address of it is 192.168.20.120, the receiving interface is VLAN10, the destination
address of the packet is 19.0.0.9, by searching the routing table, you find out that you
- 18 -
04-Network Protocol command
should forward this packet to interface VLAN10, gateway is 192.168.20.77, the length
packet is 60 bytes. This information shows that after the system sends ICMP redirect
packet, it forwards the packet shown by the first information.
The fourth packet means, the IP layer receives an IP packet, whose source address is
192.168.20.81, receiving interface is VLAN10, destination address is 192.168.20.22, it
is an IP address configured on interface VLAN10 of the switch and the length of the
packet is 56 bytes, received local.
We are going to introduce the output of command “debug ip packet detail” in the
following,
switch#debug ip packet detail
switch#IP: s=192.168.12.8 (vlan 10), d=255.255.255.255 (vlan 10), len=328, rcvd, UDP: src=68,
dst=67
IP: s=192.168.20.26 (vlan 10), d=224.0.0.5 (vlan 10), len=68, rcvd, proto=89
IP: s=192.168.20.125 (vlan 10), d=192.168.20.22 (vlan 10), len=84, rcvd, ICMP: type=0, code =
0
IP: s=192.168.20.22 (local), d=192.168.20.124 (vlan 10), g=192.168.20.124, len=40, sending,
TCP: src=1024, dst=23, seq=75098622, ack=161000466, win=17520, ACK
Domain Description
UDP Protocol name, such as UDP, ICMP, TCP and etc… Other protocols are
described in protocol number.
src, dst Source interface and destination interface of UDP and TCP packet.
ACK ACK of control bit of TCP packet is reset, means that the confirmation
serial is valid. Other control bits including SYN, URG, FIN, PSH, RST.
The first information means, received UDP packet, the source port is 68, the
destination port is 67.
IP: s=192.168.12.8 (vlan 10), d=255.255.255.255 (vlan 10), len=328, rcvd, UDP: src=68, dst=67
The second information means, protocol number received the packets is 89.
IP: s=192.168.20.26 (vlan 10), d=224.0.0.5 (vlan 10), len=68, rcvd, proto=89
The third information means, received ICMP packet, the packet type is 0, code is 0.
IP: s=192.168.20.125 (vlan 10), d=192.168.20.22 (vlan 10), len=84, rcvd, ICMP: type=0, code =
0
The fourth information means, send TCP packet, the source port is 1024, destination
port is 23, serial number is 75098622, confirmation number is 161000466, size of the
receiving window is 17520, the ACK tag position is reset. For information about the
meaning of these domains, please refer to RFC 793— TRANSMISSION CONTROL
PROTOCOL.
- 19 -
04-Network Protocol command
Now we are going to introduce the usage of access control list. For example, if you
want to display the packet information with source address of 192.168.20.125, first you
should define standard access control list abc to only accept IP packet with source
address of 192.168.20.125. Then, use this access control list in command “debug ip
packet”.
switch#config
switch_config#ip access-list standard abc
switch_config_std_nacl#permit 192.168.20.125
switch_config_std_nacl#exit
switch_config#exit
switch#debug ip packet abc
switch#IP: s=192.168.20.125 (vlan 101), d=192.168.20.22 (vlan 101), len=48, rcvd
The above command uses the standard control access list, and it can also use
extended access control list.
Relevant command
Show the interactive information of internet protocol (IP). Use “no debug ip raw” to
stop showing the information.
Syntas
no debug ip raw
Parameter
Parameter Description
detail (Optional) output the protocol information encapsulated by IP packet,
such as protocol number, UDP, TCP port number, ICMP packet type and
etc…
access-list-group (Optional) the IP access list name used to filter output information. Only IP
packet information meets designated IP access list will be output.
interface (Optional) the port number used to filter output information. Only the
information meets IP packet of the designated port will be output.
Command mode
Supervisor mode
- 20 -
04-Network Protocol command
Explanation
This command can help to realize the final destination of every received or local
generated IP packet, and to realize the reas
Forwarded
Source switch
Receive packet
Receive IP fragment
Send packet
Send broadcast/multicast
Unknown protocol
Use this command may produce great number of output information, so you’d better
use it during the leisure time of the switch, or it will seriously affect the system function.
In addition, you should use access list to filter output if possible, and enable the
system to display only the packet information that interest the user.
Example
- 21 -
04-Network Protocol command
Relevant command
Displays the received and sent information of transmit control protocol (TCP). Use “no
debug ip tcp packet” to stop the display.
Syntas
Parameter
none
Command mode
Supervisor mode
Example
- 22 -
04-Network Protocol command
Domain Description
tcp: Show the information about TCP packet.
ESTABLISHED Current mode of TCP connection. For the description of TCP connection
mode, please refer to the explanation of command “debug ip tcp
transactions”.
192.168.20.22:23 The source address of the packet is 192.168.20.22 and the source port is
23.
Other control bit including ACK, FIN, SYN, URG, and RST.
WIN 4380 The window domain of the packet is functioned to inform the size of the
receiving cache of recipient’s receiving port. Currently it is 4380 bytes.
If some of above domains are not displayed, it means that this domain has no valid
value in this TCP packet.
Relevant command
Display the important interactive information of convert control protocol (TCP), such as
the change of TCP connection mode. Use “no debug ip tcp transactions” to stop the
display.
Syntas
Parameter
none
Command mode
Supervisor mode
- 23 -
04-Network Protocol command
Example
rcvd connection Receive the connection attempt to port 23. (telnet port)
attempt to port 23
state was LISTEN Means that the state of TCP state machine is changed from listen to
-> SYN_RCVD LISTEN to SYN_RCVD.
LISTEN---Wait for the TCP connection attempt from any remote host.
FIN_WAIT_1---It has already sent the request to finish the connection, and
is waiting for the acknowledgement from the recipients and the recipient’s
request to finish the connection.
FIN_WAIT_2--- It has already sent the request to finish the connection and
received the acknowledgement from the recipients and is waiting for the
recipient’s request to finish the connection.
- 24 -
04-Network Protocol command
the connection, once the user wants to close the connection, the system
will send request to finish the connection.
LAST_ACK---It has received the request from the recipient to finish the
connection and acknowledged, sent the request to finish the connection is
waiting for the acknowledgement.
sending SYN Send a connection attempt packet (SYN reset in TCP header control bit).
Other TCP control bits include SYN, ACK, FIN, PSH, RST and URG.
rcvd FIN Receive the request to finish the connection (FIN reset in TCP header
control bit).
connection closed TCP connection closed per the request of upstream application
by user
Relevant command
Show the interactive information of user data protocol (UDP). Use command “no debug
ip udp” to stop.
Syntas
debug ip udp
no debug ip udp
- 25 -
04-Network Protocol command
Parameter
none
Command mode
Supervisor mode
Example
switch#debug ip udp
switch#UDP: rcvd src 192.168.20.99(520), dst 192.168.20.255(520), len = 32
UDP: sent src 192.168.20.22(20001), dst 192.168.20.43(1001), len = 1008
Domain Description
UDP: It shows that this packet is related to UDP packet.
So, the first packet means it receives a UDP packet from host 192.168.20.99, on
interface 520, the target address is 192.168.20.255, on target interface 520, and the
packet length is 32 bytes.
The second packet means it sends a UDP packet, the host address is 192.168.20.22,
on interface 20001, the target address is 192.168.20.43, on target interface 1001, and
the packet length is 1008 bytes.
2.1.10 ip mask-reply
Demand the switch to respond to IP address mask request on the designated interface.
If you want to turn this function off, use command “no ip mask-reply”.
Syntas
ip mask-reply
no ip mask-reply
default ip mask-reply
Parameter
none
- 26 -
04-Network Protocol command
Default
Command mode
Example
interface vlan 11
ip mask-reply
2.1.11 ip mtu
Configure the length of Maximum convert Unit of IP packets sent from the interface via
command “ip mtu”. If you want to use the default value of MTU again, use command
“no ip mtu”.
Syntas
ip mtu bytes
no ip mtu
Parameter
Parameter Description
bytes The maximum convert length of IP calculated by unit of byte.
Default
It is variable according to the different physical media of the interface, and is the same
as the maximum transfer unit on the interface. The minimum is 68 bytes.
Command mode
Explanation
If the IP packet length exceeds the IP MTU set on the interface, the switch would
fragment the packets. For all the devices connected on the same physical media, you
should configure the same protocolMTU before they can communicate. The MTU
(configure by interface configuration command “mtu”) value will affect the IP MTU
value. If the IP MTU value is the same as MTU value, when you change the MTU
value, the IP MTU value will be automatically changed into a new MTU value. But, the
change of IP MTU value will not affect the MTU value.
- 27 -
04-Network Protocol command
The minimum value of IP MTU is 68 bytes, the maximum value will not exceed the
MTU configured on the interface.
Example
Relevant command
mtu
2.1.12 ip redirects
Send IP ICMP redirect packet. Use command “no ip redirects” to stop sending ICMP
redirect packet.
Syntas
ip redirects
no ip redirects
Parameter
none
Default
Normally, IP redirect packet is sent by default. But, if the user configures hot backup
routingprotocol, this function will be automatically closed. And, if the configuration of
hot backup routingprotocol is canceled then, this function will not be automatically
opened.
Command mode
Explanation
When the switch finds out that the forwarding interface where gateway is located is the
same as the receiving interface while forwarding packets, and the host sending
packets is connected to the logical network of this interface, according to the protocol,
it can send a ICMP redirect packet to inform the host to directly set the switch as the
gateway to the destination address of the packet without being forwarded by this
switch.
- 28 -
04-Network Protocol command
Example
The following command opens the function of sending ICMP redirect packet on
interface VLAN10:
interface vlan10
ip redirects
Configure the timeout the switch waits for the successful TCP connection. If you want
to reset it to default time, use command “no ip tcp synlatency time”.
Syntas
no ip tcp synwait-time
Parameter
Parameter Description
seconds The TCP connection waiting time counted in the unit of second. The
effective value ranges from 5 to 300 seconds. 75 seconds by default.
Default
75 seconds
Command mode
Explanation
When the switch initiates TCP connection, if the connection is still not established
successfully after latency time of TCP connection, the switch considers connection
failure and returns this result to the upstream application program. The user can
configure the latency time for successful TCP connection, 75 seconds by default. This
option has no relation with TCP connection packet forwarded by the switch, but only
relates to the TCP connection of the switch itself.
If you want to know the current value of it, use command ip tcp synwait-time the
value in [ ] is the current value.
- 29 -
04-Network Protocol command
Example
The following example sets the latency time for TCP connection as 30 seconds:
switch_config#ip tcp synwait-time 30
switch_config#ip tcp synwait-time ?
<5-300>[30] seconds -- wait time
Configure the window size of TCP. If you want it to return to the default value, use
command “no ip tcp window-size”.
Syntas
no ip tcp window-size
Parameter
Parameter Description
bytes Window size illustrated in the unit of bit. 65535 bytes at most. 2000 bytes
by default.
Default
2000 bytes
Command mode
Explanation
Only if you clearly know your reason to change the default value, you’d better not
change it hotheaded. If you want to know the current value, use command ip tcp
window-size , the value in [] is the current value.
Example
The following example configures the TCP window size as 6000 bytes:
Switch_config#ip tcp window-size 6000
Switch_config#ip tcp window-size ?
<1-65535>[6000] bytes -- Window size
- 30 -
04-Network Protocol command
2.1.15 ip unreachables
Configure the switch to send ICMP unreachable packet. If you want the switch to stop
sending, use command “no ip unreachables”.
Syntas
ip unreachable
no ip unreachable
Parameter
none
Default
Command mode
Explanation
When the switch is forwarding IP packet, it may discover that there is no related routes
in routing table, which results in the discard of the packet. Meanwhile, the switch can
send ICMP unreachable packet to the source host, inform the source host about this
situation, in order to let the source host timely discover the errors and make
corrections.
Example
Syntas
show ip irdp
- 31 -
04-Network Protocol command
Parameter
none
Command mode
Supervisor mode
Example
Syntas
show ip sockets
Parameter
none
Command mode
Supervisor mode
Example
Router#show ip sockets
Proto Local Port Remote Port In Out
17 0.0.0.0 0 0.0.0.0 0 161 0
- 32 -
04-Network Protocol command
17 0.0.0.0 0 0.0.0.0 0 69 0
6 0.0.0.0 0 0.0.0.0 0 23 0
Syntas
show ip traffic
Parameter
none
Command mode
Supervisor mode
Example
switch#show ip traffic
IP statistics:
Rcvd: 0 total, 0 local destination, 0 delivered
0 format errors, 0 checksum errors, 0 bad ttl count
0 bad destination address, 0 unknown protocol, 0 discarded
0 filtered , 0 bad options, 0 with options
Opts: 0 loose source route, 0 record route, 0 strict source route
0 timestamp, 0 router alert, 0 others
Frags: 0 fragments, 0 reassembled, 0 dropped
0 fragmented, 0 fragments, 0 couldn't fragment
Bcast: 0 received, 0 sent
Mcast: 0 received, 0 sent
Sent: 230 generated, 0 forwarded
0 filtered, 0 no route, 0 discarded
ICMP statistics:
Rcvd: 0 total, 0 format errors, 0 checksum errors
0 redirect, 0 unreachable, 0 source quench
0 echos, 0 echo replies, 0 mask requests, 0 mask replies
0 parameter problem, 0 timestamps, 0 timestamp replies
0 time exceeded, 0 router solicitations, 0 router advertisements
Sent: 0 total, 0 errors
- 33 -
04-Network Protocol command
UDP statistics:
Rcvd: 28 total, 0 checksum errors, 22 no port, 0 full sock
Sent: 0 total
TCP statistics:
Rcvd: 0 total, 0 checksum errors, 0 no port
Sent: 3 total
IGMP statistics:
Rcvd: 0 total, 0 format errors, 0 checksum errors
0 host queries, 0 host reports
Sent: 0 host reports
ARP statistics:
Rcvd: 8 total, 7 requests, 1 replies, 0 reverse, 0 other
Sent: 5 total, 5 requests, 0 replies (0 proxy), 0 reverse
Parameter Description
format errors Packet format error, such as IP header length error.
bad hop count When the router is forwarding packets, if it finds that the TTL value is
reduced to 0, the packets will be discarded.
Syntas
show tcp
Parameter
none
Command mode
Supervisor mode
- 34 -
04-Network Protocol command
Example
switch#show tcp
TCB 0xE9ADC8
Connection state is ESTABLISHED, unread input bytes: 934
Local host: 192.168.20.22, Local port: 1023
Foreign host: 192.168.20.124, Foreign port: 513
Connection state is Current connection state. TCP connection may be in any states of the
ESTABLISHED following:
LISTEN---wait for the TCP connection attempt from any remote hosts.
FIN_WAIT_1---It has already sent the request to finish the connection, and
is waiting for the acknowledgement from the recipients and the recipient’s
request to finish the connection.
FIN_WAIT_2--- It has already sent the request to finish the connection and
received the acknowledgement from the recipients and is waiting for the
recipient’s request to finish the connection.
- 35 -
04-Network Protocol command
LAST_ACK---It has received the request from the recipient to finish the
connection and acknowledged, sent the request to finish the connection is
waiting for the acknowledgement.
TIME_WAIT---It waits enough time for the confirmation that the recipient
has received the acknowledgement of local request to finish connection
with it.
unread input bytes: The data can be submitted for upstream application after the TCP
procession yet has not been received by upstream application.
Enqueued bytes for Enqueued bytes for transmission include the data sent yet not
transmit: acknowledged and unsent data.
input: Enqueued bytes for receiving: these data are waiting to be accepted for
upstream application after sorting.
mis-ordered: The bytes and packets in the mis-ordered queue, these data can only be
accepted by upstream application in the receiving queue in order after
other data are received. For example, if it receives packet 1,2,4,5,6,
packet 1 and 2 can enter the receiving queue, but 4,5 and 6 can only enter
mis-ordered queue to wait for the arrival of packet 3.
Then it shows the situation of currently connected timer, includes the start times of the
timer, timeouts of the timer and the interval from the next timeout of the timer (0 means
the timer is not running currently). Each connection uses independent timer. The
number of timeouts of timer is normally less than the starts of the timer, because the
timer may be reset during the process of running. For example, if the system receives
the acknowledgement of all sent data from the recipient while the retransmit timer is
running, the retransmit 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.
Next(ms) Interval from the next timeout of the timer (ms as the unit), o means the
ti i t i
- 36 -
04-Network Protocol command
Retrans Retransmit timer, used to initiate data retransmission. The timer is started
after sending the data, if the data is not acknowledged within the timeout,
the timer will retransmit the data.
SendWnd Send window timer, used to guarantee that the send window is reset to
the normal size in the situation when TCP acknowledges loss.
Then shows the serial used by TCP connection. TCP uses serial to guarantee the
reliable and ordered data convert. Local and remote hosts also perform traffic control
and sending acknowledgement according to serial number.
iss: 29139463 snduna: 29139525 sndnxt: 29139525 sndwnd: 17520
irs: 709124039 rcvnxt: 709205436 rcvwnd: 4380
Domain Description
iss: Initial sending serial
snduna: Sending serial of the first bit of the data sent yet have not received the
acknowledgement from the recipient.
sndnxt: The send serial of the first bit of the data sent thereafter.
irs: Initial receiving serial, which is also the initial sending serial of the remote
host
The it shows the sending time recorded by local host, the system can adjust the
system to adapt to various network according to these data.
SRTT: 15 ms, RXT: 2500 ms, RTV: 687 ms
minRXT: 1000 ms, maxRXT: 64000 ms, ACK hold: 200 ms
Domain Description
SRTT: Trip time after smooth treatment
- 37 -
04-Network Protocol command
Domain Description
max data segment Maximum data segment permitted for this connection.
Rcvd Packets received in this connection process by local host, and packets
dis-ordered among them.
Sent: Total packets sent during the connection process of local host, and the
packets resent.
Relevant command
Syntas
Parameter
Parameter Description
all (optional) show all ports. If you do not input this key word, the system will
not show the port in the state of “LISTEN”.
Command mode
Supervisor mode
Example
- 38 -
04-Network Protocol command
Relevant command
show tcp
Syntas
Parameter
none
Command mode
Supervisor mode
Example
- 39 -
04-Network Protocol command
checksum error The number of the checked and wrong packets received.
bad offset The number of the received packets with bad offset traffic.
too short The number of the received packets with less than the minimum effective
length.
packets with data after The number of packets received with data out of the receiving window of
window the router.
packets after close The number of packets received after the connection closes.
ack packets with unsent The number of acknowledged packets received with unsent data.
data
control packets The number of control SYN FIN or RST packets sent.
- 40 -
04-Network Protocol command
Connections dropped in Total number of connections dropped resulted from resent time-outs
rxmit timeout
Relevant command
Syntas
Parameter
Parameter Description
address The convert control block (TCB) address connected with TCP to be
shown. TCB is the inside TCP connection tag of the system, which can be
obtained via command “show tcp brief”.
Command mode
Supervisor mode
Example
For detailed explanation of the following displayed, please refer to command “show
tcp”
switch_config#show tcp tcb 0xea38c8
TCB 0xEA38C8
Connection state is ESTABLISHED, unread input bytes: 0
Local host: 192.168.20.22, Local port: 23
Foreign host: 192.168.20.125, Foreign port: 1583
- 41 -
04-Network Protocol command
TimeWait 0 0 0
SendWnd 0 0 0
KeepAlive +5 0 6633000
Relevant command
show tcp
- 42 -
04-Network Protocol command
3.1.1 deny
This command can be used in IP access list configuration mode to configure prohibit
regulations. Add a prefix “no” in front of the command to delete “deny” regulation from
the ip access-list.
Syntas
The following syntax can also be used for internet control massage protocol(ICMP):
The following syntax can be used for internet group management protocol (ICMP):
Parameter
Parameter Description
protocol Protocol name or protocol number. It can be a key word like icmp, igmp,
igrp, ip, ospf, tcp or udp. It can also be a whole number among 0-255 that
refers to the IP protocol number. Use key word “ip” to match any Internet
protocol (including ICMP, TCP and UDP). Some protocols are allowed to
be restricted further as the following.
source Source network or host number. There are 2 ways to designate the
32 di it bi b d i l b t d ith 4 d t
- 43 -
04-Network Protocol command
source-mask Source address network mask. Use key word “any” to be the abbreviation
of source and source Mask of 0.0.0.0 0.0.0.0 .
destination-mask Destination address network mask. Use key word “any” to be the
abbreviation of destination address and destination address Mask of
0.0.0.0 0.0.0.0 .
tos tos (Optional) Data package can use service level filter. Use a number among
0-15 to designate.
icmp-type (Optional) ICMP package can be filtered by ICMP packet type. The type
is a number among 0-255.
igmp-type (Optional) ICMP package can be filtered by ICMP packet type or name.
The type is a number among 0-15.
Command mode
Explanation
Access-list can be used to control the transmission of data package on the interface,
control line access to virtual terminals. Stop checking extended access-list after the
matching occurs. It is IP packages divided by sections but not initial sections that will
be received by any extended IP access-list at once. Extended access-list is used to
control accessing virtual terminal line or restricting routes from choosing update
content. It is not necessary to match TCP source interface, type of service value and
priority of package.
- 44 -
04-Network Protocol command
Notes:
After the initial establishment of an access-list, any follow-up addition (can be keyed in at a terminal)
should be placed at the end of the list.
TCP interface name used to replace interface number is shown as below. Find out
reference related to these protocols regarding current allocation number RFC.
Interface number relevant to these protocols can also be found out by keying in a “?” to
replace interface number.
bgp
ftp
ftp-data
login
pop2
pop3
smtp
telnet
www
UDP interface name used to replace interface number is shown as below. Find out
reference related to these protocols regarding current allocation number RFC.
Interface number relevant to these protocols can also be found out by keying in a “?” to
replace interface number.
domain
snmp
syslog
tftp
Example
Notes:
Ralated command
ip access-group
- 45 -
04-Network Protocol command
ip access-list
permit
show ip access-list
3.1.2 ip access-group
Syntas
Parameter
Parameter Description
Access-list-name Name of access-list. This is a character string with 20 characters at most.
Command mode
Explanation
Access-list can be used either in the out-interface or in the in-interface. For standard
entrance access-list, source address of the package will be checked regarding to
access-list after the package is received. For extended access-list, this router also
checks destination address. If the address is permitted by access-list, the software will
continue to work on the package. If the address is not permitted by the access-list, this
software will give up the package and return a packet showing ICMP host is not
reachable.
For standard exit access-list, source address of the package will be checked by
software regarding to access-list after receiving and routing a package to the control
interface. For extended access-list, this router also checks access-list at the receiving
end. If the address is permitted by access-list, it will transmit the package. If the
address is not permitted by the access-list, this software will give up the package and
return a packet showing ICMP host is not reachable.
If the designated access-list doesn’t exist, all packages are permitted to pass.
- 46 -
04-Network Protocol command
Example
In the below example, list filter is applied on the package exist of Ethernet interface
1/0:
interface ethernet 0
ip access-group filter out
Ralated command
ip access-list
show ip access-list
3.1.3 ip access-list
Entering the IP access-list configuration mode after using this command. Access
regulations can be added or deleted. Command “exit” is used to return to configuration
state.
Syntas
Parameter
Parameter Description
standard Designated as standard access-list.
Default
No IP access-list is defined.
Command mode
Explanation
- 47 -
04-Network Protocol command
Example
Ralated command
deny
ip access-group
permit
show ip access-list
3.1.4 permit
Syntas
For internet control massage protocol (ICMP), the following syntax can also be used:
For internet group management protocol (IGMP), the following syntax can also be
used:
For data gram protocol (UDP), the following syntax can also be used:
- 48 -
04-Network Protocol command
Parameter
Parameter Description
protocol Protocol name or protocol number. It can be key word like icmp, igmp,
igrp, ip, ospf, tcp or udp. It can also be a whole number among 0-255 that
refers to the IP protocol number. Use key word “ip” to match any Internet
protocol (including ICMP, TCP and UDP). Some protocols are allowed to
be restricted further as the following.
source Source network or host number. There are 2 ways to designate the
source: 32-digit binary number, decimal number separated with 4 dots.
Use key word “any” to be the abbreviation of source and source Mask of
0.0.0.0 0.0.0.0
source-mask Source address network mask. Use key word “any” to be the abbreviation
of source and source Mask of 0.0.0.0 0.0.0.0 .
Use key word “any” to be the abbreviation of source and source Mask of
0.0.0.0 0.0.0.0 .
destination-mask Destination address network mask. Use key word “any” to be the
abbreviation of destination address and destination address Mask of
0.0.0.0 0.0.0.0 .
tos tos (Optional) Data package can use service level filter. Use a number among
0-15 to designate.
icmp-type (Optional) ICMP package can be filtered by ICMP packet type. The type is
a number among 0-255.
igmp-type (Optional) ICMP package can be filtered by ICMP packet type or name.
The type is a number among 0-15.
- 49 -
04-Network Protocol command
Command mode
Explanation
Access-list can be used to control the transmission of data package on the interface,
control line access to virtual terminals. Stop checking extended access-list after the
matching occurs.
It is IP packages divided by sections but not initial sections that will be received by any
extended IP access-list at once. Extended access-list is used to control accessing
virtual terminal line or restrict routes from choosing update content. It is not necessary
to match TCP source interface, type of service value and priority of package.
Notes:
After the initial establishment of an access-list, any follow-up addition (can be keyed in at a terminal)
should be placed at the end of the list.
TCP interface name used to replace interface number is shown as below. Find out
reference related to these protocols regarding current allocation number RFC.
Interface number relevant to these protocols can also be found out by keying in a “?” to
replace interface number.
bgp
ftp
ftp-data
login
pop2
pop3
smtp
telnet
www
UDP interface name used to replace interface number is shown as below. Find out
reference related to these protocols regarding the current allocation number RFC.
Interface number relevant to these protocols can also be found out by keying in a “?” to
replace interface number.
domain
snmp
syslog
tftp
- 50 -
04-Network Protocol command
Example
Notes:
Ralated command
deny
ip access-group
ip access-list
show ip access-list
Syntas
show ip access-list[access-list-name]
Parameter
Parameter Description
access-list-name Name of access-list. This is a character string of 20 characters at most.
Default
Command mode
Supervisor mode
Explanation
- 51 -
04-Network Protocol command
Example
The following is an example output of command “show ip access-list” when the name
is not designated.
Switch# show ip access-list
ip access-list standard aaa
permit 192.2.2.1
permit 192.3.3.0 255.255.255.0
ip access-list extended bbb
permit tcp any any eq www
permit ip any any
The following is an example output of command “show ip access-list” when the name
is designated.
ip access-list extended bbb
permit tcp any any eq www
permit ip any any
- 52 -