19-Network Protocol Configuration Commands
19-Network Protocol Configuration Commands
Table of Contents
Table of Contents
Chapter 1 IP Address Configuration Commands.................................................................................................................. 1
1.1 IP Address Configuration Commands ................................................................................................................... 1
1.1.1 arp ............................................................................................................................................................. 1
1.1.2 arp pending-time ....................................................................................................................................... 2
1.1.3 arp max-incomplete................................................................................................................................... 2
1.1.4 arp max-gw-retries .................................................................................................................................... 3
1.1.5 arp retry-allarp........................................................................................................................................... 4
1.1.6 arp timeout ................................................................................................................................................ 4
1.1.7 arp send-gratuitous ................................................................................................................................... 5
1.1.8 clear arp-cache.......................................................................................................................................... 6
1.1.9 ip address.................................................................................................................................................. 6
1.1.10 ip directed-broadcast............................................................................................................................... 7
1.1.11 ip forward-protocol................................................................................................................................... 8
1.1.12 ip helper-address..................................................................................................................................... 9
1.1.13 ip host...................................................................................................................................................... 9
1.1.14 ip default-gateway ................................................................................................................................. 10
1.1.15 ip proxy-arp ........................................................................................................................................... 11
1.1.16 show arp................................................................................................................................................ 11
1.1.17 show hosts ............................................................................................................................................ 12
1.1.18 show ip interface ................................................................................................................................... 13
Chapter 2 NAT Configuration Commands.......................................................................................................................... 15
2.1 NAT Configuration Commands............................................................................................................................ 15
2.1.1 ip nat........................................................................................................................................................ 15
2.1.2 ip nat local-service................................................................................................................................... 16
2.1.3 ip nat inside destination........................................................................................................................... 17
2.1.4 ip nat inside source ................................................................................................................................. 18
2.1.5 ip nat outside source ............................................................................................................................... 19
2.1.6 ip nat pool................................................................................................................................................ 20
2.1.7 ip nat translation...................................................................................................................................... 22
2.1.8 clear ip nat statistics................................................................................................................................ 23
2.1.9 clear ip nat translation ............................................................................................................................. 24
2.1.10 show ip nat statistics ............................................................................................................................. 25
2.1.11 show ip nat translations ......................................................................................................................... 26
2.1.12 debug ip nat........................................................................................................................................... 28
Chapter 3 Chapter 3 DHCP Client Configuration Commands............................................................................................ 29
3.1 DHCP Client Configuration Commands .............................................................................................................. 29
3.1.1 ip address dhcp....................................................................................................................................... 29
3.1.2 ip dhcp client ........................................................................................................................................... 30
3.1.3 ip dhcp-server.......................................................................................................................................... 31
3.1.4 show dhcp lease...................................................................................................................................... 32
3.1.5 show dhcp server .................................................................................................................................... 33
3.1.6 debug dhcp.............................................................................................................................................. 33
-I-
Table of Contents
- II -
Table of Contents
- III -
Network Protocol Configuration Commands
1.1.1 arp
To add a static and permanent entry in the Address Resolution Protocol (ARP) cache,
use the arp command in global configuration mode. To remove an entry from the ARP
cache, use the no form of this command.
arp ip-address hardware-address [alias]
no arp ip-address
parameter
parameter description
default
command mode
-1-
Network Protocol Configuration Commands
instruction
The common host all supports dynamic ARP analysis, so user doesn’t need to
configure static ARP entries for host.
Example
The following is an example of a static ARP entry for a typical Ethernet host:
arp 1.1.1.1 00:12:34:56:78:90
related commands
clear arp-cache
Parameter
Parameter Description
seconds Sets the waiting time of ARP cache resolution, whose unit is
second.
Default value
15 seconds
Command mode
Instruction
The first ARP cache resolution will generate an incomplete entry and this command will
then be used to set the life-time of this incomplete entry.
Example
The following example shows how to set the waiting time of ARP cache resolution to 10
seconds.
arp pending-time 10
Related command
show arp
-2-
Network Protocol Configuration Commands
Parameter
Parameter Description
Default value
Command mode
Instruction
This command can be used to set the maximum number of the incomplete entries
during ARP cache resolution.
Example
The following example shows how to set the maximum number of the incomplete ARP
cache entries to 10:
arp max-incomplete 10
Related command
show arp
Parameter
Parameter Description
Default value
Command mode
Instruction
The ARP entries, which the routing entry gateway depends on, require being
redetected at their aging so that the promptness and correctness of the hardware
-3-
Network Protocol Configuration Commands
subnet routing can be guaranteed. This command is here used for setting the maximum
ARP retransmissions in the redetection process. The bigger its value is, the greater
chance the detection has.
Example
The following example shows how to set the maximum retransmissions of the
Re-Detect packets to 5:
arp max-gw-retries 5
Related command
show arp
Parameter
None
Command mode
Instruction
By default, redetection is conducted only to the aging ARPs, which the routing entry
gateway depends on. However, if this command is enabled, redetection will be
conducted towards all types of aging ARP entries.
Example
The following example shows how to enable redetection to be carried out to all aging
ARP entries.
arp retry-allarp
Related command
show arp
-4-
Network Protocol Configuration Commands
parameter
parameter description
default
mode
instruction
This command is ignored when it is not configured on interfaces using ARP. The show
interface command displays the ARP timeout value, as seen in the following example
from the show interfaces command:
example
The following example sets the ARP timeout to 900 seconds on Ethernet 1/0 to allow
entries to time out more quickly than the default
interface vlan 10
arp timeout 900
related commands
show interface
parameter
parameter descruption
value Set time interval, the default is 120 seconds. The range is 15 to
600 seconds
mode
-5-
Network Protocol Configuration Commands
instruction
The following command start arp send-gratuitous on Interface Vlan 1, and set the send
interval as 3 minutes
switch_config_v1#arp send-gratuitous interval 180
related commands
arp
To clear all dynamic entries from the ARP cache, use the clear arp-cache
command.
clear arp-cache [ ip-address [ mask ] ]
parameter
parameter description
ip-address IP or subnets
mode
EXEC
example
The following example removes all dynamic entries from the ARP cache:
clear arp-cache
related commands
arp
1.1.9 ip address
To set an IP address and mask for an interface, use the ip address command.
Currently, there is no strict regulation to distinguish A.B.C IP address. But multicast
address and broadcast address can not be used( all host section is ‘1’). Other than the
Ethernet,multiple interfaces of other types can be connected to the same network.
Other than the unnumbered interface, the configured network range ot the Ethernet
interface can not be the same as the arbitrary interfaces of other types. You should
configure the primary address before configuring the secondary address. Also you
should delete all secondary addresses before deleting the primary address. IP packets
generanted by the system, if the upper application does not specify the soruce address,
the router will use the IP address configured on the sending interface that on the same
network range with the gateway as the source address of the packet. If the IP address
is uncertain (like interface route), the router will use the primary address of the sending
interface. If the ip address is not configured on an interface, also it is not the
unnumbered interface, and then this interface will not deal with any IP packet.To
remove an IP address or disable IP processing, use the no form of this command.
-6-
Network Protocol Configuration Commands
parameter
parameter description
ip-address IP address
mask IP mask
default
command mode
instruction
If any router on a network segment uses a secondary address, all other devices on that
same segment must also use a secondary address from the same network or subnet.
Inconsistent use of secondary addresses on a network segment can very quickly cause
routing loops. When you are routing using the Open Shortest Path First (OSPF)
algorithm, ensure that all secondary addresses of an interface fall into the same OSPF
area as the primary addresses
example
In the following example, 202.0.0.1 is the primary address, 255.255.255.0 is the mask
and 203.0.0.1 and 204.0.0.1 are secondary addresses for Ethernet interface 1/0:
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.10 ip directed-broadcast
To enable the translation of a directed broadcast to physical broadcasts, use the ip
directed-broadcast interface configuration command
ip directed-broadcast [access-list-namer]
no ip directed-broadcast
-7-
Network Protocol Configuration Commands
parameter
parameter description
default
command mode
example
1.1.11 ip forward-protocol
After the ip helper-address command is configured on interface, the ip
forward-protocol command is used to specify which UDP to be forwarded.
ip forward-protocol udp [port]
no ip forward-protocol udp [port]
default ip forward-protocol udp
parameter
parameter description
default
command mode
instruction
The netbios name service request is forwarded by default. Not to forward netbios name
service request, use one of the following commands:
no ip forward-protocol udp netbios-ns
no ip forward-protocol udp 137
-8-
Network Protocol Configuration Commands
To stop forwarding all UDP broadcasting requests, use the following command.
no ip forward-protocol udp
example
related commands
ip helper-address
1.1.12 ip helper-address
To enable the forwarding of User Datagram Protocol (UDP) broadcasts to specific IP
helper-addresses which can berm of this command.
ip helper-address address
no ip helper-address [address]
parameter
parameter description
default
mode
instruction
The ip helper-address command does not work on an X.25 interface on a destination router
because the router cannot determine if the packet was intended as a physical
broadcast. example
related commands
ip forward-protocol udp
1.1.13 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.
-9-
Network Protocol Configuration Commands
parameter
parameter description
default
disabled
command mode
example
The following example shows how to configure host name dns-server to IP host
address 202.96.1.3:
ip host dns-server 202.96.1.3
1.1.14 ip default-gateway
TO configure the default gateway of switch, use the ip default-gateway command. To
delete the default gateway of switch, use the no form of this command.
ip default-gateway address
no ip default-gateway
parameter
parameter description
address IP address
default
no configuration
mode
example
- 10 -
Network Protocol Configuration Commands
1.1.15 ip proxy-arp
To enable proxy Address Resolution Protocol (ARP) on an interface, use the ip
proxy-arp command. To disable proxy ARP on the interface, use the no form of this
command.
ip proxy-arp
no ip proxy-arp
parameter
default
proxy ARP
command mode
instruction
When routing switch receives ARP requirements, if routing switch has the routing path
to required IP address, and the routing interface and the interface receive the
requirements are different, routing switch will send ARP reaction from its own MAC
address, and then it forward actual data packets when receive them. In this case, even
if one host does not know the network topology, or without configured accurate routing,
it can also communicate with remote terminal. The remote host is connected with the
routing switch in the same physical subnet.
If the host need routing switch to provide such function, then the host and the routing
switch must be in the same IP network, or its IP address is regarded in the IP subnet of
routing switch, or rather, they can use different masks, or routing switch can not provide
such service.
example
The following example open the proxy ARP function on the interface VLAN 10
interface vlan 10
ip proxy-arp
show arp
parameter
- 11 -
Network Protocol Configuration Commands
mode
EXEC
instruction
parameter description
Age Displays the age in seconds. The router will refresh the
time to 0 when using this ARP entry.
example
parameter
command mode
EXEC
example
The following command shows how to display all host names/address mappings.
- 12 -
Network Protocol Configuration Commands
show hosts
related commands
clear host
parameter
parameter description
command mode
EXEC
instruction
If the interface link layer is usable, the line protocol is marked "Protocol up." If you
configure IP address on this interface, the router will add a direct route to the routing
table. If the link layer protocol is marked “Protocol down”, the direct route will be deleted.
This command displays the specified interface information if specified interface type
and number, or IP configuration information of all interfaces will be displayed.
Example
- 13 -
Network Protocol Configuration Commands
display description :
domain description
- 14 -
Network Protocol Configuration Commands
2.1.1 ip nat
To designate that traffic originating from or destined for the interface is subject to
Network Address Translation (NAT), use the ip nat command in interface configuration
mode. To disable interface from being able to translate, use the no form of this
command.
Note: ip nat mss command is configured in ip nat outside interface, it can modify the
Maximum Segment Size(MSS) value in TCP packet options with SYN marks from the
inner network. To disable this function, use the no form of this command
parameter
parameter description
mss MSS-value Sets MSS-value for the MSS value (the ip nat outside must be
configured beforehand)
- 15 -
Network Protocol Configuration Commands
default
command mode
instruction
Only packets moving between inside and outside interfaces can be translated. You
must specify at least one inside interface and outside interface for each border router
where you intend to use NAT.
example
The following example translates between inside hosts addressed from either the
192.168.1.0 or 192.168.2.0 network to the globally unique 171.69.233.208/28 network
and modifies MSS value:
Note:
The command is configured at the router interface where NAT external ports are
located. The command forbids only the interface to receive the icmp/udp/tcp message.
- 16 -
Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command mode
Instruction
It is used to create a dynamic address translation in the ACL form. The message from
the address matching the standard ACL uses the global address distributed from the
designated address pool for address translation. The address pool is designated by
the command ip nat pool.
Example
In the following example, the destination address of the message is translated from
network address 171.69.233.208 to the address of a host in network segment
192.168.2.208.
ip nat pool net-208 192.168.2.208 192.168.2.223 255.255.255.240
ip nat inside destination list a1 pool net-208
!
interface vlan10
ip address 171.69.232.182 255.255.255.240
ip nat outside
!
interface vlan11
ip address 192.168.1.94 255.255.255.0
ip nat inside
!
ip access-list standar a1
- 17 -
Network Protocol Configuration Commands
Parameter
Parameter Description
overload Multiple local addresses use one global address through the
routing switch. The parameter is optional. After the parameter
overload is set, multiple sessions on the same internal host will
be differentiated through the TCP ports or the UDP ports.
Default
Command mode
Instruction
The command has two modes: dynamic and static address translation. The dynamic
address translation is for the message with the ACL. The message from the address
matching the standard ACL uses the global address distributed from the designated
address pool for address translation. The address pool is designated by the command
ip nat pool.
The command with the keyword STATIC can create an independent static address
translation.
- 18 -
Network Protocol Configuration Commands
Example
In the following example, the IP address that is used for internal hosts in network
192.168.1.0 or 192.168.1.0 to communicate is translated to a unique global IP address
in network 171.69.233.208/28.
ip nat pool net-208 171.69.233.208 171.69.233.223 255.255.255.240
ip nat inside source list a1 pool net-208
!
interface vlan10
ip address 171.69.232.182 255.255.255.240
ip nat outside
!
interface vlan11
ip address 192.168.1.94 255.255.255.0
ip nat inside
!
ip access-list standard a1
permit 192.168.1.0 255.255.255.0
permit 192.168.2.0 255.255.255.0
!
Parameter
Parameter Description
- 19 -
Network Protocol Configuration Commands
Default
The translation from the source address of the outside network to the address of the
inside network does not exist.
Command mode
Instruction
You may not use the legal IP address which is normally distributed. You may use the IP
address which is normally distributed to other network. The phenomena that the IP
address is legally used by the outside network and illegally used by the inside network
is called address overlapping. You can use NAT to translate the inside address that
overlaps the outside address. If the IP address of your single-connection network
happens to be the same with the illegal IP address of other network and you have to
communicate with the network, you can enable the NAT function.
The command has two modes: dynamic and static address translation. The dynamic
address translation is for the message with the ACL. The message from the address
matching the standard ACL uses the global address distributed from the designated
address pool for address translation. The address pool is designated by the command
ip nat pool.
The command with the keyword static can create an independent static address
translation.
Example
In the following example, the IP address for inside hosts in the network 9.114.11.0 to
communicate with each other is translated to the unique global IP address in the
network 171.69.233.208/28. That is, the messages from the outside hosts with the
addressing 9.114.11.0 are translated and appear with the addressing 10.0.1.0/24.
ip nat pool net-208 171.69.233.208 171.69.233.223 255.255.255.240
ip nat pool net-10 10.0.1.0 10.0.1.255 255.255.255.0
ip nat inside source list a1 pool net-208
ip nat outside source list a1 pool net-10
!
interface vlan10
ip address 171.69.232.182 255.255.255.240
ip nat outside
!
interface vlan11
ip address 9.114.11.39 255.255.255.0
ip nat inside
!
ip access-list standard a1
permit 9.114.11.0 255.255.255.0
!
- 20 -
Network Protocol Configuration Commands
Parameter
Parameter Description
start-ip Start IP address for defining the scope of the IP address pool
end-ip End IP address for defining the scope of the IP address pool
Default
Command mode
Instruction
The command uses the start IP address, end IP address and subnet mask to define an
address pool. The defined address pool is an inside global address pool or an outside
local address pool.
Example
In the following example, the IP address for inside hosts in the network 192.168.1.0 or
192.168.2.0 to communicate with each other is translated to the unique global IP
address in the network 171.69.233.208/28.
ip nat pool net-208 171.69.233.208 171.69.233.223 255.255.255.240
ip nat inside source list a1 pool net-208
!
interface vlan10
ip address 171.69.232.182 255.255.255.240
ip nat outside
!
interface vlan11
ip address 192.168.1.94 255.255.255.0
ip nat inside
!
ip access-list standard a1
permit 192.168.1.0 255.255.255.0
permit 192.168.2.0 255.255.255.0
- 21 -
Network Protocol Configuration Commands
Parameter
Parameter Description
timeout Specifies the timeout value for 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 for connecting 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 to close a connection. The default value is 60 seconds.
icmp-timeout Sets the NAT timeout value for the ICMP. The default value is 60
seconds.
max-entries Sets the maximum NAT translation number. The default value is
4000.
syn-timeout Sets the NAT timeout time for the TCP SYN state. The default
value is 60 seconds.
seconds Specifies the timeout value for port translation. The default value
is one of the listed values in the default part.
max-links A.B.C.D Limits the maximum number of NAT connection items that a
specified inside IP address can establish. There is no default
value. You can run the no max-links command not to limit
maximum number of NAT connection items that a specified
inside IP address can establish.
max-links all Limits the maximum number of NAT connection items that each
inside IP address can establish. Its default value is similar to that
of the max-entries parameter.
- 22 -
Network Protocol Configuration Commands
Default
Command mode
Instruction
When port translation is configured, you can control the translation items for each
translation item contains much context information, including the translation volume.
The UDP translation of the non-DNS times out in five minutes, while UDP translation of
the DNS times out in one minute. If no RST or FIN exists in the data flow, TCP
translation times out in one hour. If RST or FIN exists in the data flow, TCP translation
times out in one minute.
Example
In the following example, the item of UDP port translation times out in ten minutes:
ip nat translation udp-timeout 600
In the following example, the maximum number of NAT connection items that the IP
address192.168.20.1 can establish is limited to 100:
ip nat translation max-links 192.168.20.1 100
Parameter
None
Command mode
Management mode
Instruction
The command can set all NAT statistics information to the original state.
Example
- 23 -
Network Protocol Configuration Commands
vlan10
Inside interfaces:
vlan100
Dynamic mappings:
-- Inside Source
-- Outside Source
ICMP=3, UDP=29, TCP=155, FRAG_ID=5 FRAG_PTR=0 / TOTAL=192
Switch#clear ip nat statistics
Switch#show ip nat statistics
Total active translations: 1 (0 static, 0 dynamic; 1 PAT)
Outside interfaces:
vlan10
Inside interfaces:
vlan100
Dynamic mappings:
-- Inside Source
-- Outside Source
ICMP=0, UDP=0, TCP=0, FRAG_ID=0 FRAG_PTR=0 / TOTAL=0
Parameter
Parameter Description
Command mode
Management mode
Instruction
- 24 -
Network Protocol Configuration Commands
Example
In the following example, the NAT translation item is first displayed and then the UDP
translation item is cleared.
switch# show ip nat translation
Pro Inside global Inside local Outside local Outside global
udp 171.69.233.209:1220 192.168.1.95:1220 171.69.2.132:53 171.69.2.132:53
tcp 171.69.233.209:11012 192.168.1.89:11012 171.69.1.220:23 171.69.1.220:23
tcp 171.69.233.209:1067 192.168.1.95:1067 171.69.1.161:23 171.69.1.161:23
switch# clear ip nat translation udp inside 171.69.233.209 1220 192.168.1.95 1220
171.69.2.132 53 171.69.2.132 53
switch# show ip nat translation
Pro Inside global Inside local Outside local Outside global
tcp 171.69.233.209:11012 192.168.1.89:11012 171.69.1.220:23 171.69.1.220:23
tcp 171.69.233.209:1067 192.168.1.95:1067 171.69.1.161:23 171.69.1.161:23
Parameter
Command mode
Management mode
Instruction
None
Example
The following is an output result after the show ip nat statistics command is used.
Switch# show ip nat statistics
Total translations: 2 (0 static, 2 dynamic; 0 extended)
Outside interfaces: vlan10
Inside interfaces: vlan11
Hits: 135 Misses: 5
Expired translations: 2
Dynamic mappings:
-- Inside Source
access-list 1 pool net-208
pool net-208: netmask 255.255.255.240
start 171.69.233.208 end 171.69.233.221
total addresses 14, allocated 2, misses 0
- 25 -
Network Protocol Configuration Commands
Field Description
Outside interfaces Outside interface list identified by the ip nat outside command
Inside interfaces Inside interface list identified by the ip nat inside command
Total addresses Total addresses in the address pool that can be used for the
address translation
Parameter
Parameter Description
Command mode
Management mode
Instruction
None
- 26 -
Network Protocol Configuration Commands
Example
The following is the displayed information after the show ip nat translations command
is run.
z Two inside hosts exchange message with some outside hosts. There is no
overload.
Switch# show ip nat translations
Pro Inside local Inside global Outside local Outside global
--- 192.168.1.95 171.69.233.209 --- ---
--- 192.168.1.89 171.69.233.210 --- --
z In overload condition, three address translation connections are activated, one
used for the DNS service, the other two used for telnet session (from two different
hosts). Note that two different inside hosts can appear with the same outside
address.
Switch# show ip nat translations
Pro Inside local Inside global Outside local Outside global
udp 192.168.1.95:1220 171.69.233.209:1220 171.69.2.132:53 171.69.2.132:53
tcp 192.168.1.89:11012 171.69.233.209:11012 171.69.1.220:23 171.69.1.220:23
tcp 192.168.1.95:1067 171.69.233.209:1067 171.69.1.161:23 171.69.1.161:23
z The following information appears after the command with the verbose keyword
is run:
switch# show ip nat translations verbose
Pro Inside local Inside global Outside local Outside global
udp 192.168.1.95:1220 171.69.233.209:1220 171.69.2.132:53 171.69.2.132:53
create time 00:00:02 , left time 00:01:10 ,
tcp 192.168.1.89:11012 171.69.233.209:11012 171.69.1.220:23 171.69.1.220:23
create time 00:01:13 , left time 00:00:50 ,
tcp 192.168.1.95:1067 171.69.233.209:1067 171.69.1.161:23 171.69.1.161:23
create time 00:00:02 , left time 00:53:19 ,
Table 2-2 describes important fields in the previous information.
Table 2-2 Field description about Show IP NAT Translations
Field Description
Inside local IP addresses that are allocated to the hosts in the inside
network, which may not legal addresses provided by NIC or the
service provider
Left time Indicating how long when the translation item times out
- 27 -
Network Protocol Configuration Commands
Parameter
None
Command mode
Management mode
Instruction
The debug ip nat detail command is used to display the detailed information in the
translation process, including source/destination IP address, protocol, port number
and the cause of translation failure.
The debug ip nat h323 command is used to display the detailed information when NAT
is translating the H323 message, including H323 information identified by NAT and
the IP addresses packaged in these messages. If the address is the inside IP
address, the translated IP address will be displayed.
Example
Field Description
No.1: The ICMP message (whose source address is 194.4.4.89 and destination
address is 10.10.10.102) from the VLAN 11 interface does not have the corresponding
NAT connection though it has the matched NAT regulation.
No.2: The TCP message (whose source address is 94.4.4.102 and destination address
is 192.2.2.1 and source port is port 2000) from the VLAN 10 interface does not have the
corresponding NAT connection.
- 28 -
Network Protocol Configuration Commands
Parameter
None
Default
None
Command mode
Instruction
The ip address dhcp command is used to allow the interface to obtain the IP address
through DHCP, which is very helpful for dynamically connecting the Internet service
provider (ISP) through the Ethernet interface. When the dynamic IP address is
obtained and the ip address dhcp command is configured, the switch sends the
DHCPDISCOVER message to the DHCP server in the network. When the dynamic IP
address is obtained and the no ip address dhcp command is configured, the switch
sends the DHCPRELEASE message.
- 29 -
Network Protocol Configuration Commands
Example
The following example shows that the VLAN11 interface obtains the IP address through
the DHCP protocol.
!
interface vlan11
ip address dhcp
Related command
ip dhcp client
ip dhcp-server
show dhcp lease
show dhcp server
Parameter
Parameter Description
select seconds Interval for selecting default parameter values (optional), ranging
from 0 to 30
Default
minleaseParameterDefault is 60 seconds.
retransmitParameterDefault is four times.
selectParameterDefault is zero second.
Command mode
Instruction
These commands can adjust these parameters according to network structure and
requirements of DHCP server.
If the negative forms of these commands are configured, these parameters are
resumed to the default settings.
- 30 -
Network Protocol Configuration Commands
Example
The following example shows that the minlease parameter is set to 100 seconds at the
client side of the switch:
ip dhcp client minlease 100
The following example shows that the retransmit parameter is set to 3 times at the
client side of the switch:
ip dhcp client retransmit 3
The following example shows that the SELECT parameter is set to 10 seconds at the
client side of the switch:
ip dhcp client select 10
Related command
ip address dhcp
ip dhcp-server
show dhcp lease
show dhcp server
3.1.3 ip dhcp-server
Run the ip dhcp-server command to specify the IP address of the DHCP server:
ip dhcp-server ip-address
no ip dhcp-server ip-address
Parameter
Parameter Description
Default
Command mode
Instruction
It is used to specify an IP address for the DHCP server. The command cannot replace
the previously specified IP address of the DHCP server.
You can run the negative form of the command to clear the previously configured IP
address of the DHCP server.
Example
The following example shows that the server whose IP address 192.168.20.1 is
designated as the DHCP server:
- 31 -
Network Protocol Configuration Commands
ip dhcp-server 192.168.20.1
Related command
ip address dhcp
ip dhcp client
show dhcp lease
show dhcp server
Parameter
None
Default
None
Command mode
Management mode
Instruction
It is used to check the information about the DHCP server distribution used by the
current switch.
Example
The following example shows that the information about the DHCP server distribution
used by the current switch is displayed:
switch#show dhcp lease
Temp IP addr: 192.168.20.3 for peer on Interface: vlan11
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.1.3, state: 4 Rebinding
DHCP transaction id: 2049
Lease: 86400 secs, Renewal: 43200 secs, Rebind: 75600 secs
Temp default-gateway addr: 192.168.1.2
Next timer fires after: 02:34:26
Retry count: 1 Client-ID: router-0030.80bb.e4c0-v11
Related command
ip address dhcp
ip dhcp client
ip dhcp-server
show dhcp server
- 32 -
Network Protocol Configuration Commands
debug dhcp
Parameter
None
Default
None
Command mode
Management mode
Instruction
Example
The following example shows that the known DHCP server information is displayed:
switch#show dhcp sever
DHCP server: 255.255.255.255
Leases: 0
Discovers: 62 Requests: 0 Declines: 0 Releases: 0
Offers: 0 Acks: 0 Naks: 0 Bad: 0
Subnet: 0.0.0.0, Domain name:
Related command
ip address dhcp
ip dhcp client
ip dhcp-server
show dhcp lease
Run the debug dhcp command to check the running state of the DHCP:
Parameter
Parameter Description
- 33 -
Network Protocol Configuration Commands
Default
Command mode
Management mode
Instruction
The following example shows that important information about the running of DHCP is
displayed.
switch#debug dhcp
switch#2000-4-22 10:50:40 DHCP: Move to INIT state, xid: 0x7
2000-4-22 10:50:40 DHCP: SDISCOVER attempt # 1, sending 277 byte DHCP packet
2000-4-22 10:50:40 DHCP: B'cast on vlan11 interface from 0.0.0.0
2000-4-22 10:50:40 DHCP: Move to SELECTING state, xid: 0x7
2000-4-22 10:50:46 DHCP: SDISCOVER attempt # 2, sending 277 byte DHCPpacket
2000-4-22 10:50:46 DHCP: B'cast on vlan11 interface from 0.0.0.0
2000-4-22 10:50:54 DHCP: SDISCOVER attempt # 3, sending 277 byte DHCPpacket
Related command
- 34 -
Network Protocol Configuration Commands
Parameter
Parameter Description
pkgs Number of ICMP packets sent when the DHCP server detects
whether the address is distributed
Default
Command mode
Instruction
You can run the following command to configure the DHCP server to send n ICMP
packets when the DHCP server checks whether the IP address is distributed.
ip dhcpd ping packets n
Example
The following example shows that the DHCP server has sent one ICMP packet when it
checks whether the IP address is distributed.
ip dhcpd ping packets 1
- 35 -
Network Protocol Configuration Commands
Parameter
Parameter Description
timeout Timeout time waiting for the ICMP response message when the
DHCP server checks whether the IP address is distributed (Unit:
100 ms)
Default
Command mode
Instruction
The following command can be used to configure the timeout time of the ICMP
response message to n*100 ms when the DHCP server checks whether the IP address
is distributed.
ip dhcpd ping timeout n
Example
The following example shows that the timeout time of the ICMP response message is
set to 300 ms when the DHCP server checks whether the IP address is distributed
ip dhcpd ping timeout 3
Parameter
Parameter Description
time Interval when the DHCP server stores the address distribution
information into the database (unit: minute)
Default
60
Command mode
- 36 -
Network Protocol Configuration Commands
Instruction
The following command can be used to configure that the DHCP server stores the
address distribution information into the database every n minutes.
ip dhcpd write-time n
It is recommended not to set the write-time to a value smaller than the default value.
Example
The following example shows that the DHCP server stores the address distribution
information into the database every 1440 minutes.
ip dhcpd write-time 1440
Parameter
Parameter Description
Default
None
Command mode
Instruction
The following command is used to add a name DHCP address pool and enter the dhcp
address pool configuration mode.
ip dhcpd pool name
Example
The following example shows that a test DHCP address pool is added and the dhcp
address pool configuration mode is entered.
ip dhcpd pool test
Parameter
None
Default
- 37 -
Network Protocol Configuration Commands
Command mode
Instruction
The following command is used to enable the DHCP service. In this case, the DHCP
server supports the relay operation. For the address request that cannot be distributed,
the port where ip helper-address is configured can forward the DHCP request.
ip dhcpd pool name
Example
4.2.1 network
Parameter
Parameter Description
Default
None
- 38 -
Network Protocol Configuration Commands
Command mode
Instruction
The command is used to configure the network address of the address pool for
automatic allocation. The command is only used in automatic allocation mode.
When configuring the command, make sure that the port receiving the DHCP message
has a network number of the port IP address similar to network.
Example
The following example shows that the network address of the DHCP address pool is set
to 192.168.20.0 and the subnet mask is set to 255.255.255.0.
network 192.168.20.0 255.255.255.0
4.2.2 range
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the address range for automatic allocation. Up to
eight address ranges can be configured for each address pool. Each range must be in
the network. The command is used only in automatic allocation mode.
Example
The following example shows that the address allocation range of the DHCP address
pool is between 192.168.20.210 and 192.168.20.219.
range 192.168.20.210 192.168.20.219
4.2.3 default-router
default-router ip-addr
- 39 -
Network Protocol Configuration Commands
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the default route. Up to four default routes can be
configured, which are separated by space.
Example
The following example shows that the default route allocated to the DHCP client is
192.168.20.1.
default-router 192.168.20.1
4.2.4 dns-server
dns-server ip-addr …
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the DNS server address that is allocated to the
client. Up to four DNS servers can be configured, which are sparated by space.
Example
The following example shows that the DNS server address allocated to the client is
192.168.1.3.
dns-server 192.168.1.3
- 40 -
Network Protocol Configuration Commands
4.2.5 domain-name
domain-name name
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the domain name which is distributed to the client.
Example
The following example shows that the domain name of the client is configured to
test.domain.
domain-name test.domain
4.2.6 lease
Parameter
Parameter Description
Default
One day
Command mode
Instruction
The command is used to configure the lease time of the distributed address.
- 41 -
Network Protocol Configuration Commands
Example
The following example shows that the lease time of the address distributed to the client
is set to 2 days and 12 hours.
Lease 2 12
4.2.7 netbios-name-server
netbios-name-server ip-addr
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the address of the netbios name server. Up to four
netbios name servers cam be configured, which is separated by space.
Example
The following example shows that the address of the of the netbios name server is set
to 192.168.1.10.
netbios-name-server 192.168.1.10
4.2.8 host
Parameter
Parameter Description
Default
None
Command mode
- 42 -
Network Protocol Configuration Commands
Instruction
The command is used to configure the host address of the address pool for manual
allocation. The command is used only in the manual allocation mode. You cannot set
the parameters host and range simultaneously in the same address pool.
Example
The following example shows that the manually allocated address of the address pool
is set to 192.168.20.200 and the subnet mask is set to 255.255.255.0.
host 192.168.20.200 255.255.255.0
4.2.9 hardware-address
Parameter
Parameter Description
Default
Command mode
Instruction
The command is used to configure the hardware address which is used for matching
the client. The address format is ab:cd:ef:gh in hex. The command is used only in
manual allocation mode.
Example
The following example shows that the hardware address of the manually allocated
address pool is set to 10:a0:0c:13:64:7d.
hardware-address 10:a0:0c:13:64:7d
4.2.10 client-identifier
client-identifier unique-identifier
Parameter
Parameter Description
- 43 -
Network Protocol Configuration Commands
Default
None
Command mode
Instruction
The command is used to configure the client ID for matching the client. The format of
client ID is ab.cd.ef.gh in dotted hex. The command is used only in manual allocation
mode.
Example
The following example shows that the client ID of the DHCP manually distributed
address pool is set to 01:10:a0:0c:13:64:7d.
client-identifier 01.10.a0.0c.13.64.7d
4.2.11 client-name
client-name name
Parameter
Parameter Description
Default
None
Command mode
Instruction
The command is used to configure the host name which is distributed to the client. The
command is used only in manual allocation mode.
Example
The following example shows that the host name which is distributed to the client is set
to test.
client-name test
- 44 -
Network Protocol Configuration Commands
Parameter
None
Default
None
Command mode
Management mode
Instruction
The command is used to enable the switch of the debugging information about the
DHCPD packet.
Example
The following example shows that the output switch of the debugging information about
the DHCPD packet is enabled.
debug ip dhcpd packet
Parameter
None
Default
None
Command mode
Management mode
Instruction
The command is used to enable the switch of the debugging information about the
DHCPD event.
Example
The following example shows that the switch of the debugging information about the
DHCPD event is enabled.
debug ip dhcpd event
- 45 -
Network Protocol Configuration Commands
Parameter
None
Default
None
Command mode
Instruction
The command is used to display the DHCPD statistics information, including numbers
of messages and addresses allocated automatically or manually.
Example
The following example shows that the DHCPD statistics information is displayed.
show ip dhcpd statistic
Parameter
Parameter Description
Default
Command mode
- 46 -
Network Protocol Configuration Commands
Instruction
The command is used to display the information about the DHCP address binding, the
IP address, hardware address, binding type and timeout time.
Example
Parameter
None
Default
None
Command mode
Management mode
Instruction
The command is used to delete the statistics information about the DHCPD message
numbers.
Example
The following example is used to delete the statistics information about the DHCPD
message numbers.
clear ip dhcpd statistic
Parameter
Parameter Description
Default
- 47 -
Network Protocol Configuration Commands
Command mode
Management mode
Instruction
The command is used to delete the binding information of the designated address.
Example
- 48 -
Network Protocol Configuration Commands
Parameter
Parameter Description
- 49 -
Network Protocol Configuration Commands
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
Command mode
Management mode
Instruction
The clear tcp command is mainly used to delete the terminated TCP connection. In
some cases, such as faulty in communication lines, restarting TCP connection or the
peer host, the TCP connections are terminated in fact. However, the system cannot
obtain information about the terminated TCP connection because there is no
communication on the TCP connections. In this case, you can run the clear tcp
command to terminate these invalid TCP connections. The command clear tcp local
host-name port remote host-name port is used to terminate the connections
between the specified host's IP address/port and the remote host’s IP address/port. The
command clear tcp tcb address is used to terminate the TCP connections identified
by the TCB address.
Example
The following example shows that the TCP connection between 192.168.20.22:23 and
192.168.20.120:4420 is deleted. The show tcp brief command is used to show the
information about the local host and the remote host in TCP connection.
switch#show tcp brief
TCB Local Address Foreign Address State
0xE85AC8 192.168.20.22:23 192.168.20.120:4420 ESTABLISHED
0xEA38C8 192.168.20.22:23 192.168.20.125:1583 ESTABLISHED
switch#clear tcp local 192.168.20.22 23 remote 192.168.20.120 4420
switch#show tcp brief
TCB Local Address Foreign Address State
0xEA38C8 192.168.20.22:23 192.168.20.125:1583 ESTABLISHED
In the following example, the TCP connection whose TCB address is 0xea38c8 is
deleted. The command show tcp brief displays the TCB address of the 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
Related command
show tcp
show tcp brief
show tcp tcb
- 50 -
Network Protocol Configuration Commands
Parameter
Command mode
Management mode
Example
Related command
Parameter
Command mode
Management 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 vlan 10; the IP
address of the host that sends the ARP request is 192.168.20.116 and the MAC address of the
host is 00:90:27:a7:a9:c2; the MAC address of the host 192.168.20.111 is IP ARP: rcvd req src
192.168.20.116 00:90:27:a7:a9:c2, dst 192.168.20.111, vlan 10.
- 51 -
Network Protocol Configuration Commands
The second information indicates that the switch receives an ARP request from
192.168.20.139 host on interface vlan 10. However, the interface is not in the network
the host declares according to the interface configuration on the switch. The host may
not be correctly configured. If the switch creates the ARP cache according to the
information, it may not communicate with the host that is configured the same address
and connected to 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
In the third information, to resolve the MAC address of host 192.168.20.77, the switch
first creates an incomplete ARP item in the ARP cache. After receiving an ARP
response, the MAC address is then added to the ARP cache. According to the location
of the switch, the host connects the interface vlan 10.
IP ARP: created an incomplete entry for IP address 192.168.20.77, vlan 10
In the fourth information, the switch sends out the ARP request from the interface vlan
10. The IP address of the switch is 192.168.20.22. The MAC address of the interface is
08:00:3e:33:33:8a. The IP address of the requested host is 192.168.20.77. The fourth
information is relative with the third information.
IP ARP: sent req src 192.168.20.22 08:00:3e:33:33:8a, dst 192.168.20.77, vlan 10
In the fifth information, the switch receives the ARP response on interface vlan 10 from
host 192.168.20.77 to host 192.168.20.22. The switch is then informed that the MAC
address of the host that returns the ARP response is 00:30:80:d5:37:e0. The
information is relative 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, vlan 10
Parameter
Command mode
Management mode
Instruction
The command is used to display the received or transmitted ICMP message, which
helps to solve end-to-end connection problems. To know the detailed meaning of the
command debug ip icmp, 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
ICMP: sent dst (202.96.209.133) host unreachable to 192.168.20.124, len 36
- 52 -
Network Protocol Configuration Commands
Details about the first information are shown in the following table:
ICMP: sent pointer indicating to 192.168.20.124 (dst was 192.168.20.22), len 48
Field Description
pointer indicating ICMP message which means that the original parameters of the
IP message are incorrect and incorrect domain is pointed out
The following are other types of ICMP message:
echo reply
dst unreachable:
---net unreachable
---host unreachable
---protocol unreachable
---port unreachable
---fragmentation needed and DF set
---source route failed
---net unknown
---destination host unknown
---source host isolated
---net prohibited
---host prohibited
---net tos unreachable
---host tos unreachable
source quench
redirect messages:
---net redirect
---host redirect
---net tos redirect
---host tos redirect
echo
router advertisement
router solicitation
time exceeded :
---ttl exceeded
---reassembly timeout
- 53 -
Network Protocol Configuration Commands
parameter problem :
---pointer indicating
---option missed
---bad length
timestamp
timestamp reply
information request
information reply
mask request
mask reply
If the ICMP type is unknown, the system is to display the values
of the ICMP type and code.
(dst was 192.168.20.22) Destination address of the original message that generates the
ICMP message
Details about the second information are shown in the following table:
ICMP: rcvd echo from 192.168.20.125, len 40
Field Description
Details about the third information are shown in the following table:
ICMP: sent echo reply, src 192.168.20.22, dst 192.168.20.125, len 40
Field Description
src 192.168.20.22 Means that the source address of the ICMP message is
192.168.20.22.
dst 192.168.20.125 Means that the destination address of the ICMP message is
192.168.20.125.
According to the type of the ICMP message, the information that generates the ICMP
message adopts different formats to display the message content.
For example, the redirect message of ICMP is printed in the following format:
ICMP: rcvd host redirect from 192.168.20.77, for dst 22.0.0.3 use gw 192.168.20.26, len 36
ICMP: sent host redirect to 192.168.20.124, for dst 22.0.0.5 use gw 192.168.20.77, len 36
In the first information, an ICMP redirect message from host 192.168.20.77 is received.
Gateway 192.168.20.26 is recommended to reach the destination host 22.0.0.3. The
length of the ICMP message is 36 bytes.
- 54 -
Network Protocol Configuration Commands
In the second information, the ICMP redirect message is sent to from host
192.168.20.124 to host 22.0.0.5 through gateway 192.168.20.77. The length of the
ICMP message is 36 bytes.
The dst unreachable message of ICMP adopts the following format for printing:
ICMP: sent dst (202.96.209.133) host unreachable to 192.168.20.124, len 36
ICMP: rcvd dst (2.2.2.2) host unreachable from 192.168.20.26, len 36
In the first information, the switch cannot route a certain IP message, so it sends the
destination (202.96.209.133) unreachable message to the source host
(192.168.20.124). The length of the ICMP message is 36 bytes.
In the second information, after receiving an ICMP message from host192.168.20.26,
the switch notifies host 192.168.20.26 that the destination address (2.2.2.2) cannot be
reached. The length of the ICMP message is 36 bytes.
Parameter
Parameter Description
Command mode
Management mode
Instruction
The command is used to find the destination of each received or locally generated IP
message, which helps to detect the reason of communication problems.
- 55 -
Network Protocol Configuration Commands
Command mode
Management mode
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
Field Description
s=192.168.20.120 (vlan Source address of the IP message and the interface name that
10) receives message (for message that is not locally generated)
d=19.0.0.9 (vlan 10) Destination address of the IP message and the interface name
that sends message (if routing is successful)
- 56 -
Network Protocol Configuration Commands
redirected Means that the routing switch is to send the ICMP redirect
message to the source host. Other cases are shown in the
following:
forward --- the message is forwarded.
forward directed broadcast---the message is forwarded as the
redirect message and the message will become the physical
broadcast on the transmitting interface.
unroutable---the message addressing fails and the message will
be dropped.
source route---source route
rejected source route---the current system does not support the
source route, therefore, the message with the IP source route
is declined.
bad options---the IP option is incorrect and the message will be
dropped.
need frag but DF set---the local message need be
fragmented,while the DF is set.
rcvd---the message is locally received.
rcvd fragment---the message fragment is received.
sending---the locally generated message is sent.
sending broad/multicast---the locally generated
broadcast/muticast message is sent.
sending fragment--- the IP message locally fragmented is sent.
denied by in acl---It is declined by the access control list on the
reception interface.
denied by out acl---It is declined by the transmitter access
control on the transmitter interface.
unknown protocol--- unknown protocol
encapsulation failed---The protocol fails to be encapsulated.It is
only for the Ethernet. When the message on the Ethernet is
dropped because of the ARP resolution failure, the information
is displayed.
In the first information, the switch receives an IP message; the source address of the
received message is 192.168.20.120; the message is from the network segment the
vlan 10 interface connects; its destination address is 19.0.0.9. According to the routing
table, the transmitter interface is vlan 10, the address of the gateway is 192.168.20.1
and the message length is 60 bytes. The gateway and the source host are directly
connected in the same network, that is, the network that vlan 10 connects. In this case,
the switch sends out the ICMP redirect message.
IP: s=192.168.20.120 (vlan 10), d=19.0.0.9 (vlan 10), g=192.168.20.1, len=60, redirected
In the second information, the transimmission of the ICMP redirect message is
described. The source address is the local address 192.168.20.22. The destination
address is 192.168.20.120. The message is directly sent from the vlan 10 interface to
the destination address. Therefore, the gateway’s address is the detination address
192.168.20.120. The length of the ICMP redirect message is 56 bytes.
- 57 -
Network Protocol Configuration Commands
The fourth information shows that the IP layer receives an IP message. The source
address and destination address of the IP message are 192.168.20.81 and
192.168.20.22 respectively. The reception interface is vlan 10. The length of the IP
message is 56 bytes. The IP message is locally received.
IP: s=192.168.20.81 (vlan 10), d=192.168.20.22 (vlan 10), len=56, rcvd
The following is an example about the output information after running the debug ip
packet detail command. Only the newly added parts are described.
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
Field Description
src, dst Source address and destination address of the UDP message
and the TCP message
ACK If ACK is set in the control bit of the TCP message, the
acknowledge number is valid. Other control bits include SYN,
URG, FIN, PSH and RST.
The first information indicates that the UDP message is received. The source port is
port 68 and the destination port is port 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 indicates that the protocol number of the received message 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 indicates that the ICMP message is received. Both the type and
the code of the message are represented by the number 0.
- 58 -
Network Protocol Configuration Commands
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 indicates that the TCP message is sent. The source port and
destination port are port 1024 and port 23 respectively. The sequence number and the
acknowledge number are 75098622 and 161000466 respectively. The size of the
receiption window is 17520. The ACK logo is set. For details, refer to RFC 793—
Transmission Control Protocol.
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
The access control list is described in the following. For example, if the messages with
the source address 192.168.20.125 require to be displayed, you need to define the
standard access control list to permit only the IP message whose source address is
192.168.20.125. You then run the command debug ip packet to use the access control
list.
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
In the previous commands, the standard access control list is used. You can also use
the extensible access control list.
Related command
Parameter
Parameter Description
- 59 -
Network Protocol Configuration Commands
Command mode
Management mode
Instruction
The command is used to find the destination of each received or locally generated IP
message, which helps to detect the reason of communication problems.
The command is used in the following cases:
z Forwarded
z Forwarded as the multicast message or the broadcast message
z Addressing failure during message forwarding
z Sending the redirect message
z Rejected because of having the original routing option
z Rejected because of illegal IP options
z Original route
z Message sent from the local machine should be segmented, but the DF is reset.
z Receiving message
z Receiving IP segment
z Sending message
z Sending broadcast/multicast
z Addressing failure when message is generated locally
z Locally generated message is segmented
z Received message is filtered
z Transmitted message is filtered
z Link layer fails to be encapsulated (only for Ethernet)
z Unknown protocol
This command may export lots of information. You'd better use it when the switch is in
the free state. Otherwise, the performance of the system will be badly affected. You are
recommended to filter the output information through the IP access control list, enabling
the system to export the useful message.
Example
Related command
- 60 -
Network Protocol Configuration Commands
Parameter
Command mode
Management mode
Example
Field Description
seq 50659460 Means that the sequence number of the message is 50659460.
DATA 1 Means that the number of valid data bytes contained in the
message is 1.
PSH Means that PSH in the control bits of the message is set.
- 61 -
Network Protocol Configuration Commands
Other control bits include ACK, FIN, SYN, URG and RST.
WIN 4380 It is used to notify the peer reception end of the cache size. The
current cache size is 4380 sizes.
If the previous fields are not displayed, the field in the TCP message does not have the
valid value.
Related command
Parameter
Command mode
Management mode
Example
Field Description
- 62 -
Network Protocol Configuration Commands
rcvd connection attempt Means that the connection request from peer port 23 (telnet
to port 23 port) is received.
TCB 0xE88AC8 created Means a new TCP connection control block is generated and its
logo is 0xE88AC8.
state was LISTEN -> Means that the state of the TCP state machine changes from the
SYN_RCVD LISTEN state to the SYN_RCVD state.
The TCP state may be one of the following:
LISTEN---waiting for the TCP connection request from any
remote host
SYN_SENT---the connection request for creating TCP
connection negotiation has been sent and the reply is being
waited.
SYN_RCVD---the connection request from the peer has been
received and the acknowledgement information and its own
connection request have also been sent out; the acknowledge
information about the peer’s connection is being waited.
ESTABLISHED---the connection is successful; the data is being
transmitted; the data of the upper application can be received
and sent.
FIN_WAIT_1---the connection termination request has been
sent to the peer; the acknowledgement information and the
connection termination request from the peer are being waited.
FIN_WAIT_2---the connection termination request has been
sent to the peer and the acknowledgement information from the
peer has been received; the connection termination request
from the peer is being waited.
CLOSE_WAIT--- the connection termination request from the
peer has been received and the acknowledgement information
has been sent out; the local user is being waited to close the
connection. Once the user demands to close the connection, the
system sends out the connection termination request.
CLOSING--- the connection termination request has been sent
to the peer and the connection termination request from the peer
has been received and the acknowledgement information has
been sent out; the system is waiting for the local connection
termination request acknowledge from the peer.
LAST_ACK---The system has received the connection
termination request from the peer and acknowledged it; the
system has already sent out connection termination request; the
acknowledge is being waited for.
TIME_WAIT---the period when the system waits for the peer to
receive the acknowledgement of the connection termination
request
CLOSED---the connection is closed.
For details, refer to RFC 793, Transmission Control Protocol.
- 63 -
Network Protocol Configuration Commands
[23 -> The first field (23) in the bracket means the local TCP port.
192.168.20.125:3828] The second field (192.168.20.125) in the bracket means the
remote IP address.
The third field (3828) in the bracket means the remote TCP port.
sending SYN Means a connection request message is sent out (SYN in the
control bits of the TCP header is set). Other TCP control bits
include SYN, ACK, FIN, PSH, RST and URG.
seq 50658312 Means that the sequence number for sending the message is
50658312.
ack 3130379657 Means that the acknowledgement number for sending the
message is 3130379657.
rcvd FIN Means that the connection termination request is received (FIN
in the control bits of the TCP header is set).
connection closed by Means that the upper application requires closing the TCP
user connection.
Related command
Parameter
Command mode
Management 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
Field Description
src Means the source IP address of the UDP message and the UDP
port.
- 64 -
Network Protocol Configuration Commands
dst Means the destination IP address of the UDP message and the
UDP port.
The first line in the previous information shows that a UDP message is received. The
UDP message is sent from host 192.168.20.99. Both the source port and the
destination port are port 520. The destination address is 192.168.20.255. The length of
the message is 32 bytes.
The second line in the previous information shows that a UDP message is sent. The
local address and the destination address are 192.168.20.22 and 192.168.20.43
respectively. The source port and the destination port are port 20001 and port 1001
respectively. The length of the message is 1008 bytes.
5.1.10 ip mask-reply
It is used to enable the switch to reply the mask request of the IP address on the
designated interface. Run the command no ip mask-reply to disable the function.
ip mask-reply
no ip mask-reply
default ip mask-reply
Parameter
Default
Command mode
Example
interface vlan 11
ip mask-reply
5.1.11 ip mtu
It is used to set the MTU of the IP message. To reuse MTUDefault, run the command
no ip mtu.
ip mtu bytes
no ip mtu
Parameter
Parameter Description
- 65 -
Network Protocol Configuration Commands
Default
It varies with different physical media of the interface. It is the same as MTU. The
minimum value is 68 bytes.
Command mode
Instruction
If the length of the IP message exceeds IP MTU configured on the interface, the switch
fragments the message. All devices connecting on the same physical media need be
configured the same MTU. The MTU affects the IP MTU. If the value of IP MTU is the
same as that of the MTU, the value of IP MTU automatically changes to the new value
of the MTU when the MTU value changes. The change of the IP MTU does not
affectthe MTU.
The minimum value of IP MTU is 68 bytes and the maximum value of IP MTU cannot
exceed the MTU value configured on the interface.
Example
The following example shows that IP MTU on interface vlan 10 is set to 200:
interface vlan 10
ip mtu 200
Related command
mtu
5.1.12 ip redirects
It is used to send the IP ICMP redirect message. You can run the command no ip
redirects not to send the IP ICMP redirect message.
ip redirects
no ip redirects
Parameter
Default
The IP redirect message is sent by default. However, if you configure the hot standby
switch protocol, the function is disabled automatically. If the hot standby switch
protocol is cancelled, the function cannot be automatically enabled.
Command mode
- 66 -
Network Protocol Configuration Commands
Instruction
When the switch finds that the forwarding interface of the gateway is the same as the
the reception interface and the source host directly connects the logical network of the
interface, the switch sends an ICMP redirect message, notifying the source host to
take the switch as the gateway to the destination address.
If the hot standby switch protocol is configured on the interface, the message may be
dropped when the IP redirect message is sent.
Example
The following example shows that the ICMP redirect message can be sent on interface
vlan 10:
interface vlan 10
ip redirects
5.1.13 ip route-cache
It is used to enable the route cache to forward the IP message. You can run the
command no ip route-cache to deny the route cache.
ip route-cache
no ip route-cache
ip route-cache same-interface
no ip route-cache same-interface
Parameter
Parameter Description
Default
The fast switching is allowed on the interface. The fast switching is forbidden on the
same interface.
Command mode
Instruction
The route cache performs load balance to the messages transmitted or received
through the source address and the destination address.
The route cache helps improving the message forwarding performance of the routing
switch. However, the route cache need be denied on the low-speed path (64 k or
below).
You can run the command ip route-cache same-interface to allow the rapid IP
switching on the same interface, that is, the reception interface is the same as the
transmitter interface. Normally, you are not recommended to enable the function
- 67 -
Network Protocol Configuration Commands
because it collides with the redirect function of the routing switch. If you have an
incompletely connected network, such as frame relay, you can enable the function on
the interface of the frame relay. For example, the routing switches A, B and C constitute
the frame relay network. Only the link from A to B and the link from B to C exist. The
communication from switch A to switch B must be relayed through switch B. Switch B
receives the message from switch A through a DLCI, and then forwards the message to
switch C through another DLCI.
Example
The following example shows that the rapid switching is permitted on the same
interface:
ip route-cache same-interface
The following command is used to forbid the rapid switching, including on the same
interface:
no ip route-cache
The following command is used to forbid the rapid switching only on the same interface:
no ip route-cache same-interface
The following command is used to resume the system to the default settings (the rapid
switching is permitted, but the rapid switching is forbidden on the same interface):
ip route-cache
Related command
show ip cache
Parameter
Parameter Description
hit-number Hit number needed when the items in the software route cache are added
to the hardware route cache
Default
Command mode
Instruction
The command is used to configure the hit number needed when the items in the
software route cache are added to the hardware route cache.
- 68 -
Network Protocol Configuration Commands
Example
The following example shows that the items in the software route cache are added to
the hardware route cache when the items are hit twice.
ip route-cache hit-numbers 2
Related command
show ip cache
Parameter
None
Default value
It is enabled by default.
Command mode
Instruction
In case the next hop of the route of the indirectly connected host is same as that of a
subnet route, the command will be used to decide whether to delete the hardware route
of a host.
Example
After the no ip exf command is run in global mode, the dst:192.200.1.1 nh:192.3.3.2
route of the indirectly connected host will be generated due to the forwarding of L3
packets. If you want to open IP EXF globally in this case, two results, as shown below,
will be obtained according to the shutdown or opening of ip route-cache age-exf.
a. If the ip route-cache age-exf command is enabled, the hardware subnet route,
dst:192.200.1.0/24 nh:192.3.3.2, will be generated and at the same time the
hardware host’s route, dst:192.200.1.1 nh:192.3.3.2, will be deleted.
b. If the ip route-cache age-exf command is disabled, the hardware subnet route,
dst:192.200.1.0/24 nh:192.3.3.2, will be generated and at the same time the
hardware host’s route, dst:192.200.1.1 nh:192.3.3.2, will be kept.
Related command
ip exf
show ip cache
- 69 -
Network Protocol Configuration Commands
Parameter
None
Default value
Disabled by default
Command mode
Instruction
After the policy routing is set, those route caches that look for routes through the policy
routing cannot be added to the hardware table, and in this case the software forwarding
reduces in its performance; after this command is set, these route caches can be added
to the hardware table to improve the performance of the system.
Example
The following example shows how to enable the function in global mode:
ip route-cache cache-pbr
Related command
show ip cache
Parameter
Parameter Description
Default value
- 70 -
Network Protocol Configuration Commands
Command mode
Instruction
If the delay is set, the related hardware route cache will be kept from being deleted
promptly at the change of ARP until the delay is done.
Note: In a network with a lot of directly connected hosts, ARP change will lead to the
cancelation of related hardware route cache, leaving here a lot of packets to impact
CPU, while the delay settings can provide a temporary protection to CPU. This
command is always used together with another command, arp retry-allarp, and when
both commands are executed, the system will learn ARP again and then reset the
correct egress for IP cache as soon as possible.
Example
The following example shows how to set the delay of hardware route cache, which is
caused by ARP change, to 60:
ip route-cache age-delay 60
Related command
show ip cache
Parameter
Parameter Description
alive-time Stands for the lifetime of the route entries in the software cache, whose unit
is 10ms.
Default value
Command mode
Instruction
This command is used to set the lifetime of the entries in the software route cache.
Example
The following example shows how to set the lifetime of the entries in the software route
cache to 40s:
- 71 -
Network Protocol Configuration Commands
Related command
show ip cache
Parameter
Parameter Description
ticks Sets the maximum time for the timer to operate the entries in the software
route cache each time.
Default value
Command mode
Instruction
This command is used to set the maximum time for the timer to operate the entries in
the software route cache. The bigger the maximum time is, the sooner the invalid
software route cache ages, especially when the system is busy. Hence, this command
can be used to restrain the quantity of the invalid entries in the software route cache.
Example
The following example shows how to set the maximum time, which is for the timer to
operate the entries in the software route cache, to 500ms:
ip route-cache software-index 50
Related command
show ip cache
- 72 -
Network Protocol Configuration Commands
Parameter
Parameter Description
ticks Sets the maximum time for the timer to operate the entries in the software
route cache each time.
Default value
Command mode
Instruction
This command is used to set the maximum time for the timer to operate the entries in
the hardware route cache. The bigger the maximum time is, the sooner the invalid
hardware route cache ages, especially when the system is busy.
Example
The following example shows how to set the maximum time, which is for the timer to
operate the entries in the software route cache, to 600ms:
ip route-cache hardware-index 60
Related command
show ip cache
5.1.21 ip route-cache-aging-time
To set the lifetime of the entries in the hardware cache, run the following command in
global mode:
[no] ip route-cache-aging-time seconds
Parameter
Parameter Description
Default value
Command mode
- 73 -
Network Protocol Configuration Commands
Instruction
This command is used to set the lifetime of the entries in the hardware route cache.
Example
The following example shows how to set the lifetime of the entries in the hardware route
cache to 600s:
ip route-cache-aging-time 600
Related command
show ip cache
5.1.22 ip source-route
It is used to enable the routing switch to process the IP message with the source IP
route. To enable the routing switch to drop the IP message with the source IP route,
run the command no ip source-route.
ip source-route
no ip source-route
Parameter
None
Default
Command mode
Example
The following command enables the routing switch to process the IP message with the
source IP route.
ip source-route
Related command
ping
- 74 -
Network Protocol Configuration Commands
Parameter
Parameter Description
seconds Time for waiting for the TCP connection, which ranges from 5 to
300 seconds
Its default value is 75 seconds.
Default
75 seconds
Command mode
Instruction
When the switch originates the TCP connection, if the TCP connection is unsuccessful
after the waiting time, the switch considers that the connection fails and sends the
result to the upper application. You can set the waiting time for the successful TCP
connection. The default value is 75 seconds. The option has nothing with the TCP
connection message forwarded by the switch. However, it is relevant with the local
TCP connection of the switch.
To know the current value of the waiting time, run the command ip tcp synwait-time ?.
The value in the square bracket is the current value.
Example
The following example shows that the waiting time of the TCP connection is set to 30
seconds:
switch_config#ip tcp synwait-time 30
switch_config#ip tcp synwait-time ?
<5-300>[30] seconds -- wait time
Parameter
Parameter Description
- 75 -
Network Protocol Configuration Commands
Default
2000 bytes
Command mode
Instruction
Do not hastly modify the default value of the window size unless you have a definite
purpose. You can run the command ip tcp window-size ? to know the current value.
The value in the square bracket is the current value.
Example
The following example shows that the size of the TCP window is set to 6000 bytes:
switch_config#ip tcp window-size 6000
switch_config#ip tcp window-size ?
<1-65535>[6000] bytes -- Window size
5.1.25 ip unreachables
It is used to enable the switch to send the ICMP unreachable message. To stop sending
the message, run the command no ip unreachables.
ip unreachables
no ip unreachables
Parameter
Default
Command mode
Instruction
When the switch forwards the IP message, the message is dropped if the relevant route
is not in the routing table. In this case, the switch sends the ICMP unreachable
message to the source host. According to the information in the ICMP unreachable
message, the source host promptly detects the fault and removes it.
Example
The following example shows that the interface vlan 10 is set to send the ICMP
unreachable message:
interface vlan 10
ip unreachables
- 76 -
Network Protocol Configuration Commands
Parameter
Parameter Description
software Means that only the itews stored in the software route
cache are displayed.
hardware Means that only the itews stored in the hardware route
cache are displayed.
Command mode
Management mode
Example
Field Description
The following example shows that the route cache whose destination address matches
the designated prefix or mask is displayed:
switch#show ip cache 192.168.20.0 255.255.255.0
Source Destination Interface Next Hop
2.0.0.124 192.168.20.125 vlan 101 192.168.20.125
The following example shows that the route cache whose transmitter interface matches
the designated interface type or mask is displayed:
switch#show ip cache vlan210
Source Destination Interface Next Hop
192.168.20.125 2.0.0.124 vlan 210 2.0.0.124
192.168.20.124 192.168.30.124 vlan 210 2.0.0.124
- 77 -
Network Protocol Configuration Commands
Parameter
Command mode
Management mode
Example
Parameter
Command mode
Management mode
Example
switch#show ip sockets
Proto Local Port Remote Port In Out
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
- 78 -
Network Protocol Configuration Commands
Field Description
Proto IP number
The protocol number of UDP is 17 and the number of TCP is 6.
Parameter
Command mode
Management 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
- 79 -
Network Protocol Configuration Commands
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
Field Description
format errors Means that the format of the message is incorrect, such as the
incorrect length of the IP header.
bad hop count Means that the TTL value decreases to 0 when the routing
switch forwards the message. In this case, the message will be
dropped.
no route Means that the routing switch does not have relevant route
message.
Parameter
Command mode
Management mode
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
- 80 -
Network Protocol Configuration Commands
Field Description
- 81 -
Network Protocol Configuration Commands
unread input bytes: Data that is processed by the lower-layer TCP and the upper
application has not received
Enqueued bytes for Bytes in the transmitter queue, including the data that is sent but
transmit: not yet acknowledged and the data that is not sent
After that, the information about the timer of the current connection is displayed,
including its startup times, timeout times and the next-time timeout time. The value 0
means that the timer does not run currently. Each connection has its own unique timer.
The timeout times is less than the startup times because the timer may be reset in its
process. For example, when the retransmission timer works, the system will receive the
acknowledgements for all data from the peer. In this case, the retransmission timer
stops running.
Timer Starts Wakeups Next(ms)
Retrans 33 1 0
TimeWait 0 0 0
SendWnd 0 0 0
KeepAlive 102 0 7199500
Field Description
- 82 -
Network Protocol Configuration Commands
TimeWait Time Waiting timer, which is used to know that the peer has
already received the acknowledgement of the connection
termination request.
After the timer is displayed, the sequence number of the TCP connection is displayed.
TCP uses the sequence number to gurantee reliable and orderly data transmission.
The local or remote host can control the traffic and send the acknowledgement
information according to the sequence number.
iss: 29139463 snduna: 29139525 sndnxt: 29139525 sndwnd: 17520
irs: 709124039 rcvnxt: 709205436 rcvwnd: 4380
Field Description
snduna: Sequence number of the first byte in the data that is already sent
but whose acknowledgement information has not been received
sndnxt: Transmission sequence number of the first data in the data that
is sent later
The transmission time recorded by the local host is displayed afterwards. The system
can adapt itself to different networks according to the transmission time.
SRTT: 15 ms, RXT: 2500 ms, RTV: 687 ms
minRXT: 1000 ms, maxRXT: 64000 ms, ACK hold: 200 ms
Field Description
- 83 -
Network Protocol Configuration Commands
ACK hold: Maximum delay time when the acknowledgement is delayed for
being sent together with the data
Field Description
max data segment is Maximum length of the data segment which is permitted by the
connection
Rcvd: Number of messages that the local host receives during the
connection procedure, including the number of the misordered
messages
Sent: Number of messages that are sent or resent by the local host
during the connection procedure
Related command
Parameter
Parameter Description
all An optional parameter, which means that all ports are displayed
If the parameter is not entered, the system does not display the
ports in the LISTEN state.
Command mode
Management mode
- 84 -
Network Protocol Configuration Commands
Example
Field Description
Related command
show tcp
show tcp tcb
Parameter
Command mode
Management mode
Example
- 85 -
Network Protocol Configuration Commands
Field Description
bad offset Number of messages showing that the data offset is incorrect
too short Number of messages showing that the message length is less
than the minimum effective length
partially dup packets Number of received messages that are partly duplicated
packets with data after Number of messages whose data exceeds the receiption
window window
packets after close Number of messages that are received after the connection is
closed
ack packets with unsent Number of received messages that are acknowledged but has
data not been sent
Sent Statistics data about messages that are sent by the routing
switch
control packets Number of the transmitted control messages (SYN, FIN or RST)
- 86 -
Network Protocol Configuration Commands
Related command
Parameter
Parameter Description
Command mode
Management mode
Example
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
- 87 -
Network Protocol Configuration Commands
Retrans 4 0 0
TimeWait 0 0 0
SendWnd 0 0 0
KeepAlive +5 0 6633000
Related command
show tcp
show tcp brief
5.2.1 deny
You can run the deny command in IP ACL configuration mode to forbid some
regulations. You can run the no deny command to remove the forbidden regulations
from the IP ACL.
deny source [source-mask] [log]
no deny source [source-mask] [log]
deny protocol source source-mask destination destination-mask [precedence
precedence] [tos tos] [log]
no deny protocol source source-mask destination destination-mask [precedence
precedence] [tos tos] [log]
The following syntax can be appled to the ICMP protocol:
deny icmp source source-mask destination destination-mask [icmp-type] [precedence
precedence] [tos tos] [log]
The following syntax can be appled to the IGMP protocol:
deny igmp source source-mask destination destination-mask [igmp-type] [precedence
precedence] [tos tos] [log]
The following syntax can be appled to the TCP protocol:
- 88 -
Network Protocol Configuration Commands
Parameter
Parameter Description
precedence precedence An optional parameter, which means that the packets can be
filtered by precedence
It is specified with an integer from 0 to 7.
tos tos An optional parameter, which means that the packets can be
filtered by the service layer.
It is specified with an integer from 0 to 15.
icmp-type An optional parameter, which means that the ICMP packets can
be filtered by the ICMP message type.
The ICMP message type is specified with an integer from 0 to
225.
- 89 -
Network Protocol Configuration Commands
igmp-type An optional parameter, which means that the IGMP packets can
be filtered by the IGMP message type or the IGMP message
name.
The IGMP message type is specified with an integer from 0 to
15.
Command mode
Instruction
You can control the virtual terminal path access and limit the content in the route choice
update by transmitting the ACL control packet. After the matching operation, the
extensible ACL stops to be checked. The IP segment is promptly received by any
extensible IP ACL. The extensible ACL is used to control the virtual terminal path
access and limit the content in the route choice update. The source ICP port, type of the
service value or precedence of the packet need not be matched.
Note:
After an ACL is originally created, any following content is written to the bottom of the
list.
The following are the TCP port names which are used to replace the port numbers. You
can find relative references about these protocols according to the current distribution
number. You can find the corresponding port numbers of these protocols by entering a
question mask.
Bgp、ftp、ftp-data、login、pop2、pop3、smtp、telnet、www
- 90 -
Network Protocol Configuration Commands
The following are the UDP port names which are used to replace the port numbers. You
can find relative references about these protocols according to the current distribution
number. You can find the corresponding port numbers of these protocols by entering a
question mask.
Domain、snmp、syslog、tftp
Example
Related command
ip access-group
ip access-list
permit
show ip access-list
5.2.2 ip access-group
It is used to control an interface access. To delete the designated access group, run the
command no ip access-group.
ip access-group {access-list-name}{in | out}
no ip access-group {access-list-name}{in | out}
Parameter
Parameter Description
access-list-name Name of the access control list, which is a character string with
up to 20 characters
Command mode
Instruction
The ACL can be used both on the incoming interface and the outgoing interface. For the
standard incoming ACL, the source address of the packet can be checked according
to the ACL after the packet is received. For the standard extensible ACL, the switch
also checks the destination address. If the ACL permits the address, the system
continues to process the packet. If the ACL denies the packet, the system drops the
packet and returns an ICMP unreachable message.
- 91 -
Network Protocol Configuration Commands
For the standard outgoing ACL, after a packet is received and routed to the control
interface, the switch ckecks the source address of the packey according to the ACL. For
the extensible ACL, the switch also checks the ACL at the receiption end. If the ACL
permits the address, the switch transmits the packet. If the ACL denies the address, the
switch drops the packet and returns an ICMP unreachable message.
If the designated ACL does not exist, all packets can pass through.
Example
The following example shows that the filter list is applied on Ethernet interface 0:
interface ethernet 0
ip access-group filter out
Related command
ip access-list
show ip access-list
5.2.3 ip access-list
It is used to enter the IP ACL configuration mode where you can add or delete the
access regulation. You can run the exit command to go back to the configuration mode.
You can run the command no ip access-list to delete an IP ACL.
ip access-list {standard | extended} name
no ip access-list {standard | extended} name
Parameter
Parameter Description
Default
Command mode
Instruction
The command is used to enter the IP ACL configuration mode. In IP ACL configuration
mode,you can run the deny command or the permit command to configure the
access regulation.
- 92 -
Network Protocol Configuration Commands
Example
Related command
deny
ip access-group
permit
show ip access-list
5.2.4 permit
It is used in IP ACL configuration mode to configure the permit regulations. To remove
the permit regulations, run the command no permit.
permit source [source-mask] [log]
no permit source [source-mask] [log]
permit protocol source source-mask destination destination-mask [precedence
precedence] [tos tos] [log]
no permit protocol source source-mask destination destination-mask
[precedence precedence] [tos tos] [log]
The following syntax can be applied to the ICMP protocol:
permit icmp source source-mask destination destination-mask [icmp-type]
[precedence precedence] [tos tos] [log]
The following syntax can be applied to the IGMP protocol:
permit igmp source source-mask destination destination-mask [igmp-type]
[precedence precedence] [tos tos] [log]
The following syntax can be applied to the TCP protocol:
permit tcp source source-mask [operator port] destination destination-mask
[operator port ] [established] [precedence precedence] [tos tos] [log]
The following syntax can be applied to the UDP protocol:
permit udp source source-mask [operator port [port]] destination destination-mask
[operator port] [precedence precedence] [tos tos] [log]
Parameter
Parameter Description
- 93 -
Network Protocol Configuration Commands
precedence precedence An optional parameter, which means that the packets can be
filtered by precedence
It is specified with an integer from 0 to 7.
tos tos An optional parameter, which means that the packets can be
filtered by the service layer.
It is specified with an integer from 0 to 15.
icmp-type An optional parameter, which means that the ICMP packets can
be filtered by the ICMP message type.
The ICMP message type is specified with an integer from 0 to
225.
igmp-type An optional parameter, which means that the IGMP packets can
be filtered by the IGMP message type or the IGMP message
name.
The IGMP message type is specified with an integer from 0 to
15.
- 94 -
Network Protocol Configuration Commands
Command mode
Instruction
You can control the virtual terminal path access and limit the content in the route choice
update by transmitting the ACL control packet. After the matching operation, the
extensible ACL stops to be checked. The IP segment is promptly received by any
extensible IP ACL. The extensible ACL is used to control the virtual terminal path
access and limit the content in the route choice update. The source ICP port, type of the
service value or precedence of the packet need not be matched.
Note:
After an ACL is originally created, any following content is written to the bottom of the
list.
The following are the TCP port names which are used to replace the port numbers. You
can find relative references about these protocols according to the current distribution
number. You can find the corresponding port numbers of these protocols by entering a
question mask.
Bgp、ftp、ftp-data、login、pop2、pop3、smtp、telnet、www
The following are the UDP port names which are used to replace the port numbers. You
can find relative references about these protocols according to the current distribution
number. You can find the corresponding port numbers of these protocols by entering a
question mask.
Domain、snmp、syslog、tftp
Example
- 95 -
Network Protocol Configuration Commands
Related command
deny
ip access-group
ip access-list
show ip access-list
Parameter
Parameter Description
access-list-name Name of the access control list, which is a character string with
up to 20 characters
Default
Command mode
Management mode
Instruction
Example
The following information appears after you run the command show ip access-list
without a designated ACL:
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 information appears after you run the command show ip access-list with
a designated ACL:
ip access-list extended bbb
permit tcp any any eq www
permit ip any any
- 96 -
Network Protocol Configuration Commands
z deny
z ip access-group
z ip access-list
z permit
z show ip access-list
5.3.1 deny
You can run the deny command in IP ACL configuration mode to configure deny
regulations. You can run the no deny command to remove the forbidden regulations
from the IP ACL.
deny source [source-mask]
no deny source [source-mask]
deny protocol source source-mask destination destination-mask [tos tos]
no deny protocol source source-mask destination destination-mask [tos tos]
The following syntax can be applied to the ICMP protocol:
deny icmp source source-mask destination destination-mask [icmp-type] [tos tos]
The following syntax can be applied to the IGMP protocol:
deny igmp source source-mask destination destination-mask [igmp-type] [tos tos]
The following syntax can be applied to the TCP protocol:
deny tcp source source-mask [operator port] destination destination-mask [operator
port ] [tos tos]
The following syntax can be applied to the UDP protocol:
deny udp source source-mask [operator port] destination destination-mask [operator
port] [tos tos]
Parameter
Parameter Description
- 97 -
Network Protocol Configuration Commands
precedence precedence An optional parameter, which means that the packets can be
filtered by precedence
It is specified with an integer from 0 to 7.
tos tos An optional parameter, which means that the packets can be
filtered by the service layer.
It is specified with an integer from 0 to 15.
icmp-type An optional parameter, which means that the ICMP packets can
be filtered by the ICMP message type.
The ICMP message type is specified with an integer from 0 to
225.
igmp-type An optional parameter, which means that the IGMP packets can
be filtered by the IGMP message type or the IGMP message
name.
The IGMP message type is specified with an integer from 0 to
15.
- 98 -
Network Protocol Configuration Commands
establish a connection.
Command mode
Instruction
You can control the virtual terminal path access and limit the content in the route choice
update by transmitting the ACL control packet. After the matching operation, the
extensible ACL stops to be checked. The IP segment is promptly received by any
extensible IP ACL. The extensible ACL is used to control the virtual terminal path
access and limit the content in the route choice update. The source ICP port, type of the
service value or precedence of the packet need not be matched.
Note:
After an ACL is originally created, any following content is written to the bottom of the
list.
Example
Related command
ip access-group
ip access-list
permit
show ip access-list
5.3.2 ip access-group
It is used to control an interface access. To delete the designated access group, run the
command no ip access-group.
ip access-group {access-list-name}
no ip access-group {access-list-name}
Parameter
Parameter Description
access-list-name Name of the access control list, which is a character string with
up to 20 characters
- 99 -
Network Protocol Configuration Commands
Command mode
Instruction
The ACL can be used on the incoming interface. For the standard incoming ACL, the
source address of the packet can be checked according to the ACL after the packet is
received. For the extensible ACL, the switch also checks the destination address. If
the ACL permits the address, the system continues to process the packet. If the ACL
denies the packet, the system drops the packet and returns an ICMP unreachable
message.
If the designated ACL does not exist, all packets can pass through.
Example
The following example shows that the filter list is applied on Ethernet interface 10:
interface f0/10
ip access-group filter
Related command
ip access-list
show ip access-list
5.3.3 ip access-list
After you run the command, the system enters the IP ACL configuration mode. In this
mode, you can add or delete the access regulations. You can run the exit command to
enable the system to enter the configuration mode
You can run the command no ip access-list to delete the IP ACL.
ip access-list {standard | extended} name
no ip access-list {standard | extended} name
Parameter
Parameter Description
Default
No IP ACL is defined.
- 100 -
Network Protocol Configuration Commands
Command mode
Instruction
It is used to enter the IP ACL configuration mode. In this mode, you can run the deny or
permit command to configure the access regulation.
Example
Related command
deny
ip access-group
permit
show ip access-list
5.3.4 permit
It is used in IP ACL configuration mode to configure the permit regulation. You can rum
the command no permit to remove the permit regulations from the IP ACL.
permit source [source-mask]
no permit source [source-mask]
permit protocol source source-mask destination destination-mask [tos tos]
no permit protocol source source-mask destination destination-mask [tos tos]
The following syntax can be applied to the ICMP protocol:
permit icmp source source-mask destination destination-mask [icmp-type] [tos tos]
The following syntax can be applied to the IGMP protocol:
permit igmp source source-mask destination destination-mask [igmp-type] [tos tos]
The following syntax can be applied to the TCP protocol:
permit tcp source source-mask [operator port] destination destination-mask
[operator port ] [tos tos]
The following syntax can be applied to the UDP protocol:
permit udp source source-mask [operator port [port]] destination destination-mask
[tos tos]
Parameter
Parameter Description
- 101 -
Network Protocol Configuration Commands
precedence precedence An optional parameter, which means that the packets can be
filtered by precedence
It is specified with an integer from 0 to 7.
tos tos An optional parameter, which means that the packets can be
filtered by the service layer.
It is specified with an integer from 0 to 15.
icmp-type An optional parameter, which means that the ICMP packets can
be filtered by the ICMP message type.
The ICMP message type is specified with an integer from 0 to
225.
igmp-type An optional parameter, which means that the IGMP packets can
be filtered by the IGMP message type or the IGMP message
name.
The IGMP message type is specified with an integer from 0 to
15.
- 102 -
Network Protocol Configuration Commands
Command mode
Instruction
You can control the virtual terminal path access and limit the content in the route choice
update by transmitting the ACL control packet. After the matching operation, the
extensible ACL stops to be checked. The IP segment is promptly received by any
extensible IP ACL. The extensible ACL is used to control the virtual terminal path
access and limit the content in the route choice update. The source ICP port, type of the
service value or precedence of the packet need not be matched.
Note:
After an ACL is originally created, any following content is written to the bottom of the
list.
Example
Related command
deny
ip access-group
ip access-list
show ip access-list
- 103 -
Network Protocol Configuration Commands
Parameter
Parameter Description
Default
Command mode
Management mode
Instruction
Example
The following information appears after you run the command show ip access-list
without specifying an ACL.
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 25
permit ip any any
The following information appears after you run the command show ip access-list with
a specified ACL.
ip access-list extended bbb
permit tcp any any eq 25
permit ip any any
- 104 -