0% found this document useful (0 votes)
5 views

05-Application Commands

Uploaded by

OI IO
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

05-Application Commands

Uploaded by

OI IO
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 122

Application Configuration Commands

1. Network Connectivity Test Tool Commands

2. DHCP Commands

3. DNS Commands

4. DDNS Commands

5. NTP Commands

6. SNTP Commands

7. SMART-DNS Commands

8. DNS Proxy Commands

9. FTP Server Commands

10. Time Range Commands

11. SFTP Commands


Command Reference Network Connectivity Test Tool Commands

1 Network Connectivity Test Tool Commands

1.1 clear rping table all

Use this command to clear Rping entries.


clear rping table [ all | [ ping-object owner test-name] | [ trace-object owner test-name ] ]

Parameter
Parameter Description
Description
owner User index
test-name Test index

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide N/A

Configuration The following example clears all Rping entries.


Examples Ruijie# clear rping table all
The following example clears the specified Rping entry.
Ruijie# clear rping table user ruijie

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

1.2 ping

Use this command to test the connectivity of a network to locate the network connectivity problem. The
command format is as follows:
ping [ ip ] { hostname | ipv4-address } [ data data | detail | df-bit | interval interval | length length |
ntimes times | out-interface interface-type interface-number [ next-hop next-hop ] | [ source
interface-type interface-number | source source-ipv4-address ] | timeout time | validate ] *

ping oob { hostname | ipv4-address } [ data data | detail | df-bit | interval interval | length length | ntimes
times | out-interface interface-type interface-number [ next-hop next-hop ] | [ source interface-type

1-1
Command Reference Network Connectivity Test Tool Commands

interface-number | source source-ipv4-address ] | timeout time | validate | via mgmt-name ] *

Parameter
Parameter Description
Description
hostname Destination host name.
ipv4-address Destination IPv4 address.
Specifies the padding data of the packet. The format is a string
data data
of 1 to 255 characters. By default, abcd is padded.
Configures whether to display the detailed information. By
detail default, only the exclamation mark (!) and period (.) are
displayed..
Configures the DF bit of the IP address. If the DF bit is set to 1,
df-bit
the packet is not segmented. The default value is 0.
Specifies the interval between the Ping packets, in
interval interval milliseconds. The value range is from 10 to 300000, and the
default value is 100.
Specifies the length of the padding section in the sent packet,
length length in bytes. The value range is from 36 to 18024, and the default
value is 100.
Specifies the number of sent packets. The value range is from
ntimes times
1 to 4294967295. The default value is 5.
out-interface interface-type Specifies the type and number of the outbound interface used
interface-number to send the packets.
Specifies the type and number of the source interface of the
source interface-type interface-number
packets.
source source-ipv4-address Specifies the source IPv4 address or source interface of the
packets. A loopback interface, for example, 127.0.0.1, cannot
be configured as the source address.
timeout time Specifies the timeout, in seconds. The value range is from 1 to
10, and the default value is 2.
validate Indicates that an out-of-band channel is used. This parameter
is mandatory if the MGMT interface is configured as the source
interface.
oob Specifies the ping interval, in the range from 10 to 300000
milliseconds. Default: 100 milliseconds.
via mgmt-name Specifies the outbound MGMT interface of packets where the
Ping operation is performed.

Defaults Five packets with 100Byte in length are sent to the specified IP address within specified time (2s by
default).

Command Privileged EXEC mode.


Mode

1-2
Command Reference Network Connectivity Test Tool Commands

Usage If the device can be pinged, the response information is displayed, and the statistics is listed at the end.
Guide For the extension functions of ping, the number, quantity and timeout time of the packets to be sent can be
specified, and the statistics is also displayed in the end. To use the domain name function, configure the
domain name server firstly. For the concrete configuration, refer to the DNS Configuration section.

Configurati The following example tests the connectivity of a network to locate the network connectivity problem.
on (regular ping).Ruijie# ping 192.168.21.26
Examples Sending 5, 100-byte ICMP Echoes to 192.168.21.26, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms

The following example displays details.


Ruijie#ping 192.168.21.26 detail
*Apr 16 09:16:08: %PING-7-DEBUG: Ping vrf index -1.
Sending 5, 100-byte ICMP Echoes to 192.168.21.26, timeout is 2 seconds:
< press Ctrl+C to break >
Reply from 192.168.21.26: bytes=100 time=4ms TTL=64
Reply from 192.168.21.26: bytes=100 time=3ms TTL=64
Reply from 192.168.21.26: bytes=100 time=1ms TTL=64
Reply from 192.168.21.26: bytes=100 time=1ms TTL=64
Reply from 192.168.21.26: bytes=100 time=1ms TTL=64
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms.2

VRF is not supported by NBR devices. The example in this document is only for your reference.

The following example tests the connectivity of a network to locate the network connectivity problem
(extension ping).
Ruijie# ping 192.168.21.26 length 1500 ntimes 100 data ffff source 192.168.21.99
timeout 3
Sending 100, 1500-byte ICMP Echoes to 192.168.21.26, timeout is 3 seconds:
< press Ctrl+C to break >
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 2/2/3 ms
The following example displays the details.
ping 192.168.21.26 length 1500 ntimes 20 data ffff source 192.168.21.99 timeout
3 detail
Sending 20, 1500-byte ICMP Echoes to 192.168.21.26, timeout is 3 seconds:
< press Ctrl+C to break >
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64

1-3
Command Reference Network Connectivity Test Tool Commands

Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64


Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=2ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=3ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64
Reply from 192.168.21.26: bytes=1500 time=1ms TTL=64

Success rate is 100 percent (20/20), round-trip min/avg/max = 1/1/3


ms

Related
Command Description
Commands
N/A N/A

Platform MGMT ports are supported on NBR6205-E, NBR6205-E V2, NBR6210-E, NBR6210-E V2 and
Description NBR6215-E but not on NBR6120-E.

1.3 ping ipv6

Use this command to test the connectivity of a network to locate the network connectivity problem. The
command format is as follows:
ping [ ipv6 ] { hostname | ipv6-address } [ data data | detail | interval interval | length length | ntimes
times | out-interface interface-type interface-number [ next-hop next-hop ] | [ source interface-type
interface-number | source source-ipv6-address ] | timeout time ] *

ping oob { hostname | ipv6-address } [ data data | detail | interval interval | length length | ntimes times |
out-interface interface-type interface-number [ next-hop next-hop ] | [ source interface-type
interface-number | source source-ipv6-address ] | timeout time | validate | via mgmt-name ] *

Parameter
Parameter Description
Description
hostname Destination host name.
ipv6-address Destination IPv6 address.
Specifies the padding data of the packet. The format is a string
data data
of 1 to 255 characters. By default, abcd is padded.

1-4
Command Reference Network Connectivity Test Tool Commands

Configures whether to display the detailed information. By


detail default, only the exclamation mark (!) and period (.) are
displayed..
Specifies the interval between the Ping packets, in
interval interval milliseconds. The value range is from 50 to 300000, and the
default value is 100.
Specifies the length of the padding section in the sent packet,
length length in bytes. The value range is from 16 to 18024, and the default
value is 100.
Specifies the number of sent packets. The value range is from
ntimes times
1 to 4294967295. The default value is 5.
out-interface interface-type Specifies the type and number of the outbound interface used
interface-number to send the packets.
Specifies the IPv6 address of the next hop of the outbound
next-hop next-hop
interface used to send the packets.
Specifies the type and number of the source interface of the
source interface-type interface-number
packets.
source source-ipv6-address Specifies the source IPv6 address or source interface of the
packets. A loopback interface, for example, ::1, cannot be
configured as the source address.
timeout time Specifies the timeout, in seconds. The value range is from 1 to
10, and the default value is 2.
oob Specifies the ping interval, in the range from 10 to 300000
milliseconds. Default: 100 milliseconds.
via mgmt-name Specifies the outbound MGMT interface of packets where the
Ping operation is performed.

Defaults Five packets with 100 Byte in length are sent to the specified IP address within specified time (2s by
default).

Command Privileged EXEC mode.


Mode

Usage If the device can be pinged, the response information is displayed, and the statistics is listed at the end.
Guide For the extension functions of ping, the number, quantity and timeout time of the packets to be sent can be
specified, and the statistics is also displayed in the end. To use the domain name function, configure the
domain name server firstly. For the concrete configuration, refer to the DNS Configuration section.

Configurati The following example executes the common Ping IPv6 function.
on //When the details are not shown:
Examples Ruijie# ping ipv6 2001::5
Sending 5, 100-byte ICMP Echoes to 2001::5, timeout is 2 seconds:
< press Ctrl+C to break >
!!!!!

1-5
Command Reference Network Connectivity Test Tool Commands

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms

//When the details are shown:


Ruijie#ping 2001::1 detail
Sending 5, 100-byte ICMP Echoes to 2001::1, timeout is 2 seconds:
< press Ctrl+C to break >
Reply from 2001::1: bytes=100 time=1ms
Reply from 2001::1: bytes=100 time=1ms
Reply from 2001::1: bytes=100 time=1ms
Reply from 2001::1: bytes=100 time=1ms
Reply from 2001::1: bytes=100 time=1ms

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms.

The following example executes the extended Ping IPv6 function.


//When the details are not shown:
Ruijie# ping ipv6 2001::5 length 1500 ntimes 100 data ffff source 2001::9 timeout
3
Sending 100, 1500-byte ICMP Echoes to 2000::1, timeout is 3 seconds:
< press Ctrl+C to break >
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 2/2/3 ms
//When the details are shown:
Ruijie#ping 2001::5 length 1500 ntimes 10 data ffff source 2001::9 timeout 3
Sending 10, 1500-byte ICMP Echoes to 2001::5, timeout is 3 seconds:
< press Ctrl+C to break >
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms
Reply from 2001::5: bytes=1500 time=1ms

Success rate is 100 percent (10/10), round-trip min/avg/max = 1/1/1 ms.

Related
Command Description
Commands
N/A N/A

1-6
Command Reference Network Connectivity Test Tool Commands

Platform MGMT ports are supported on NBR6205-E, NBR6205-E V2, NBR6210-E, NBR6210-E V2 and
Description NBR6215-E but not on NBR6120-E.

1.4 show rping detail

Use this command to display Rping information.


show rping detail

Parameter
Parameter Description
Description
N/A N/A

Defaults N/A

Command Privileged EXEC mode/Global configuration mode/Interface configuration mode


Mode

Usage Guide This command is used to display the Rping information such as numbers of test accounts and users.

Configuration The following example displays Rping information.


Examples Ruijie#show rping detail
Total owner number: 2
Total test number: 4
owner: user1
test name: taget_1 storage type: volatile
test name: taget_2 storage type: nonVolatile
owner: user2
test name: taget_1 storage type: permanent
test name: taget_2 storage type: readOnly
Field Description
Total owner number The number of users
Total test number The number of Rping accounts
owner Username
test name Test name
storage type Storage type

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

1-7
Command Reference Network Connectivity Test Tool Commands

1.5 traceroute

Use this command to display all gateways passed by the IPv4 test packets from the source address
to the destination address.
traceroute [ ip ] { hostname | ipv4-address } [ out-interface interface-type interface-number
[ next-hop next-hop ] | probe probe | [ source interface-type interface-number | source
source-ipv4-address ] | timeout time | ttl minimum maximum ] *

traceroute oob { hostname | ipv4-address } [ out-interface interface-type interface-number


[ next-hop next-hop ] | probe probe | [ source interface-type interface-number | source
source-ipv4-address ] | timeout time | ttl minimum maximum | via mgmt-name ] *

Parameter
Parameter Description
Description
hostname Destination host name.
ipv4-address Destination IPv4 address.
out-interface interface-type Specifies the type and number of the outbound interface used to send
interface-number the packets.
Specifies the IPv4 address of the next hop of the outbound interface
next-hop next-hop
used to send the packets.
Specifies the number of sent probe packets. The value range is from
probe probe
1 to 255, and the default value is 3.
source interface-type
Specifies the type and number of the source interface of the packets.
interface-number:
Specifies the source IPv4 address or source interface of the packets.
source source-ip-address A loopback interface, for example, 127.0.0.1, cannot be configured as
the source address.
timeout time Specifies the timeout, in seconds. The value range is from 1 to 10,
and the default value is 3.
ttl minimum maximum Specifies the minimum and maximum TTL values. The value range is
from 1 to 255. By default, the minimum TTL is 1, and the maximum
TTL is 255.
oob Indicates that an out-of-band channel is used. This parameter is
mandatory if the MGMT interface is configured as the source
interface.
via mgmt-name Specifies the outbound MGMT interface of packets where the
Traceroute operation is performed.

Defaults By default, seconds is 3 seconds, number is 3, minimum and maximum are 1 and 255.

Command Privileged EXEC mode: enables extended functions.


Mode User EXEC mode: enables basic functions.

1-8
Command Reference Network Connectivity Test Tool Commands

Usage Guide Use the traceroute command to test the connectivity of a network to exactly locate the network
connectivity problem when the network failure occurs. To use the function domain name, configure
the domain name server. For the concrete configuration, refer to the DNS Configuration part.

Configuration The following is two examples of the application bout traceroute, the one is of the smooth network,
Examples and the other is the network in which some gateways aren’t connected successfully.
1. When the network is connected smoothly:
Ruijie# traceroute 61.154.22.36
< press Ctrl+C to break >
Tracing the route to 61.154.22.36

1 192.168.12.1 0 msec 0 msec 0 msec


2 192.168.9.2 4 msec 4 msec 4 msec
3 192.168.9.1 8 msec 8 msec 4 msec
4 192.168.0.10 4 msec 28 msec 12 msec
5 192.168.9.2 4 msec 4 msec 4 msec
6 202.101.143.154 12 msec 8 msec 24 msec
7 61.154.22.36 12 msec 8 msec 22 msec
From above result, it’s clear to know that the gateways passed by the packets sent to the host with an
IP address of 61.154.22.36 (gateways 1 to 6) and the spent time are displayed. Such information is
helpful for network analysis.
2. When some gateways in the network fail:
Ruijie# traceroute 202.108.37.42
< press Ctrl+C to break >
Tracing the route to 202.108.37.42

1 192.168.12.1 0 msec 0 msec 0 msec


2 192.168.9.2 0 msec 4 msec 4 msec
3 192.168.110.1 16 msec 12 msec 16 msec
4 * * *
5 61.154.8.129 12 msec 28 msec 12 msec
6 61.154.8.17 8 msec 12 msec 16 msec
7 61.154.8.250 12 msec 12 msec 12 msec
8 218.85.157.222 12 msec 12 msec 12 msec
9 218.85.157.130 16 msec 16 msec 16 msec
10 218.85.157.77 16 msec 48 msec 16 msec
11 202.97.40.65 76 msec 24 msec 24 msec
12 202.97.37.65 32 msec 24 msec 24 msec
13 202.97.38.162 52 msec 52 msec 224 msec
14 202.96.12.38 84 msec 52 msec 52 msec
15 202.106.192.226 88 msec 52 msec 52 msec
16 202.106.192.174 52 msec 52 msec 88 msec
17 210.74.176.158 100 msec 52 msec 84 msec
18 202.108.37.42 48 msec 48 msec 52 msec

1-9
Command Reference Network Connectivity Test Tool Commands

The above result clearly shown that the gateways passed by the packets sent
to the host with an IP address of 202.108.37.42 (gateways 1~17) and the spent
time are displayed, and gateway 4 fails.
Ruijie# traceroute www.ietf.org

Translating "www.ietf.org"...[OK]
< press Ctrl+C to break >
Tracing the route to 64.170.98.32

1 192.168.217.1 0 msec 0 msec 0 msec


2 10.10.25.1 0 msec 0 msec 0 msec
3 10.10.24.1 0 msec 0 msec 0 msec
4 10.10.30.1 10 msec 0 msec 0 msec
5 218.5.3.254 0 msec 0 msec 0 msec
6 61.154.8.49 10 msec 0 msec 0 msec
7 202.109.204.210 0 msec 0 msec 0 msec
8 202.97.41.69 20 msec 10 msec 20 msec
9 202.97.34.65 40 msec 40 msec 50 msec
10 202.97.57.222 50 msec 40 msec 40 msec
11 219.141.130.122 40 msec 50 msec 40 msec
12 219.142.11.10 40 msec 50 msec 30 msec
13 211.157.37.14 50 msec 40 msec 50 msec
14 222.35.65.1 40 msec 50 msec 40 msec
15 222.35.65.18 40 msec 40 msec 40 msec
16 222.35.15.109 50 msec 50 msec 50 msec
17 * * *
18 64.170.98.32 40 msec 40 msec 40 msec

Related
Command Description
Commands
N/A N/A

Platform MGMT ports are supported on NBR6205-E, NBR6205-E V2, NBR6210-E, NBR6210-E V2 and
Description NBR6215-E but not on NBR6120-E.

1.6 traceroute ipv6

Use this command to display all gateways passed by the IPv6 test packets from the source address
to the destination address.
traceroute [ ipv6 ] { hostname | ipv6-address } [ out-interface interface-type interface-number
[ next-hop next-hop ] | probe probe | [ source interface-type interface-number | source
source-ipv6-address ] | timeout time | ttl minimum maximum ] *

traceroute oob { hostname | ipv6-address } [ out-interface interface-type interface-number

1-10
Command Reference Network Connectivity Test Tool Commands

[ next-hop next-hop ] | probe probe | [ source interface-type interface-number | source


source-ipv6-address ] | timeout time | ttl minimum maximum | via mgmt-name ] *

Parameter
Parameter Description
Description
hostname Destination host name.
ipv6-address Destination IPv6 address.
out-interface interface-type Specifies the type and number of the outbound interface used to send
interface-number the packets.
Specifies the IPv4 address of the next hop of the outbound interface
next-hop next-hop
used to send the packets.
Specifies the number of sent probe packets. The value range is from
probe probe
1 to 255, and the default value is 3.
source interface-type
Specifies the type and number of the source interface of the packets.
interface-number:
Specifies the source IPv6 address or source interface of the packets.
source source-ipv6-address A loopback interface, for example, ::1, cannot be configured as the
source address.
timeout time Specifies the timeout, in seconds. The value range is from 1 to 10,
and the default value is 3.
ttl minimum maximum Specifies the minimum and maximum TTL values. The value range is
from 1 to 255. By default, the minimum TTL is 1, and the maximum
TTL is 255.
oob Indicates that an out-of-band channel is used. This parameter is
mandatory if the MGMT interface is configured as the source
interface.
via mgmt-name Specifies the outbound MGMT interface of packets where the
Traceroute operation is performed.

Defaults By default, seconds is 3 seconds, number is 3, minimum and maximum are 1 and 255.

Command Privileged EXEC mode: enables extended functions.


Mode User EXEC mode: enables basic functions.

Usage Guide Use the traceroute ipv6 command to test the connectivity of a network to exactly locate the network
connectivity problem when the network failure occurs. To use the function domain name, configure
the domain name server. For the concrete configuration, refer to the DNS Configuration part.

Configuration The following is two examples of the application bout traceroute, the one is of the smooth network,
Examples and the other is the network in which some gateways aren’t connected successfully.
1. When the network is connected smoothly:
Ruijie# traceroute ipv6 3004::1
< press Ctrl+C to break >
Tracing the route to 3004::1

1-11
Command Reference Network Connectivity Test Tool Commands

1 3000::1 0 msec 0 msec 0 msec


2 3001::1 4 msec 4 msec 4 msec
3 3002::1 8 msec 8 msec 4 msec
4 3004::1 4 msec 28 msec 12 msec
From above result, it’s clear to know that the gateways passed by the packets sent to the host with an
IP address of 3004::1 (gateways 1 to 4) and the spent time are displayed. Such information is helpful
for network analysis.

2. When some gateways in the network fail:


Ruijie# traceroute ipv6 3004::1
< press Ctrl+C to break >
Tracing the route to 3004::1
1 3000::1 0 msec 0 msec 0 msec
2 3001::1 4 msec 4 msec 4 msec
3 3002::1 8 msec 8 msec 4 msec
4 * * *
5 3004::1 4 msec 28 msec 12 msec
The preceding test result indicates that the network device accesses host 3004::1 by transmitting
packets through gateways 1–5, and Gateway 4 is faulty.

Related
Command Description
Commands
N/A N/A

Platform MGMT ports are supported on NBR6205-E, NBR6205-E V2, NBR6210-E, NBR6210-E V2 and
Description NBR6215-E but not on NBR6120-E.

1-12
Command Reference DHCP Commands

2 DHCP Commands

2.1 address range

Use this command to specify the network segment range of the addresses that can be allocated by
CLASS associated with DHCP address pool. Use the no form of this command to restore the default
setting.
address range low-ip-address high-ip-address
no address range

Parameter Parameter Description


Description low-ip-address Start address in the network segment range.
high-ip-address End address in the network segment range.

Defaults By default, the associated CLASS is not configured with the network segment range. The default is
the address pool range.

Command Address pool CLASS configuration mode.


Mode

Usage Guide This command is configured on a Dynamic Host Configuration Protocol (DHCP) server. Each CLASS
corresponds to one network range which must be from low address to high address, so as to allow
the duplication of network segment range between multiple CLASSes. If the CLASS associated with
the address pool is specified without configuring the corresponding network segment range, the
default network segment range of this CLASS is same as the range of the address pool where this
CLASS is.

Configuration The following example configures the network segment of class1 associated with address pool
Examples mypool0 ranging from 172.16.1.1 to 172.16.1.8.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# class class1
Ruijie (config-dhcp-pool-class)# address range 172.16.1.1 172.16.1.8

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.
Configures the CLASS associated with the DHCP address pool and
class
enters the address pool CLASS configuration mode.

Platform N/A
Description

2-1
Command Reference DHCP Commands

2.2 bootfile

Use this command to define the startup mapping file name of the DHCP client. Use the no or default
form of this command to restore the default setting.
bootfile file-name
no bootfile
default bootfile

Parameter Parameter Description


Description file-name Startup file name.

Defaults No startup file name is defined by default.

Command DHCP address pool configuration mode


Mode

Usage Guide This command is configured on a DHCP server.


Some DHCP clients need to download the operating system or configuration file in the boot process.
A DHCP server must provide the image file name required during boot for the DHCP clients to
download the file from the corresponding server, such as the Trivial File Transfer Protocol (TFTP)
server. The next-server command is used to define the servers for boot image file download.

Configuration The following example defines the device.conf as the startup file name.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# bootfile device.conf

Related Command Description


Commands Defines the name of the DHCP address pool and enter the DHCP address pool
ip dhcp pool
configuration mode.
next-server Configures the next server IP address of the DHCP client startup process.

Platform N/A
Description

2.3 class

Use this command to configure the associated CLASS in the DHCP address pool. Use the no form of
this command to restore the default setting.
class class-name
no class

Parameter Parameter Description


Description class-name Class name, which can be the character string or numeric such as myclass or 1.

2-2
Command Reference DHCP Commands

Defaults By default, no CLASS is associated with the address pool.

Command DHCP address pool configuration mode


Mode

Usage Guide This command is configured on a DHCP server.


In each DHCP address pool, Option 82 information is used to map address segments and classify
them into different classes. A DHCP address pool can be associated with multiple classes. Each
class corresponds to a different network segment.
During address assignment, a DHCP server first determines an available address pool based on the
network segment of a client. Then, it determines the class of the client based on Option 82, and
assigns an IP address from the network segment corresponding to the class. When a request packet
matches multiple classes in the address pool, the DHCP server assigns an IP address from the
network segments corresponding to the classes based on the class configuration sequence. If the
number of assigned IP addresses of a class reaches the limit, the DHCP server assigns an IP
address based on the next matching class. Each class corresponds to one network segment.
Network segments are assigned in ascending order, and the network segments of multiple classes
can overlap. If a class is associated with an address pool but no network segment is configured for
the class, the default network segment of the class is the same as the network segment of the
address pool.

Configuration The following example configures the address mypool0 to associate with class1.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# class class1

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2.4 clear ip dhcp auth-agent

Use this command to clear entries of DHCP clients to be authorized.


clear ip dhcp auth-agent { * | mac-addr }

Parameter
Parameter Description
Description
* Clears the entries of DHCP clients to be authorized.
Clears the entries of DHCP clients to be authorized of the specified MAC
mac-addr
addresses.

2-3
Command Reference DHCP Commands

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide This command is configured on a DHCP server. This command can only clear entries of DHCP clients to be
authorized that are generated upon terminal access without fixed bindings when the solidify attribute is
enabled for the address pool.

Configuration The following example clears entries of the DHCP client with the MAC address of 00d0.5564.8899.
Examples Ruijie# clear ip dhcp auth-agent 00d0.5564.8899

Notification -

Platform
-
Description

2.5 clear ip dhcp binding

Use this command to clear the DHCP binding table in the privileged user mode.
clear ip dhcp binding { * | ip-address }

Parameter Parameter Description


Description * Deletes all DHCP bindings.
ip-address Deletes the binding of the specified IP addresses.

Defaults N/A.

Command Privileged EXEC mode.


Mode

Usage Guide This command is configured on a DHCP server.


This command can clear records of automatically bound IP addresses only. To clear records of
manually bound IP addresses, run the no ip dhcp pool command.

Configuration The following example clears the DHCP binding with the IP address 192.168.12.100.
Examples Ruijie# clear ip dhcp binding 192.168.12.100

Related Command Description


Commands show ip dhcp binding Displays the address binding of the DHCP server.

Platform N/A
Description

2-4
Command Reference DHCP Commands

2.6 clear ip dhcp conflict

Use this command to clear the DHCP address conflict record.


clear ip dhcp conflict { * | ip-address }

Parameter Parameter Description


Description * Deletes all DHCP address conflict records.
ip-address Deletes the conflict record of the specified IP addresses.

Defaults N/A.

Command Privileged EXEC mode.


Mode

Usage Guide This command is configured on a DHCP server. The DHCP server uses the ping session to detect the
address conflict, while the DHCP client uses the address resolution protocol (ARP) to detect the
address conflict. The clear ip dhcp conflict command can be used to delete the history conflict
record.

Configuration The following example clears all address conflict records.


Examples Ruijie# clear ip dhcp conflict *

Related Command Description


Commands Defines the number of the data packets sent by the ping operation for
ip dhcp ping packets the detection of the address conflict when the DHCP server assigns an
IP address.
Displays the address conflict that the DHCP server detects when it
show ip dhcp conflict
assigns an IP address.

Platform N/A
Description

2.7 clear ip dhcp dynamic-binding

Use this command to clear dynamic online DHCP entries.


clear ip dhcp dynamic-binding { * | mac-addr }

Parameter
Parameter Description
Description
* Clears all dynamic online DHCP entries.
Clears the dynamic online DHCP entries for terminals with the
mac-addr
specified MAC addresses.

2-5
Command Reference DHCP Commands

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide This command is configured on a DHCP server. This command can only clear online entries that are
dynamic assigned, but cannot clear online entries of fixed bindings.

Configuration The following example clears dynamic online DHCP entries of the terminal with the MAC address of
Examples 00d0.5564.8899.
Ruijie# clear ip dhcp dynamic-binding 00d0.5564.8899

Notification N/A

Platform
N/A
Description

2.8 clear ip dhcp history

Use this command to clear the address assigned by the DHCP server.
clear ip dhcp history { * | mac-address }

Parameter Parameter Description


Description * Clears all addresses assigned by the DHCP server.
Clears the address assigned by the DHCP server corresponding to
mac-address
the specified MAC address.

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide This command is configured on the DHCP server. A DHCP server saves information about all
assigned IP addresses. This command is used to clear all historical address records.

Configuration The following example clears all addresses assigned by the DHCP server.
Examples Ruijie# clear ip dhcp history *

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-6
Command Reference DHCP Commands

2.9 clear ip dhcp relay statistics

Use this command to clear the DHCP relay statistics.


clear ip dhcp relay statistics

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide The DHCP relay is configured with the counter to count various packets received or transmitted by
the relay. This command is used to clear the counters.

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.10 clear ip dhcp server detect

Use this command to clear statistics about the fake DHCP server.
clear ip dhcp server detect { * | ip-address }

Parameter Parameter Description


Description * Clears statistics about all fake DHCP servers.
ip-address Clears statistics about the specified fake DHCP server.

Defaults N/A

Command
Privileged EXEC mode
Mode

Usage Guide This command is configured on a DHCP server. The detected fake DHCP server addresses are
saved on the server. You can use the clear ip dhcp server detect command to clear statistics about
the fake DHCP server.

Configuration The following example clears statistics about all fake DHCP servers.
Examples Ruijie# clear ip dhcp server detect *

2-7
Command Reference DHCP Commands

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.11 clear ip dhcp server rate

Use this command to clear statistics about the packet processing rate of every module.
clear ip dhcp server rate

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide This command is configured on a DHCP server. This command is used to clear statistics about the
packet processing rate of every module, including arp, hot backup, lsm, and socket.

Configuration The following example clears statistics about the packet processing rate of every module.
Examples Ruijie# clear ip dhcp server rate

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.12 clear ip dhcp record-history

Use this command to clear historical online DHCP statistics.


clear ip dhcp record-history

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode


Mode

2-8
Command Reference DHCP Commands

Default Level 14

Usage Guide This command is configured on a DHCP server. This command is used to clear historical DHCP statistics on
the number of online IP addresses.

Configuration The following example clears historical online DHCP statistics.


Examples Ruijie# clear ip dhcp record-history

Notification N/A

Platform
N/A
Description

2.13 clear ip dhcp server statistics

Use this command to reset the counter of the DHCP server in the privileged user mode.
clear ip dhcp server statistics

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode.


Mode

Usage Guide This command is configured on a DHCP server.


The DHCP server carries out the statistics counter, records the DHCP address pool, automatic
binding, manual binding and expired binding. Furthermore, it also carries out the statistics to the
number of sent and received DHCP messages. The clear ip dhcp server statistics command can
be used to delete the history counter record and carry out the statistics starting from scratch.

Configuration The following example clears the statistics record of the DHCP server.
Examples Ruijie# clear ip dhcp server statistics

Related Command Description


Commands show ip dhcp server statistics Displays the statistics record of the DHCP server.

Platform N/A
Description

2-9
Command Reference DHCP Commands

2.14 clear ip dhcp solid-binding

Use this command to clear online entries of fixed DHCP bindings.


clear ip dhcp solid-binding all

Parameter
Parameter Description
Description
- -

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide This command is configured on a DHCP server. This command can only clear online entries that are
assigned after fixed bindings are configured and cancel the fixed bindings.

Configuration The following example clears all fixed binding information.


Examples Ruijie# clear ip dhcp solid-binding all

Notification N/A

Platform
N/A
Description

2.15 clear ip dhcp warn-log

Use this command to clear DHCP service alarm information.


clear ip dhcp warn-log { history | current }

Parameter
Parameter Description
Description
history Specifies historical alarm information.
current Specifies current alarm information.

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide This command is configured on a DHCP server. This command is used to clear the alarm information
including terminal migration, address exhaustion, terminals to be authorized, and address conflicts.

2-10
Command Reference DHCP Commands

Configuration The following example clears historical DHCP alarm information.


Examples Ruijie# clear ip dhcp warn-log history

Notification N/A

Platform
N/A
Description

2.16 client-identifier

Use this command to define the unique ID of the DHCP client (indicated in hex, separated by dot) in the
DHCP address pool configuration mode. Use the no form of this command to restore the default
setting.
client-identifier unique-identifier
no client-identifier

Parameter Parameter Description


Description The DHCP client ID is indicated in hex and separated by dot, for instance,
unique-identifier
0100.d0f8.2233.b467.6967.6162.6974.4574.6865.726e.6574.302f.31.

Defaults N/A.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. When some DHCP clients request the DHCP server to
assign IP addresses, they use their client IDs rather than their hardware addresses. The client ID
consists of media type, MAC addresses and interface name. For instance, the MAC address is
00d0.f822.33b4, the interface name is GigabitEthernet 0/1, and the corresponding client ID is
0100.d0f8.2233.b467.6967.6162.6974.4574.6865.726e.6574.302f.31, where, 01 denotes the type of
the Ethernet media.
The 67.6967.6162.6974.4574.6865.726e.6574.302f.31 is the hex code of GigabitEthernet0/1. For the
definition of the media code, refer to the Address Resolution Protocol Parameters section in RFC1700.
This command is used only when the DHCP is defined by manual binding.

Configuration The following example defines the client ID of the Ethernet DHCP client whose MAC address is
Examples 00d0.f822.33b4.
Ruijie(dhcp-config)# client-identifier 0100.d0f8.2233.b467.6967.6162.6974.45
74.6865.726e.6574.302f.31

Related Command Description


Commands hardware-address Defines the hardware address of DHCP client.
Defines the IP address and network mask, which is used to configure the
host
DHCP manual binding.

2-11
Command Reference DHCP Commands

Defines the name of the DHCP address pool and enters the DHCP address
ip dhcp pool
pool configuration mode.

Platform N/A
Description

2.17 client-name

Use this command to define the name of the DHCP client in the DHPC address pool configuration
mode. Use the no or default form of this command to restore the default setting.
client-name client-name
no client-name

Parameter Parameter Description


Description Name of DHCP client, a set of standards-based ASCII
characters. The name should not include the suffix domain
client-name
name. For instance, you can define the name of the DHCP
client as river, not river.i-net.com.cn.

Defaults No client name is defined by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command can be used to define the name of the DHCP client only when the DHCP is defined by
manual binding. This name should not include the suffix domain name.

Configuration The following example defines a string river as the name of the client.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# client-name river

Related Command Description


Commands Defines the IP address and network mask, which is used to
host
configure the DHCP manual binding.
Defines the name of the DHCP address pool and enters the
ip dhcp pool
DHCP address pool configuration mode.

Platform N/A
Description

2.18 default-router

Use this command to define the default gateway of the DHCP client in the DHPC address pool

2-12
Command Reference DHCP Commands

configuration mode. Use the no or default form of this command to restore the default setting.
default-router ip-address [ ip-address2…ip-address8 ]
no default-router

Parameter Parameter Description


Description Defines the IP address of the equipment. It is required to
ip-address
configure one IP address at least.
ip-address2…ip-address8 (Optional) Up to 8 gateways can be configured.

Defaults No gateway is defined by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide In general, the DHCP client should get the information of the default gateway from the DHCP server.
The DHCP server should specify one gateway address for the client at least, and this address should
be of the same network segment as the address assigned to the client.

Configuration The following example defines 192.168.12.1 as the default gateway.


Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# default-router 192.168.12.1

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2.19 dns-server

Use this command to define the DNS server of the DHCP client in the DHPC address pool
configuration mode. Use the no or default form of this command to restore the default setting.
dns-server ip-address [ ip-address2…ip-address8 ]
no dns-server
default dns-server

Parameter Parameter Description


Description Defines the IP address of the DNS server. At least one IP address
ip-address
should be configured.
ip-address2…ip-address8 (Optional) Up to 8 DNS servers can be configured.

Defaults No DNS server is defined by default.

2-13
Command Reference DHCP Commands

Command DHCP address pool configuration mode.


Mode

Usage Guide When more than one DNS server is defined, the former will possess higher priory, so the DHCP client
will select the next DNS server only when its communication with the former DNS server fails.
If the RGOS software also acts as the DHCP client, the DNS server information obtained by the client
can be transmitted to the DHCP client.

Configuration The following example specifies the DNS server 192.168.12.3 for the DHCP client.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# dns-server 192.168.12.3

Related Command Description


Commands domain-name Defines the suffix domain name of the DHCP client.
ip address dhcp Enables the DHCP client on the interface to obtain the IP address information.
Defines the name of the DHCP address pool and enters the DHCP address
ip dhcp pool
pool configuration mode.

Platform N/A
Description

2.20 domain-name

Use this command to define the suffix domain name of the DHCP client in the DHPC address pool
configuration mode. Use the no or default form of this command to restore the default setting.
domain-name domain-name
no domain-name

Parameter Parameter Description


Description domain-name Defines the suffix domain name string of the DHCP client.

Defaults No suffix domain name by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide After the DHCP client obtains specified suffix domain name, it can access a host with the same suffix
domain name by the host name directly.

Configuration The following example defines the suffix domain name i-net.com.cn for the DHCP client.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# domain-name ruijie.com.cn

Related Command Description

2-14
Command Reference DHCP Commands

Commands dns-server Defines the DNS server of the DHCP client.


Defines the name of the DHCP address pool and enter the DHCP address
ip dhcp pool
pool configuration mode.

Platform N/A
Description

2.21 hardware-address

Use this command to define the hardware address of the DHCP client in the DHPC address pool
configuration mode. Use the no or default form of this command to restore the default setting.
hardware-address hardware-address [ type ]
no hardware-address
default hardware-address

Parameter Parameter Description


Description hardware-address Define the MAC address of the DHCP client.
To indicate the hardware platform protocol of the DHCP client, use
the string definition or digits definition.
String option:
Ethernet
type
ieee802
Digits option:
1 (10M Ethernet)
6 (IEEE 802)

Defaults No hardware address is defined by default.


If there is no option when the hardware address is defined, it is the Ethernet by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command can be used only when the DHCP is defined by manual binding.

Configuration The following example defines the MAC address 00d0.f838.bf3d with the type ethernet.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# hardware-address 00d0.f838.bf3d

Related Command Description


Commands Defines the unique ID of the DHCP client (Indicated by the
client-identifier
hexadecimal numeral, separated by dot).
Defines the IP address and network mask, which is used to configure
host
the DHCP manual binding.

2-15
Command Reference DHCP Commands

Defines the name of the DHCP address pool and enter the DHCP
ip dhcp pool
address pool configuration mode.
default-router Defines the default route of the DHCP client.

Platform N/A
Description

2.22 host

Use this command to define the IP address and network mask of the DHCP client host in the DHCP
address pool configuration mode. Use the no or default form of this command to restore the default
setting.
host ip-address [ netmask ]
no host
defaut host

Parameter Parameter Description


Description ip-address Defines the IP address of DHCP client.
netmask Defines the network mask of DHCP client.

Defaults No IP address or network mask of the host is defined.

Command DHCP address pool configuration mode.


Mode

Usage Guide If the network mask is not defined definitely, the DHCP server will use the natural network mask of
this IP address: 255.0.0.0 for class A IP address, 255.255.0 for class B IP address, and
255.255.255.0 for class C IP address.
This command can be used only when the DHCP is defined by manual binding.

Configuration The following example sets the client IP address as 192.168.12.91, and the network mask as
Examples 255.255.255.240.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# host 192.168.12.91 255.255.255.240

Related Command Description


Commands Defines the unique ID of the DHCP client (Indicated in hex and
client-identifier
separated by dot).
hardware-address Defines the hardware address of DHCP client.
Defines the name of the DHCP address pool and enters the
ip dhcp pool
DHCP address pool configuration mode.
default-router Define the default route of the DHCP client.

2-16
Command Reference DHCP Commands

Platform N/A
Description

2.23 ip address dhcp

Use this command to make the Ethernet interface or the PPP, HDLC and FR encapsulated interface
obtain the IP address information by the DHCP in the interface configuration mode. Use the no or
default form of this command to restore the default setting.
ip address dhcp
no ip address dhcp
defaut ip address dhcp

Parameter Parameter Description


Description N/A N/A

Defaults The interface cannot obtain the ID address by the DHCP by default.

Command Interface configuration mode.


Mode

Usage Guide When requesting the IP address, the DHCP client of the RGOS software also requires the DHCP
server provide 5 configuration parameter information: 1) DHCP option 1, client subnet mask, 2)
DHCP option 3, it is the same as the gateway information of the same subnet, 3) DHCP option 6, the
DNS server information, 4) DHCP option 15, the host suffix domain name, and 5) DHCP option 44,
the WINS server information (optional).
The client of the RGOS software is allowed to obtain the address on the PPP, FR or HDL link by the
DHCP, which should be supported by the server. At present, our server can support this function.

Configuration The following example makes the FastEthernet 0 port obtain the IP address automatically.
Examples Ruijie(config)# interface GigabitEthernet 0/1
Ruijie(config-if-GigabitEthernet 0/1) ip address dhcp

Related Command Description


Commands dns-server Defines the DNS server of DHCP client.
Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2.24 ip dhcp add-client

Use this command to configure fixed binding to allocate a fixed IP address based on the access location,

2-17
Command Reference DHCP Commands

host name, or terminal MAC address.


ip dhcp add-client { solidify-ip ip ip-addr { [ access-device dev-addr access-vlan vlanid access-port
portid | host-name hostname | mac mac-addr ] binding-type { ip-hostname | ip-hostname-location |
ip-mac | ip-mac-hostname | ip-mac-hostname-location | ip-mac-location } } | solidify-location ip
ip-addr access-device dev-addr access-vlan vlanid access-port portid | solidify-mac mac mac-addr }

Use the no form of this command to clear fixed binding.


no ip dhcp add-client { solidify-ip ip ip-addr | solidify-location ip ip-addr | solidify-mac mac
mac-addr }

Use the default form of this command to restore the default setting.
default ip dhcp add-client { solidify-ip ip ip-addr | solidify-location ip ip-addr | solidify-mac mac
mac-addr }

Parameter
Parameter Description
Description
Binding type of the fixed address. The address can be bound
binding-type based on the access location, terminal host name, and terminal
MAC address.
ip-addr Fixed IP address to be assigned.
dev-addr IP or MAC address of the access device.
vlanid VLAN ID to which the terminal access port belongs.
portid Number of the terminal access port on the access device.
hostname Host name of the terminal.
mac-addr MAC address of the terminal.

Defaults No fixed binding is configured by default.

Command Global configuration mode


Mode

Default Level 14

Usage Guide This command is used to assign a fixed IP address based on one or more among the specified access
location, host name, and terminal MAC address.
The fixed binding information can also be used for authorization. When the solidify attribute is enabled for
the address pool, only terminals with matching fixed binding information can obtain addresses from the
address pool.
Configuration The following example configures fixed IP address assignment based on the terminal MAC address.
Examples Ruijie(config)# ip dhcp add-client solidify-ip ip 192.168.100.100 mac
00d0.cce2.eefa binding-type ip-mac

Verification Run the show running-config command to display the configuration.

2-18
Command Reference DHCP Commands

Notification When fixed binding fails to be configured because the IP address to be bound is not configured, the
following notification will be displayed:
Failed to set solidify agent(x.x.x.x. type = XX), because of wrong parameter(ip
= 0.0.0.0).

When fixed binding fails to be configured because the terminal MAC address to be bound is not
configured, the following notification will be displayed:
Failed to set solidify agent(H.H.H type = XX),because of wrong parameter(mac =
0000.0000.0000).

When fixed binding is configured for the same terminal again, the following notification will be displayed:
Solidify agent(%s type = %s) ip has been set by other solidify.

When fixed binding fails to be configured because the host name to be bound is not configured, the
following notification will be displayed:
Failed to set solidify agent(%s type = %s), because of wrong parameter (hostname
is NULL).

When fixed binding fails to be configured because the access location to be bound is not configured, the
following notification will be displayed:
Failed to set solidify agent(%s type = %s), because of wrong parameter (acc-dev
ip = 0.0.0.0).
Failed to set solidify agent(%s type = %s), because of wrong parameter (acc-dev
mac = 0000.0000.0000).

When fixed binding fails to be configured because it conflicts with static binding, the following notification
will be displayed:
Solidify agent(%s type = %s) has been set by static(ret = %d).

When fixed binding fails to be configured because it conflicts with dynamic online terminal information,
the following notification will be displayed:
Solidify agent(%s type = %s) has been set by dynamic.

Common
N/A
Errors

Platform
This command is supported only on devices that support external storage.
Description

2.25 ip dhcp class

Use this command to define a CLASS and enter the global CLASS configuration mode. Use the no
form of this command to restore the default setting.

2-19
Command Reference DHCP Commands

ip dhcp class class-name


no ip dhcp class class-name

Parameter Parameter Description


Description class-name Class name, which can be character string or numeric such as myclass or 1.

Defaults By default, the class is not configured.

Command Global configuration mode.


Mode

Usage Guide After executing this command, it enters the global CLASS configuration mode which is shown as
“Ruijie (config-dhcp-class)#”. In this configuration mode, user can configure the Option82 information
that matches the CLASS and the CLASS identification information.

Configuration The following example configures a global CLASS.


Examples Ruijie(config)# ip dhcp class myclass

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.26 ip dhcp excluded-address

Use this command to define some IP addresses and make the DHCP server not assign them to the
DHCP client in the global configuration mode. Use the no form of this command to restore the default
setting.
ip dhcp excluded-address low-ip-address [ high-ip-address ]
no ip dhcp excluded-address low-ip-address [ high-ip-address ]
default ip dhcp excluded-address low-ip-address [ high-ip-address ]

Parameter Parameter Description


Description Excludes the IP address, or excludes the start IP address within the range
low-ip-address
of the IP address.
high-ip-address Excludes the end IP address within the range of the IP address.

Defaults The DHCP server assigns the IP addresses of the whole address pool by default.

Command Global configuration mode.


Mode

Usage Guide If the excluded IP address is not configured, the DHCP server attempts to assign all IP addresses in

2-20
Command Reference DHCP Commands

the DHCP address pool. This command can reserve some IP addresses for specific hosts to prevent
these addresses are assigned to the DHCP client, and define the excluded IP address accurately to
reduce the conflict detecting time when the DHCP server assigns the address.

Configuration In the following example, the DHCP server will not attempt to assign the IP addresses within
Examples 192.168.12.100~150.
Ruijie(config)# ip dhcp excluded-address 192.168.12.100 192.168.12.150

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.
Defines the network number and network mask of the DHCP address
network (DHCP)
pool.

Platform N/A
Description

2.27 ip dhcp force-send-nak

Use this command to configure the forcible NAK packet sending function. Use the no or default form
of this command to restore the default setting.
ip dhcp force-send-nak
no ip dhcp force-send-nak
default ip dhcp force-send-nak

Parameter Parameter Description


Description N/A N/A

Defaults This function is disabled by default.

Command Global configuration mode.


Mode

Usage Guide The DHCP client checks the previously used IP address every time it is started and sends a
DHCPREQUEST packet to continue leasing this IP address. If the address is not available, the DHCP
server sends an NAK packet to let the client resend a DHCPDISCOVER packet to apply for a new IP
address. If no corresponding lease record can be found on the server, the client keeps sending
DHCPDISCOVER packets. The forcible NAK packet sending function is added to shorten the interval
at which the client sends DHCPDISCOVER packets.

Configuration The following example enables the forcible NAK packet sending function in global configuration
Examples mode.
Ruijie(config)# ip dhcp force-send-nak

2-21
Command Reference DHCP Commands

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.28 ip dhcp monitor-vrrp-state

Use this command in layer-3 configuration mode to enable the DHCP Server to monitor the status of
VRRP interfaces so that the DHCP Server processes only those packets sent from a VRRP interface
in the Master state. Use the no or default form of this command to restore the default setting. If it is
canceled, the DHCP Server processes packets from VRRP interfaces in the Master or Backup state.
ip dhcp monitor-vrrp-state
no ip dhcp monitor-vrrp-state
default ip dhcp monitor-vrrp-state

Parameter Parameter Description


Description N/A N/A

Defaults The ip dhcp monitor-vrrp-state command is disabled by default. .

Command Layer-3 interface configuration mode.


Mode

Usage Guide If a VRRP address is configured for an interface, the DHCP Server processes packets sent from the
master interface and discards packets sent from the backup interface. If no VRRP address is
configured, the DHCP Server does not monitor the status of VRRP interfaces. All DHCP packets will
be processed.

Configuration The following example enables the DHCP Server to monitor the status of VRRP interfaces.
Examples Ruijie(config)# interface gigabitethernet 0/1
Ruijie(config-if-GigabitEthernet 0/1)# ip dhcp monitor-vrrp-state

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.29 ip dhcp ping packets

Use this command to configure the times of pinging the IP address when the DHCP server detects

2-22
Command Reference DHCP Commands

address conflict in the global configuration mode. Use the no or default form of this command to
restore the default setting.
ip dhcp ping packets [ number ]
no ip dhcp ping packets
default ip dhcp ping packets

Parameter Parameter Description


Description (Optional) Number of packets in the range of 0 to 10, where 0 indicates disabling
number
the ping operation. The Ping operation sends two packets by default.

Defaults The Ping operation sends two packets by default.

Command Global configuration mode.


Mode

Usage Guide When the DHCP server attempts to assign the IP address from the DHCP address pool, use the ping
operation to check whether this address is occupied by other hosts. Record it if the address is
occupied, otherwise, assign it to the DHCP client. The Ping operation will send up to 10 packets, two
packets by default.

Configuration The following example sets the number of the packets sent by the ping operation as 3.
Examples Ruijie(config)# ip dhcp ping packets 3

Related Command Description


Commands clear ip dhcp conflict Clears the DHCP history conflict record.
Configures the timeout time that the DHCP server waits for the Ping
response. If all the ping packets are not responded within the
ip dhcp ping packet
specified time, it indicates that this IP address can be assigned.
Otherwise, it will record the address conflict.
Displays the DHCP server detects address conflict when it assigns
show ip dhcp conflict
an IP address.

Platform N/A
Description

2.30 ip dhcp ping timeout

Use this command to configure the timeout that the DHCP server waits for response when it uses the
ping operation to detect the address conflict in the global configuration mode. Use the no or default
form of this command to restore the default setting.
ip dhcp ping timeout milli-seconds
no ip dhcp ping timeout
default ip dhcp ping timeout

2-23
Command Reference DHCP Commands

Parameter Parameter Description


Description Time that the DHCP server waits for ping response in the range 100
milli-seconds
to 10000 milliseconds.

Defaults The default is 500 milliseconds.

Command Global configuration mode.


Mode

Usage Guide This command defines the time that the DHCP server waits for a ping response packet.

Configuration The following example configures the waiting time of the ping response packet to 600ms.
Examples Ruijie(config)# ip dhcp ping timeout 600

Related Command Description


Commands clear ip dhcp conflict Clears the DHCP history conflict record.
Defines the number of the data packets sent by the ping operation for
ip dhcp ping packets the detection of the address conflict when the DHCP server assigns
an IP address.
Displays the address conflict the DHCP server detects when it
show ip dhcp conflict
assigns an IP address.

Platform N/A
Description

2.31 ip dhcp pool

Use this command to define a name of the DHCP address pool and enter the DHCP address pool
configuration mode in the global configuration mode. Use the no or default form of this command to
restore the default setting.
ip dhcp pool pool-name [ set-real-pool rpool-name | unset-real-pool ]
no ip dhcp pool pool-name
default ip dhcp pool pool-name

Parameter Parameter Description


Description pool-name A string of characters and positive integers, for instance, mypool or 1.
rpool-name Indicates the address name for physical devices.

Defaults No DHCP address pool is defined by default.

Command Global configuration mode.


Mode

2-24
Command Reference DHCP Commands

Usage Guide Execute the command to enter the DHCP address pool configuration mode:
Ruijie(dhcp-config)#
In this configuration mode, configure the IP address range, the DNS server and the default gateway.

Configuration The following example defines a DHCP address pool named mypool0.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)#

Related
Command Description
Commands
Defines the IP address and network mask, which is used to configure
host
the DHCP manual binding.
Defines the IP addresses that the DHCP server cannot assign to the
ip dhcp excluded-address
clients.
Defines the network number and network mask of the DHCP address
network (DHCP)
pool.

Platform N/A
Description

2.32 ip dhcp refresh arp

Use this command to refreshes the trusted ARP allocation.


ip dhcp refresh arp

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Global configuration mode


Mode

Usage Guide N/A

Configuration The following example refreshes the trusted ARP allocation.


Examples Ruijie(config)#ip dhcp refresh arp

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-25
Command Reference DHCP Commands

2.33 ip dhcp relay check server-id

Use this command to enable the ip dhcp relay check server-id function. Use the no form of this
command to restore the default setting.
ip dhcp relay check server-id
no ip dhcp relay check server-id

Parameter Parameter Description


Description N/A N/A

Defaults The ip dhcp relay check server-id command is disabled.

Command Global configuration mode.


Mode

Usage Guide This command is configured on a DHCP relay agent.


In a DHCP relay application environment, multiple DHCP servers are configured for each network
device to provide server backup, thereby ensuring normal network operation. When a DHCP client
has selected a DHCP server to send a DHCP REQUEST packet, a Server-ID option is carried in the
packet. To reduce server load in specific environments, enable the Server-ID check function on the
DHCP relay agent, so as to send the DHCP REQUEST packet to a DHCP server specified in this
option.
In this case, the DHCP relay agent sends DHCP request packets only to the specified server. If this
function is not configured, the DHCP relay agent sends DHCP request packets to all configured
DHCP servers.

Configuration The following example enables the ip dhcp relay check server-id function.
Examples Ruijie# configure terminal
Ruijie(config)# ip dhcp relay check server-id

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.34 ip dhcp relay information option82

Use this command to enable the ip dhcp relay information option82 function. Use the no form of
this command to restore the default setting.
ip dhcp relay information option82
no ip dhcp relay information option82

2-26
Command Reference DHCP Commands

Parameter Parameter Description


Description N/A N/A

Defaults The ip dhcp relay information option82 command is disabled.

Command Global configuration mode.


Mode

Usage Guide This command is configured on a DHCP relay agent.


When this function is enabled and the device serves as a DHCP relay agent, the device adds Option
82 to a DHCP request packet to be forwarded to a DHCP server. The encapsulation format of Circuit
ID is "slot(1):port(1):dev_name(<=64)" and that of Remote ID is
"user_mac(6):iftype(1):port_name(<=64):vid(2)".

Configuration The following example enables the option82 function on the DHCP relay.
Examples Ruijie# configure terminal
Ruijie(config)# ip dhcp relay information option82

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.35 ip dhcp server detect

Use this command to enable the fake DHCP server detection. Use the no or default form of this
command to restore the default setting.
ip dhcp server detect
no ip dhcp server detect
default ip dhcp server detect

Parameter Parameter Description


Description N/A N/A

Defaults This function is disabled by default.

Command Global configuration mode


Mode

Usage Guide After this function is enabled, any fake DHCP server detected is logged.

Configuration The following example enables the fake DHCP server detection.
Examples Ruijie(config)# ip dhcp server detect

2-27
Command Reference DHCP Commands

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.36 ip dhcp sort-pool

Use this command to configure the authorization inheritance mode in authorization mode.
ip dhcp sort-pool { cloud-office { check { location | mac | mac-location } | enable } | relate-oui mac-str }

Use the no form of this command to cancel the configuration.


no ip dhcp sort-pool { cloud-office { check { location | mac | mac-location } | enable } | relate-oui
mac-str }

Use the default form of this command to restore the default setting.
defaut ip dhcp sort-pool { cloud-office { check { location | mac | mac-location } | enable } | relate-oui
mac-str }

Parameter
Parameter Description
Description
cloud-office Enables the authorization inheritance mode.
Specifies the authorization inheritance mode option, including access
check location inheritance, MAC address inheritance, and access
location+MAC address inheritance.
Specifies MAC-OUI information associated with global address pools,
relate-oui
that is, the first 3 bytes of the MAC address.

Defaults The authorization inheritance mode is disabled by default.

Command Global configuration mode


Mode

Default Level 14

Usage Guide The authorization inheritance mode is used in a cloud office scenario where the solidify attribute is enabled
for the address pool for authorization. When the VM of a cloud terminal goes online and requests address
assignment, it inherits the authorization result of the fixed binding of the physical machine, and no additional
authorization is required to obtain an address. Select an authorization inheritance mode option based on the
application scenario:
MAC address inheritance: The last 3 bytes of the VM MAC address is the same as that of the physical
machine.
Access location inheritance: The access locations of the VM and physical machine of the cloud terminal are

2-28
Command Reference DHCP Commands

the same.
MAC-OUI information associated with address pools: Different IP address segments need to be assigned to
the VM and physical machine of a cloud terminal based on the first 3 bytes of the MAC addresses. The global
MAC-OUI configuration takes effect for all the address pools that are not associated with MAC-OUI
information in address pool mode. The priority of address pool MAC-OUI configuration is higher than that of
the global MAC-OUI configuration. When the MAC-OUI information of a terminal matches the global
MAC-OUI configuration, it can obtain an address from any address pools that are not associated with
MAC-OUI information in address pool mode.

Configuration The following example configures the authentication inheritance mode in global configuration mode.
Examples Ruijie(config)# ip dhcp sort-pool cloud-office enable
Ruijie(config)# ip dhcp sort-pool relate-oui edfa25

Verification Run the show run command to display the configuration.

Notification When the length or characters of the relay-oui parameter are invalid and the first 3 bytes of the MAC address
should be set, the following notification will be displayed:
1. The length of oui string is invalid.
2. The character of oui string is invalid.

When the total number of MAC-OUI information associations configured in the global or address pool
configuration mode exceeds the upper limit, the following notification will be displayed:
3. The number of global relate oui has reached the maximum.
4. The number of pool's relate oui has reached the maximum.

Common
N/A
Errors

Platform
This command is supported only on devices that support external storage.
Description

2.37 ip dhcp syslog enable

Use this command to enable the configuration for sending the information on IP addresses assigned by the
DHCP server to the syslog server. Use the no form of this command to disable this function.
ip dhcp syslog enable
no ip dhcp syslog enable

Parameter
Parameter Description
Description
N/A N/A

Defaults By default, information on IP addresses assigned by the DHCP server is not sent to the syslog server.

2-29
Command Reference DHCP Commands

Command
Global configuration mode
Mode

Usage Guide This command is configured on a DHCP server.

Configuration The following example enables the configuration for sending the information on terminal IP addresses
Examples assigned by the DHCP server to the syslog server.
Ruijie(config)# ip dhcp syslog enable

Verification Run the show running-config command to display the configuration.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

2.38 ip dhcp use class

Use this command to enable the CLASS to allocate addresses in the global configuration mode. Use
the no form of this command can be used to disable the CLASS.
ip dhcp use class
no ip dhcp use class

Parameter Parameter Description


Description N/A N/A

Defaults Enabled

Command This function is enabled by defualt.


Mode

Usage Guide This command is configured on a DHCP server.

Configuration The following example enables the CLASS to allocate addresses.


Examples Ruijie(config)# ip dhcp use class

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-30
Command Reference DHCP Commands

2.39 ip helper-address

Use this command to add an IP address of the DHCP server. Use the no form of this command to
delete an IP address of the DHCP server.
The server address can be configured globally or on a specific interface. Therefore, this command
can run in the global configuration mode or the interface configuration mode to add the DHCP server
information.
ip helper-address { cycle-mode | A.B.C.D }
no ip helper-address { cycle-mode | A.B.C.D }

Parameter Parameter Description


Description cycle-mode Forwards the DHCP request packets to all DHCP servers.
A.B.C.D DHCP server IP address

Defaults N/A

Command Global configuration mode, interface configuration mode.


Mode

Usage Guide This command is configured on a DHCP relay agent.


After a DHCP server IP address is configured, the DHCP relay agent forwards DHCP request packets
to a DHCP server and DHCP reply packets to DHCP clients.
The DHCP server address can be globally configured or configured on an L3 interface. A maximum of
20 DHCP server addresses can be globally configured or configured on each L3 interface. When an
interface receives a DHCP request packet, the DHCP server list on the interface prevails over that
configured globally. If the interface is not configured with the DHCP server list, the global DHCP
server list takes effect.
In global configuration mode, the cycle-mode parameter of the DHCP relay agent can be configured.
If cycle-mode is configured, the DHCP relay agent forwards packets from DHCP clients to all DHCP
servers. If cycle-mode is not configured, the DHCP relay agent forwards packets from DHCP clients
only to the first DHCP server meeting the preceding rules. cycle-mode is configured only in global
configuration mode but takes effect in both global and interface configuration modes. cycle-mode is
configured by default.

Configuration The following example sets the IP address for the global server to 192.168.1.1
Examples Ruijie# configure terminal
Ruijie(config)# ip helper-address 192.168.1.1

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-31
Command Reference DHCP Commands

2.40 lease

Use this command to define the lease time of the IP address that the DHCP server assigns to the
client in the DHCP address pool configuration mode. Use the no form of this command to restore the
default setting. A limited lease time ranges from 1 minute to 23 hours and 59 minutes.
lease { days [ hours ] [ minutes ] | infinite }
no lease

Parameter Parameter Description


Description days Lease time in days
(Optional) Lease time in hours. It is necessary to define the days
hours
before defining the hours.
(Optional) Lease time in minutes. It is necessary to define the days
minutes
and hours before defining the minutes.
infinite Infinite lease time.

Defaults This command is configured on a DHCP server. The lease time for a static address pool is infinite.
The lease time for other address pools is 1 day.

Command DHCP address pool configuration mode.


Mode

Usage Guide When the lease is getting near to expire, the DHCP client will send the request of renewal of lease. In
general, the DHCP server will allow the renewal of lease of the original IP address.

Configuration The following example sets the DHCP lease to 1 hour.


Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# lease 0 1

The following example sets the DHCP lease to 1 minute.


Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# lease 0 0 1

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2-32
Command Reference DHCP Commands

2.41 lease-threshold

Use this command in DHCP address pool configuration mode to define the DHCP alarm threshold.
Use the default or no form of this command to restore the default setting.
lease-threshold percentage
default lease-threshold
no lease-threshold

Parameter Parameter Description


Description percentage Usage of the address pool, ranging from 60 to 100 in percentage.

Defaults 90

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. If the maximum IP usage of the address pool
reaches the threshold, the DHCP Server generates a SYSLOG alarm. The IP usage indicates the
ratio of the number of assigned address pools to the total number of assignable address pools. If the
number of assigned pools stays above the alarm threshold, an alarm is generated every 5 minutes.

Configuration The following example sets the alarm threshold to 80%.


Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# lease-threshold 80
The following example restores the default alarm threshold.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# default lease-threshold
The following example disables the address pool alarm function.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# no lease-threshold

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2-33
Command Reference DHCP Commands

2.42 netbios-name-server

Use this command to configure the WINS name server of the Microsoft DHCP client NETBIOS in the
DHCP address pool configuration mode. The no or default form of this command can be used to
restore the default setting.
netbios-name-server ip-address [ ip-address2…ip-address8 ]
no netbios-name-server
defaut netbios-name-server

Parameter Parameter Description


Description IP address of the WINS server. It is required to configure one IP
ip-address
address at least.
(Optional) IP addresses of WINS servers. Up to 8 WINS servers can
ip-address2…ip-address8
be configured.

Defaults No WINS server is defined by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. When more than one WINS server is defined, the
former has higher priory. The DHCP client will select the next WINS server only when its
communication with the former WINS server fails.

Configuration The following example specifies the WINS server 192.168.12.3 for the DHCP client.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# netbios-name-server 192.168.12.3

Related Command Description


Commands ip address dhcp Enables the DHCP client on the interface to obtain the IP address.
Defines the name of the DHCP address pool and enter the DHCP
ip dhcp pool
address pool configuration mode.
netbios-node-type Defines the netbios node type of the client host.

Platform N/A
Description

2.43 netbios-node-type

Use this command to define the node type of the master NetBIOS of the Microsoft DHCP client in the
DHCP address configuration mode. Use the no or default form of this command to restore the default
setting.
netbios-node-type type

2-34
Command Reference DHCP Commands

no netbios-node-type
defaut netbios-node-type

Parameter Parameter Description


Description Type of node in two modes:
Digit in hexadecimal form in the range of 0 to FF. Only the following
numerals are available:
1: b-node.
2: p-node.
4: m-node.
type
8: h-node.
String:
b-node: broadcast node
p-node: peer-to-peer node
m-node: mixed node
h-node: hybrid node

Defaults No type of the NetBIOS node is defined by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. There are 4 types of the NetBIOS nodes of the
Microsoft DHCP client:
1) Broadcast, which carries out the NetBIOS name resolution by the broadcast method.
2) Peer-to-peer, which directly requests the WINS server to carry out the NetBIOS name resolution.
3) Mixed, which requests the name resolution by the broadcast method firstly, and then carry out
the name resolution by the WINS server connection.
4) Hybrid, which requests the WINS server to carry out the NetBIOS name resolution firstly, and it
will carry out the NetBIOS name resolution by the broadcast method if the response is not
received.
By default, the node type for Microsoft operating system is broadcast or hybrid. If the WINS server is
not configured, broadcast node is used. Otherwise, hybrid node is used. It is recommended to set the
type of the NetBIOS node as Hybrid.

Configuration The following example sets the NetBIOS node of Microsoft DHCP client as Hybrid.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# netbios-node-type h-node

Related Command Description


Commands Defines the name of DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.
Configures the WINS name server of the Microsoft DHCP client
netbios-name-server
NETBIOS.

2-35
Command Reference DHCP Commands

Platform N/A
Description

2.44 network (DHCP)

Use this command to define the network number and network mask of the DHCP address pool in the
DHCP address pool configuration mode. Use the no or default form of this command to restore the
default setting.
network net-number net-mask [ low-ip-address high-ip-address ]
no network
defaut network

Parameter Parameter Description


Description net-number Network number of the DHCP address pool
Network mask of the DHCP address pool. If the network mask is not
net-mask
defined, the natural network mask will be used by default.
low-ip-address The first applicable IP address.
high-ip-address The last applicable IP address.

Defaults No network number or network mask is defined by default.

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. This command defines the subnet and subnet mask
of a DHCP address pool, and provides the DHCP server with an address space which can be
assigned to the clients. Unless excluded addresses are configured, all the addresses of the DHCP
address pool can be assigned to the clients. The DHCP server assigns the addresses in the address
pool orderly. If the DHCP server found an IP address is in the DHCP binding table or in the network
segment, it checks the next until it assigns an effective IP address.
The show ip dhcp binding command can be used to view the address assignment, and the show ip
dhcp conflict command can be used to view the address conflict detection configuration.

Configuration The following example defines the network number of the DHCP address pool as 192.168.12.0, and
Examples the network mask as 255.255.255.240.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# network 192.168.12.0 255.255.255.240

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A

2-36
Command Reference DHCP Commands

Description

2.45 next-server

Use this command to define the startup sever list that the DHCP client accesses during startup in the
DHCP address configuration mode. Use the no or default form of this command to restore the default
setting.
next-server ip-address [ ip-address2…ip-address8 ]
no next-server
default next-server

Parameter Parameter Description


Description Defines the IP address of the startup server, which is usually the
ip-address
TFTP server. It is required to configure one IP address at least.
ip-address2…ip-address8 (Optional) Up to 8 startup servers can be configured.

Defaults N/A

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. When more than one startup server is defined, the
former will possess higher priory. The DHCP client will select the next startup server only when its
communication with the former startup server fails.

Configuration The following example specifies the startup server 192.168.12.4 for the DHCP client.
Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# next-server 192.168.12.4

Related Command Description


Commands bootfile Defines the default startup mapping file name of the DHCP client.
Defines the name of the DHCP address pool and enter the DHCP
ip dhcp pool
address pool configuration mode.
ip helper-address Defines the Helper address on the interface.
option Configures the option of the RGOS software DHCP server.

Platform N/A
Description

2.46 option

Use this command to configure the option of the DHCP server in the DHCP address pool
configuration mode. Use the no form of this command to restore the default setting.

2-37
Command Reference DHCP Commands

option code { ascii string | hex string | ip ip-address }


no option

Parameter
Parameter Description
Description
code Defines the DHCP option codes.
ascii string Defines an ASCII string.
hex string Defines a hex string.
ip ip-address Defines an IP address list.

Defaults N/A

Command DHCP address pool configuration mode.


Mode

Usage Guide This command is configured on a DHCP server. The DHCP provides a mechanism to transmit the
configuration information to the host in the TCP/IP network. The DHCP message has a variable
option field that can be defined according to the actual requirement. The DHCP client needs to carry
the DHCP message with 32 bytes of option information at least. Furthermore, the fixed data field in
the DHCP message is also referred to as an option. For the definition of current DHCP option, refer to
RFC 2131.

Configuration The following example defines the option code 19, which determines whether the DHCP client can
Examples enable the IP packet forwarding. 0 indicates to disable the IP packet forwarding, and 1 indicates to
enable the IP packet forwarding. The configuration below enables the IP packet forwarding on the
DHCP client.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# option 19 hex 1

The following example defines the option code 33, which provides the DHCP client with the static
route information. The DHCP client will install two static routes: 1) the destination network
172.16.12.0 and the gateway 192.168.12.12, 2) the destination network 172.16.16.0 and the gateway
192.168.12.16.
Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# option 33 ip 172.16.12.0 192.168.12.12 172.16.16.0
192.168.12.16

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2-38
Command Reference DHCP Commands

2.47 pool-status

Use this command to enable or disable the DHCP address pool.


pool-status { enable | disable }

Parameter Parameter Description


Description enable Enables the address pool.
disable Disables the address pool.

Defaults By default, the address pool is enabled after it is configured.

Command DHCP address pool configuration mode


Mode

Usage Guide This command is configured on a DHCP server. This command is configured on the DHCP server.

Configuration The following example disables the address pool.


Examples Ruijie(config)# ip dhcp pool mypool0
Ruijie(dhcp-config)# pool-status disable

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.48 relay agent information

Use this command to enter the Option82 matching information configuration mode in the global
CLASS configuration mode. Use the no form of this command to delete the Option82 matching
information of the CLASS.
relay agent information
no relay agent information

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Global CLASS configuration mode


Mode

Usage Guide This command is configured on a DHCP server. After executing this command, it enters the Option82

2-39
Command Reference DHCP Commands

matching information configuration mode which is shown as “Ruijie (config-dhcp-class-relayinfo)#”.


In this configuration mode, user can configure the class matching multiple Option82 information.

Configuration The following example configures a global CLASS and enters the Option82 matching information
Examples configuration mode.
Ruijie(config)# ip dhcp class myclass
Ruijie(config-dhcp-class)# relay agent information
Ruijie(config-dhcp-class-relayinfo)#

Related Command Description


Commands ip dhcp class Defines a CLASS and enters the global CLASS configuration mode.

Platform N/A
Description

2.49 relay-information hex

Use this command to enter the Option82 matching information configuration mode. Use the no form
of this command to delete a piece of matching information.
relay-information hex aabb.ccdd.eeff… [ * ]
no relay-information hex aabb.ccdd.eeff… [ * ]

Parameter Parameter Description


Description Hexadecimal Option82 matching information. The ‘*’ symbol means partial
aabb.ccdd.eeff…[*] matching which needs the front part matching only. Without the ‘*’ means
needing full matching.

Defaults N/A

Command Global CLASS configuration mode


Mode

Usage Guide This command is configured on a DHCP server.

Configuration The following example configures a global CLASS which can match multiple Option82 information.
Examples Ruijie(config)# ip dhcp class myclass
Ruijie(config-dhcp-class)# relay agent information
Ruijie(config-dhcp-class-relayinfo)# relay-information
hex 0102256535
Ruijie(config-dhcp-class-relayinfo)# relay-information
hex 010225654565
Ruijie(config-dhcp-class-relayinfo)# relay-information
hex 060225654565
Ruijie(config-dhcp-class-relayinfo)# relay-information

2-40
Command Reference DHCP Commands

hex 060223*

Related Command Description


Commands ip dhcp class Defines a CLASS and enter the global CLASS configuration mode.
relay agent information Enters the Option82 matching information configuration mode.

Platform N/A
Description

2.50 relate-oui

Use this command to set MAC-OUI information for address segment assignment based on the first 3
bytes of the terminal MAC address. (Use the host command to configure the range of address
segments.)
relate-oui mac-oui

Use the no form of this command to disassociate the MAC-OUI information from the address pool.
no relate-oui mac-oui

Parameter
Parameter Description
Description
mac-oui The first 3 bytes of the terminal MAC address.

Defaults No MAC-OUI information is associated with the address pool by default.

Command DHCP address pool configuration mode


Mode

Default Level 14

Usage Guide This command is used to assign different IP address segments to the VM and physical machine of a
cloud terminal based on the first 3 bytes of the MAC addresses. After MAC-OUI information is associated
with the address pool, only terminals with matched MAC-OUI information are assigned with addresses.

Configuration The following example associates the MAC-OUI information with the address pool test.
Examples Ruijie(config)# ip dhcp pool test
Ruijie(dhcp-config)# relate-oui ddcae2

Verification Run the show running-config command to display the configuration.

Notification When the length or characters of the relay-oui parameter are invalid and the first 3 bytes of the MAC
address should be set, the following notification will be displayed:
1. The length of oui string is invalid.
2. The character of oui string is invalid.

2-41
Command Reference DHCP Commands

Common The configured characters of the MAC address are invalid.


Errors The configured MAC address characteristic is too long.
The number of configured MAC-OUI information items exceeds the upper limit.

2.51 remark

Use this command to configure the identification which is used to describe the CLASS in this global
CLASS configuration mode. Use the no form of this command to delete the identification.
remark class-remark
no remark

Parameter Parameter Description


Description Information used to identify the CLASS, which can be the character
class-remark
strings with space in them.

Defaults N/A.

Command Global CLASS configuration mode.


Mode

Usage Guide This command is configured on a DHCP server.

Configuration The following example configures the identification information for a global CLASS.
Examples Ruijie(config)# ip dhcp class myclass
Ruijie(config-dhcp-class)# remark used in #1 build

Related Command Description


Commands ip dhcp class Defines a CLASS and enter the global CLASS configuration mode.

Platform N/A
Description

2.52 service dhcp

Use this command to enable the DHCP server and the DHCP relay on the device in global
configuration mode.
To enable the DHCP server and the DHCP relay on fit APs, run the service dhcp command in the
ap-config or ap-group mode of the AC.
Use the no or default form of this command to restore the default setting.
service dhcp
no service dhcp
default service dhcp

2-42
Command Reference DHCP Commands

Parameter Parameter Description


Description N/A N/A

Defaults The service dhcp command is disabled.

Command Global configuration mode/AP configuration mode/AP group configuration mode


Mode

Usage Guide The DHCP server can assign the IP addresses to the clients automatically, and provide them with the
network configuration information such as DNS server and default gateway. The DHCP relay can
forward the DHCP requests to other servers, and the returned DHCP responses to the DHCP client,
serving as the relay for DHCP packets.

Configuration The following example enables the DHCP server and the DHCP relay feature.
Examples service dhcp

Related Command Description


Commands show ip dhcp server statistics Displays various statistics information of the DHCP server.

Platform N/A
Description

2.53 show dhcp lease

Use this command to display the lease information of the IP address obtained by the DHCP client.
show dhcp lease

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode.


Mode

Usage Guide If the IP address is not defined, display the binding condition of all addresses. If the IP address is
defined, display the binding condition of this IP address.

Configuration The following example displays the result of the show dhcp lease.
Examples Ruijie# show dhcp lease
Temp IP addr: 192.168.5.71 for peer on Interface: FastEthernet0/0
Temp sub net mask: 255.255.255.0
DHCP Lease server: 192.168.5.70, state: 3 Bound

2-43
Command Reference DHCP Commands

DHCP transaction id: 168F


Lease: 600 secs, Renewal: 300 secs, Rebind: 525 secs
Temp default-gateway addr: 192.168.5.1
Next timer fires after: 00:04:29
Retry count: 0 Client-ID: redgaint-00d0.f8fb.5740-Fa0/0

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.54 show ip dhcp binding

Use this command to display the binding condition of the DHCP address.
show ip dhcp binding [ ip-address ]

Parameter Parameter Description


Description ip-address (Optional) Only displays the binding condition of the specified IP addresses.

Defaults N/A

Command Privileged EXEC mode.


Mode

Usage Guide If the IP address is not defined, show the binding condition of all addresses. If the IP address is
defined, show the binding condition of this IP address

Configuration The following is the result of the show ip dhcp binding.


Examples Ruijie# show ip dhcp binding
Total number of clients : 4
Expired clients : 3
Running clients : 1

IP address Hardware address Lease expiration Type


20.1.1.1 2000.0000.2011 000 days 23 hours 59 mins Automatic

The meaning of various fields in the show result is described as follows.


Field Description

IP address The IP address to be assigned to the DHCP client.

Client-Identifier
The client identifier or hardware address of the DHCP client.
/Hardware address

2-44
Command Reference DHCP Commands

The expiration date of the lease. The Infinite indicates it is not


limited by the time. The IDLE indicates the address is in the free
Lease expiration
status currently for it is not renewed or the DHCP client releases
it actively.

The type of the address binding. The Automatic indicates an IP


Type address is assigned automatically, and the Manual indicates an
IP address is assigned by manual.

Related Command Description


Commands clear ip dhcp binding Clears the DHCP address binding table.

Platform N/A
Description

2.55 show ip dhcp conflict

Use this command to show the conflict history record of the DHCP sever.
show ip dhcp conflict

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode.


Mode

Usage Guide This command can display the conflict address list detected by the DHCP server.

Configuration The following example displays the output result of the show ip dhcp conflict command.
Examples Ruijie# show ip dhcp conflict
IP address Detection Method
192.168.12.1 Ping

The meaning of various fields in the show result is described as follows.

Field Description

IP address The IP addresses which cannot be assigned to the DHCP client.

Detection Method The conflict detection method.

Related Command Description


Commands clear ip dhcp conflict Clears the DHCP conflict record.

2-45
Command Reference DHCP Commands

Platform N/A
Description

2.56 show ip dhcp database table-name

Use this command to display the total number of assignment records stored in the DHCP database.
show ip dhcp database table-name [ table-name ] item-count

Use this command to display the record details in the DHCP database.
show ip dhcp database table-name [ table-name ] item-limit [ limit-num ] item-offset [ offset-num ]

Use this command to filter the record details in the DHCP database to be displayed.
show ip dhcp database table-name [ table-name ] field-name [ field-name ] { equal | less-than |
more-than } [ field-value ] item-limit [ limit-num ] item-offset [ offset-num ]

Parameter
Parameter Description
Description
table-name Name of the database table.
Maximum number of records displayed in the database query result. The
limit-num
range is from 0 to 1000.
offset-num Item offset in the queried database table. The range is from 0 to 1000000.
field-name Field name in the database table.
field-value Field value in the database table.

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide Currently, the database table name of DHCP assignment records is server_dist_rec, and the upper limit of
item-limit is 1000.
To query database records based on the timestamp, you need to convert a string date into an integer first.
For example, to query the log record at 2023-01-05 02:22:27 on a Linux platform, run the date -d
"2023-01-05 02:22:27" "+%s" command to convert the date into 1672856547 first.

Configuration The following example displays the total number of assignment records stored in the DHCP database.
Examples Ruijie# show ip dhcp database table-name server_dist_rec item-count
[server_dist_rec] table has 25 record
The following example displays the top 10 assignment records in the DHCP database.
Ruijie# show ip dhcp database table-name server_dist_rec item-limit 10 item-offset
0
mac ip timestamp

2-46
Command Reference DHCP Commands

------------ ------------ ---------


00e0.4c36.0d2e 192.168.2.17 2023-01-04 10:43:19
300d.9e3b.7eb0 192.168.1.17 2023-01-04 14:17:15
5254.003b.7eb0 192.168.1.18 2023-01-04 14:17:17
5254.003b.7eb0 192.168.1.18 2023-01-04 14:20:38
0800.2793.af3a 192.168.1.19 2023-01-04 14:24:24
0800.2793.af3a 192.168.1.19 2023-01-04 14:26:07
5254.003b.7eb0 192.168.1.18 2023-01-04 14:37:36
0800.2793.af3a 192.168.1.19 2023-01-04 15:19:07
0800.2793.af3a 192.168.1.19 2023-01-04 15:20:39
300d.9e3b.7eb0 192.168.1.17 2023-01-04 17:31:16
The following example displays the 10 assignment records in the DHCP database with an offset of 10 items.
Ruijie# show ip dhcp database table-name server_dist_rec item-limit 10 item-offset
10
mac ip timestamp
------------ ------------ ---------
300d.9e3b.7eb0 192.168.1.17 2023-01-04 18:22:27
300d.9e3b.7eb0 192.168.1.17 2023-01-04 18:22:28
5254.003b.7eb0 192.168.1.18 2023-01-04 18:22:28
300d.9e3b.7eb0 192.168.1.17 2023-01-04 21:47:18
300d.9e3b.7eb0 192.168.1.17 2023-01-04 21:57:06
5254.003b.7eb0 192.168.1.18 2023-01-04 22:22:28
300d.9e3b.7eb0 192.168.1.17 2023-01-05 01:02:49
300d.9e3b.7eb0 192.168.1.17 2023-01-05 01:15:46
5254.003b.7eb0 192.168.1.18 2023-01-05 02:22:27
300d.9e3b.7eb0 192.168.1.17 2023-01-05 04:18:38
The following example displays the assignment records of the IP address 192.168.1.18 in the DHCP
database.
Ruijie# show ip dhcp database table-name server_dist_rec field-name ip equal
192.168.1.18 item-limit 10 item-offset 0
mac ip timestamp
------------ ------------ ---------
5254.003b.7eb0 192.168.1.18 2023-01-04 14:17:17
5254.003b.7eb0 192.168.1.18 2023-01-04 14:20:38
5254.003b.7eb0 192.168.1.18 2023-01-04 14:37:36
5254.003b.7eb0 192.168.1.18 2023-01-04 18:22:28
5254.003b.7eb0 192.168.1.18 2023-01-04 22:22:28
5254.003b.7eb0 192.168.1.18 2023-01-05 02:22:27
5254.003b.7eb0 192.168.1.18 2023-01-05 06:22:28
5254.003b.7eb0 192.168.1.18 2023-01-05 10:22:27
The following example displays the assignment records generated earlier than 2023-01-05 02:22:27 in the
DHCP database.
Ruijie# show ip dhcp database table-name server_dist_rec field-name timestamp
less-than 1672856547 item-limit 10 item-offset 0

2-47
Command Reference DHCP Commands

mac ip timestamp
------------ ------------ ---------
00e0.4c36.0d2e 192.168.2.17 2023-01-04 10:43:19
300d.9e3b.7eb0 192.168.1.17 2023-01-04 14:17:15
5254.003b.7eb0 192.168.1.18 2023-01-04 14:17:17
5254.003b.7eb0 192.168.1.18 2023-01-04 14:20:38
0800.2793.af3a 192.168.1.19 2023-01-04 14:24:24
0800.2793.af3a 192.168.1.19 2023-01-04 14:26:07
5254.003b.7eb0 192.168.1.18 2023-01-04 14:37:36
0800.2793.af3a 192.168.1.19 2023-01-04 15:19:07
0800.2793.af3a 192.168.1.19 2023-01-04 15:20:39
300d.9e3b.7eb0 192.168.1.17 2023-01-04 17:31:16
The following example displays the assignment records generated later than 2023-01-05 02:22:27 in the
DHCP database.
Ruijie# show ip dhcp database table-name server_dist_rec field-name timestamp
more-than 1672856547 item-limit 10 item-offset 0
mac ip timestamp
------------ ------------ ---------
300d.9e3b.7eb0 192.168.1.17 2023-01-05 04:18:38
300d.9e3b.7eb0 192.168.1.17 2023-01-05 05:00:09
5254.003b.7eb0 192.168.1.18 2023-01-05 06:22:28
300d.9e3b.7eb0 192.168.1.17 2023-01-05 08:04:32
300d.9e3b.7eb0 192.168.1.17 2023-01-05 08:16:16
5254.003b.7eb0 192.168.1.18 2023-01-05 10:22:27
300d.9e3b.7eb0 192.168.1.17 2023-01-05 11:09:49
300d.9e3b.7eb0 192.168.1.17 2023-01-05 11:24:21

Notification N/A

Platform
N/A
Description

2.57 show ip dhcp history

Use this command to display the DHCP lease history.


show ip dhcp history

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

2-48
Command Reference DHCP Commands

Usage Guide This command is configured on the DHCP server.

Configuration The following example displays the DHCP lease history.


Examples Ruijie#show ip dhcp history
Expired clients : 3
IP address Hardware address Lease expiration Vlan/Relay
10.1.1.5 2222.abcd.47ac IDLE 4097
10.1.1.4 2222.abcd.47ae IDLE 4097
10.1.1.3 2222.abcd.47ad IDLE 4097
Running clients : 0
The meaning of various fields in the show result is described as follows.
Field Description

IP address The IP address to be assigned to the DHCP client.

Client-Identifier
The client identifier or hardware address of the DHCP client.
/Hardware address

The expiration date of the lease. The Infinite indicates it is not


limited by the time. The IDLE indicates the address is in the free
Lease expiration
status currently for it is not renewed or the DHCP client releases
it actively.

If a DHCP client applies for an IP address through a DHCP


relay agent, the DHCP relay agent address is displayed.
Vlan/Relay
Otherwise, the index of the port that receives DHCP packets is
displayed.

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.58 show ip dhcp pool

Use this command to display the address statistics of an address pool.


show ip dhcp pool [ poolname ]

Parameter Parameter Description


Description poolname (Optional) Address pool whose address statistics are to be displayed.

Defaults Privileged EXEC mode.

Command N/A
Mode

2-49
Command Reference DHCP Commands

Usage Guide Use this command to show the address statistics of an address pool.

Configuration The following example displays the output result of the show ip dhcp pool poolname command.
Examples Ruijie# show ip dhcp pool
Ruijie#sh ip dh pool
Pool name Total Distributed Remained Percentage
------------ ----------- ----------- -------- -----------
net20 253 11 242 4.34782
test 0 0 0 0.00000
The meaning of various fields in the show result is described as follows.
Field Description

Pool address Address pool name.

Total Total number of assignable addresses in an address pool.

Distributed Number of assigned addresses.

Remained Number of unassigned and reusable addresses.

Percentage Address utilization of an address pool.

Related Command Description


Commands Defines the name of the DHCP address pool and enters the DHCP
ip dhcp pool
address pool configuration mode.

Platform N/A
Description

2.59 show ip dhcp relay-statistics

Use this command to display the statistics of the DHCP relay.


show ip dhcp relay-statistics

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide This command is used to display the statistics of the DHCP relay.

Configuration The following example displays the statistics of the DHCP relay.
Examples Ruijie# show ip dhcp relay-statistics

2-50
Command Reference DHCP Commands

Cycle mode 0

Message Count
Discover 0
Offer 0
Request 0
Ack 0
Nak 0
Decline 0
Release 0
Info 0
Bad 0

Direction Count
Rx client 0
Rx client uni 0
Rx client bro 0
Tx client 0
Tx client uni 0
Tx client bro 0
Rx server 0
Tx server 0
The meaning of various fields in the show result is described as follows.

Field Description

Whether to allow packets to be sent to multiple DHCP


Cycle mode
servers.

Discover The number of Discover packets.

Offer The number of Offer packets.

Request The number of Request packets.

Ack The number of Ack packets.

Nak The number of Nak packets.

Decline The number of Decline packets.

Release The number of Release packets.

Info The number of Info packets.

Bad The number of error packets.

Rx client The number of packets received from the client.

Rx client uni The number of unicast packets received from the client.

Rx client bro The number of broadcast packets received from the client.

Tx client The number of packets transmitted to the client.

Tx client uni The number of unicast packets transmitted to the client

2-51
Command Reference DHCP Commands

Tx client bro The number of multicast packets transmitted to the client

Rx server The number of packets received from the server.

Tx server The number of packets transmitted to the server.

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.60 show ip dhcp server detect

Use this command to display the fake DHCP server detected.


show ip dhcp server detect

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide N/A

Configuration The following example displays the fake DHCP server detected.
Examples Ruijie#show ip dhcp server detect
The DHCP Server information:
Server IP = 10.1.10.40, DHCP server interface = GigabitEthernet 0/1

Related Command Description


Commands N/A N/A

Platform N/A
Description

2.61 show ip dhcp server statistics

Use this command to display the statistics of the DHCP server.


show ip dhcp server statistics

Parameter Parameter Description

2-52
Command Reference DHCP Commands

Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide This command displays the statistics of the DHCP server.

Configuration The following example displays the output result of the show ip dhcp server statistics command.
Examples
Ruijie# show ip dhcp server statistics
Address pools 2
Lease counter 4
Active Lease Counter 0
Expired Lease Counter 4
Malformed messages 0
Dropped messages 0

Message Received
BOOTREQUEST 216
DHCPDISCOVER 33
DHCPREQUEST 25
DHCPDECLINE 0
DHCPRELEASE 1
DHCPINFORM 150

Message Sent
BOOTREPLY 16
DHCPOFFER 9
DHCPACK 7
DHCPNAK 0
DHCPREQTIMES 0
DHCPREQSUCTIMES 0
DISCOVER-PROCESS-ERROR 0
LEASE-IN-PINGSTATE 0
NO-LEASE-RESOURCE 0
SERVERID-NO-MATCH 0
--------------------------------------------
recv 0
send 0

The meaning of various fields in the show result is described as follows.

2-53
Command Reference DHCP Commands

Field Description

Address pools Number of address pools.

Lease count Number of allocated lease.

Automatic bindings Number of automatic address bindings.

Manual bindings Number of manual address bindings.

Expired bindings Number of expired address bindings.

Malformed
Number of malformed messages received by the DHCP.
messages

Message Received Number of the messages received and sent by the DHCP server
or Sent respectively.

Related Command Description


Commands clear ip dhcp server statistics Clears the DHCP server statistics.

Platform N/A
Description

2.62 show ip dhcp socket

Use this command to display the socket used by the DHCP server.
show ip dhcp socket

Parameter Parameter Description


Description N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide N/A

Configuration The following example displays the socket used by the DHCP server.
Examples ruijie#show ip dhcp socket
dhcp socket = 47.

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-54
Command Reference DHCP Commands

2.63 update arp

Use this command to enable DHCP to add trusted ARP when allocating addresses. Use the no or
default form of this command to restore the default setting.
update arp
no update arp
default update arp

Parameter Parameter Description


Description N/A N/A

Defaults This function is disabled by default.

Command DHCP address pool configuration mode


Mode

Usage Guide This command is configured on a DHCP server. After this command is configured for an address
pool, the DHCP server adds trusted ARP entries when assigning IP addresses from the address pool.
A trusted ARP entry has a higher priority than a dynamic ARP entry and is not overridden by a
dynamic ARP entry.

Configuration The following example enables DHCP to add trusted ARP when allocating addresses.
Examples Ruijie(dhcp-config)# update arp

Related Command Description


Commands N/A N/A

Platform N/A
Description

2-55
Command Reference DNS Commands

3 DNS Commands

3.1 clear host

Use this command to clear the dynamically learned host name.


clear host [ * | host-name ]

Parameter
Parameter Description
Description
host-name Deletes the specified dynamic domain name buffer.
* Deletes all dynamic domain name buffer.

Defaults N/A

Command Privileged EXEC mode.


Mode

Usage Guide You can obtain the mapping record of the host name buffer table in two ways: 1) the ip host static
configuration, 2) the DNS dynamic learning. Execute this command to delete the host name records
learned by the DNS dynamically.

Configuration The following configuration deletes the dynamically learned mapping records from the host name-IP
Examples address buffer table.
Ruijie# clear host *

Related
Command Description
Commands
show hosts Displays the host name buffer table.

Platform N/A
Description

3.2 ip domain-lookup

Use this command to enable DNS domain name resolution. Use the no form of this command to
disable the DNS domain name resolution function.
ip domain-lookup
no ip domain-lookup

Parameter
Parameter Description
Description

3-1
Command Reference DNS Commands

N/A N/A

Defaults This function is enabled by default.

Command Global configuration mode.


Mode

Usage Guide This command enables the domain name resolution function.

Configuration The following example disables the DNS domain name resolution function.
Examples Ruijie(config)# no ip domain-lookup

Related
Command Description
Commands
Displays the DNS related configuration
show hosts
information.

Platform N/A
Description

3.3 ip host

Use this command to configure the mapping of the host name and the IP address. Use the no form of
the command to remove the host list.
ip host host-name ip-address
no ip host host-name ip-address

Parameter
Parameter Description
Description
host-name The host name of the equipment
ip-address The IP address of the equipment

Defaults N/A

Command Global configuration mode.


Mode

Usage Guide N/A

Configuration The following example configures IPv4 address 192.168.5.243 for domain name www .test.com.
Examples Ruijie(config)# ip host www.test.com 192.168.5.243

Related
Command Description
Commands

3-2
Command Reference DNS Commands

Show the DNS related configuration


show hosts
information.

Platform N/A
Description

3.4 ip name-server

Use this command to configure the IP address of the domain name server. Use the no form of this
command to delete the configured domain name server.
ip name-server [ oob ] { ip-address | ipv6-address }
no ip name-server [ oob ] { ip-address | ipv6-address }

Parameter
Parameter Description
Description
Enables the out-band channel. It must be set when the MGMT port is
oob
specified as the source port for communication with the server.
ip-address The IP address of the domain name server.
ipv6-address The IPv6 address of the domain name server.

Defaults No domain name server is configured by default.

Command Global configuration mode.


Mode

Usage Guide Add the IP address of the DNS server. Once this command is executed, the equipment will add a
DNS server. When the device cannot obtain the domain name from a DNS server, it will attempt to
send the DNS request to subsequent servers until it receives a response.
Up to 6 DNS servers are supported. You can delete a DNS server with the ip-address option or all the
DNS servers.

Configuration N/A
Examples

Related
Command Description
Commands
Displays the DNS related configuration
show hosts
information.

Platform N/A
Description

3-3
Command Reference DNS Commands

3.5 show hosts

Use this command to display DNS configuration.


show hosts [ hostname ]

Parameter
Parameter Description
Description
hostname Displays the specified domain name information,

Defaults All domain name information is displayed by default.

Command Privileged EXEC mode.


Mode

Usage Guide This command is used to display the DNS related configuration information.

Configuration Ruijie# show hosts


Examples Name servers are:
192.168.5.134 static

Host type Address TTL(sec)


switch static 192.168.5.243 ---
www.ruijie.com dynamic 192.168.5.123 126
Field Description
Name servers Domain name server
Host Domain name
type Resolution type:
Static resolution and dynamic resolution.
Address IP address corresponding to the domain name
TTL TTL of entries corresponding to the domain
name/IP address.

Related
Command Description
Commands
Configures the host name and IP address
ip host
mapping by manual.
ip name-server Configures the DNS server.

Platform N/A
Description

3-4
Command Reference DDNS Commands

4 DDNS Commands

4.1 ddns service [ domain ] username password [ interface ]

Use this command to configure the account and password of the Dynamic DNS (DDNS), and bind to an
interface.
ddns service service [ domain domain ] username username password password service service
[ interface interface-name ]

Use the no form of this command to remove the Oray dynamic domain name.
no ddns service oray username username

Use the no form of this command to remove the 3322 dynamic domain name.
no ddns service 3322 domain domain

Parameter
Parameter Description
Description
username username DDNS account
password password DDNS password
Indicates the DDNS provider.
service service 3322 indicates 3322.org.
oray indicates the oray.org.
domain domain Domain name of the 3322. It is used only for the 3322.org service.
The external interface, which can be a physical interface or a PPPoE
interface inteface-name
interface.

Defaults No DDNS account or password is configured by default.

Command Global configuration mode


Mode

Usage Guide After the DDNS account and password are configured, the device automatically connects to the DDNS
server.
If the interface binding is configured, the interface IP address will be bound to the domain name.

Configuratio #Configure the DDNS account and password of Oray.org.


n Example Ruijie#configure terminal
Ruijie (config)# ddns service oray username ruijie password ruijie interface
GigabitEthernet 0/7
#Configure the DDNS account and password of 3322.org.
Ruijie#configure terminal

4-1
Command Reference DDNS Commands

Ruijie (config)# ddns service 3322 domain ruijie.f3322.net username ruijie


password ruijie interface GigabitEthernet 0/7

Verification Run the show ddns command to check the DDNS account and password and the interface connection
status.

4.2 show ddns

Use this command to check the DDNS account and password and the connection status.
show ddns

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode and global configuration mode


Mode

Usage Guide Use this command to check the DDNS account and password and the connection status of the device.

Configuratio #Check the DDNS account and password and the connection status of the device.
n Example Ruijie#show ddns
------------------[0]-------------------
status: Success
code: none
service: oray
username: hy84119
password: hy123456
domain: 21p7o78186.imwork.net
interface: Gi0/7
------------------[1]-------------------
status: Success
code: good
service: 3322
username: hy84111
password: hy123456
domain: hy84111.f3322.net
interface:

4-2
Command Reference NTP Commands

5 NTP Commands

5.1 no ntp

Use this command to disable Network Time Protocol (NTP), and clear all NTP configuration.
no ntp

Parameter
Parameter Description
Description
N/A N/A

Defaults NTP is disabled by default.

Command Global configuration mode.


mode

Usage Guide By default, NTP is disabled. However, once the NTP server or the NTP authentication is configured,
the NTP service will be enabled.

Configuration The following example disables NTP.


Examples Ruijie(config)#no ntp

Related
Command Description
Commands
ntp server Specifies an NTP server.

Platform N/A
Description

5.2 ntp access-group

Use this command to configure an access group to control NTP access. Use the no form of this
command to remove the peer access group.
ntp access-group { peer | serve | serve-only | query-only } access-list-number | access-list-name
no ntp access-group { peer | serve | serve-only | query-only } access-list-number |
access-list-name

Parameter
Parameter Description
Description
Allows the device to receive time requests and NTP control queries to
peer
synchronize itself to the servers specified in the access list.

5-1
Command Reference NTP Commands

Allows the device to receive time requests and NTP control queries
serve from the servers specified in the access list but not to synchronize
itself to the specified servers.
Allows the device to receive only time requests from the servers
serve-only
specified in the access list.
Allows the device to receive only NTP control queries from servers
query-only
specified in the access list.
access-list-number Access control list number, ranging from 1 to 99 and 1300 to 1999.
access-list-name Access control list name.

Defaults No access rule to control NTP access is configured by default, namely, NTP access is granted to all
devices.

Command Global configuration mode.


mode

Usage Guide Use this command to configure an access group to control NTP access, providing a minimal security
measures (more secure way is to use the NTP authentication mechanism).
The NTP service enables the access group options to be scanned in the following order, from least
restrictive to most restrictive: peer, serve, serve-only, query-only.
If you do not configure any access groups, NTP access is granted to all devices. However, once you
configure the access rule, NTP access is granted only to the devices specified in the access list.

NTP control query is not supported in the current system. Although it matches with the order in
accordance with the above rules, the related requests about the control and query are not
supported.

Configuration The following example shows how to allow the device to only receive time requests from the device of
Examples 192.168.1.1.
Ruijie(config)# access-list 1 permit 192.168.1.1
Ruijie(config)# ntp access-group serve-only 1

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5.3 ntp authenticate

Use this command to enable NTP authentication. Use the no form of this command to disable NTP

5-2
Command Reference NTP Commands

authentication.
ntp authenticate
no ntp authenticate

Parameter
Parameter Description
Description
N/A N/A

Defaults Disabled.

Command Global configuration mode.


mode

Usage Guide If NTP authentication is disabled, the synchronization communication is not encrypted. To enable
encrypted communication on the server, enable the NTP authentication and configure other keys
globally.
NTP authentication is implemented through the trusted key specified by the ntp authentication-key
and ntp trusted-key commands.

Configuration After an authentication key is configured and specified as the global trusted key, enable NTP
Examples authentication.
Ruijie(config)#ntp authentication-key 6 md5 wooooop
Ruijie(config)#ntp trusted-key 6
Ruijie(config)#ntp authenticate

Related
Command Description
Commands
ntp authentication-key Sets the global authentication key.
ntp trusted-key Configures the global trusted key.

Platform N/A
Description

5.4 ntp authentication-key

Use this command to configure an NTP authentication key. Use the no form of this command to
remove the NTP authentication key.
ntp authentication-key key-id md5 key-string [enc-type]
no ntp authentication-key key-id

Parameter
Parameter Description
Description
key-id Key ID, ranging from 1 to 4294967295.
key-string Key string

5-3
Command Reference NTP Commands

enc-type (Optional) Whether this key is encrypted, where, 0 indicates the key is
not encrypted, 7 indicates the key is encrypted simply. The key is not
encrypted by default.

Defaults NTP authentication key is not configured by default.

Command Global configuration mode.


mode

Usage Guide Use this command to configure an NTP authentication key and enables the md5 algorithm for
authentication. Each key presents a unique key ID, which can be configured as a trusted key using
the ntp trusted-key command.
You can configure up to 1024 NTP authentication keys. However, each server can support only one
key.

Configuration The following example configures an NTP authentication key.


Examples Ruijie(config)ntp authentication-key 6 md5 wooooop

Related
Command Description
Commands
ntp authenticate Enables NTP authentication.
ntp trusted-key Configures an NTP trusted key.
ntp server Specifies an NTP server.

Platform N/A
Description

5.5 ntp disable

Use this command to disable the device to receive NTP packets on the specified interface.
ntp disable

Parameter
Parameter Description
Description
N/A N/A

Defaults All NTP packets can be received by default.

Command Interface configuration mode.


mode

Usage Guide The NTP message received on any interface can be provided to the client to carry out the clock
adjustment. The function can be set to shield the NTP message received from the corresponding
interface.

5-4
Command Reference NTP Commands

By default, the device receives NTP packets on all interfaces, and adjust clock for the client. You can
use this command to disable the device to receive NTP packets on the specified interface.

This command is configured only the interface that can receive and send IP packets.

Configuration The following example disables the device to receive the NTP packets.
Examples Ruijie(config-if)# no ntp disable

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5.6 ntp master

Use this command to configure the device to act as an authoritative NTP server, synchronizing time
to other devices. Use the no form of this command to remove the device as an authoritative NTP
server.
ntp master [ stratum ]
no ntp master

Parameter
Parameter Description
Description
stratum Stratum level. The range is from 1 to 15. The default is 8.

Defaults N/A

Command Global configuration mode.


mode

Usage Guide In general, the local device synchronizes time from the external time source directly or indirectly.
However, if the time synchronization fails due to network connection trouble, you can use this
command to configure the local device to act as an authoritative NTP server to synchronize time to t
other devices. Once configured, the device will not perform time synchronization with the time source
which is of a higher stratum.

Configuring the device to act as an authoritative NTP server (in particular, specify a lower
stratum level), may be likely to overwrite the effective time. If multiple devices in the same
network are configured with this command, the time synchronization may be instable due to the
time difference between the devices.

Before configuring this command, you need to manually correct the system clock to avoid too
much bias if the device has never performed time synchronization with the external clock

5-5
Command Reference NTP Commands

source.

Configuration The following example configures the device to act as an authoritative NTP server, and sets the
Examples stratum level to 12:
Ruijie(config)# ntp master 12

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5.7 ntp server

Use this command to specify a NTP server for the NTP client. Use the no form of this command to
delete the specified NTP server.
ntp server [ oob ] { ip-addr | domain | ip domain | ipv6 domain } [ version version ] [ source if-name ]
[ key keyid ] [ prefer]
no ntp server ip-addr

Parameter
Parameter Description
Description
(Optional) Accesses the NTP server from the MGMT interface. By
oob
default, this option is disabled.
Sets the IP address of the NTP server. Both IPv4 and IPv6 formats
ip-addr
are supported.
domain Sets the domain name of the NTP server, supporting IPv4 and IPv6
version (Optional) Specifies the NTP version (1-3). The default is NTPv3.
(Optional) Specifies the source interface from which the NTP
if-name
message is sent (L3 interface).
(Optional) Specifies the encryption key adopted when communication
keyid with the corresponding server. The key ID range is from 1 to
4,294,967,295.
prefer (Optional) Specifies the given NTP server as the preferred one.

Defaults No NTP server is configured by default.

Command Global configuration mode.


mode

Usage Guide At present, RGOS system only supports clients other than servers. Up to 20 servers can be
synchronized.

5-6
Command Reference NTP Commands

To carry out the encrypted communication with the server, set the global encryption key and global
trusted key firstly, and then specify the corresponding key as the trusted key of the server to launch
the encrypted communication of the server. It requires the server presents identical global encryption
key and global trust key to complete the encrypted communication with the server.
In the same condition (for instance, precision), the prefer clock is used for synchronization.

The source interface of NTP packets must be configured with the IP address and can be
communicated with the peer.

Configuration The following example configures an NTP server.


Examples For IPv4: Ruijie(config)# ntp server 192.168.210.222
For IPv6: Ruijie(config)# ntp server 10::2

Related
Command Description
Commands
no ntp Disables NTP.

Platform The NBR6120-E does not support IPv6 NTP server function.
Description

5.8 ntp trusted-key

Use this command to set a global trusted key. Use the no form of this command to remove the global
trusted key.
ntp trusted-key key-id
no ntp trusted-key key-id

Parameter
Parameter Description
Description
key-id Global trusted key ID, ranging from 1 to 4294967295.

Defaults N/A

Command Global configuration mode.


mode

Usage Guide The NTP communication parties must use the same trusted key. The key is identified by ID and is not
transmitted to improve security.

Configuration The following example configures an authentication key and sets it as a trusted key.
Examples Ruijie(config)#ntp authentication-key 6 md5 wooooop
Ruijie(config)#ntp trusted-key 6
Ruijie(config)#ntp server 192.168.210.222 key 6

5-7
Command Reference NTP Commands

Related
Command Description
Commands
ntp authenticate Enables NTP authentication.
ntp authentication-key Configures an NTP authentication key.
ntp server Configures an NTP server.

Platform N/A
Description

5.9 ntp update-calendar

Use this command to enable the NTP client to periodically update the device clock with the time
synchronized from the external source clock. Use the no form of this command to remove this
function.
ntp update-calendar
no ntp update-calendar

Parameter
Parameter Description
Description
N/A N/A

Defaults By default, update the calendar periodically is not configured.

Command Global configuration mode.


mode

Usage Guide By default, the NTP update-calendar is not configured. After configuration, the NTP client updates the
calendar at the same time when the time synchronization of external time source is successful. It is
recommended to enable this function for keeping the accurate calendar.

Configuration The following example configures the NTP update calendar periodically.
Examples Ruijie(config)# ntp update-calendar

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5.10 show ntp server

Use this command to display the NTP server configuration.

5-8
Command Reference NTP Commands

show ntp server

Parameter
Parameter Description
Description
N/A N/A

Defaults N/A

Command Privileged EXEC mode, global configuration mode, interface configuration mode, VLAN configuration
mode mode

Usage Guide N/A

Configuration The following example displays the NTP server.


Examples Ruijie# show ntp server
ntp-server source keyid prefer version
------------------------------- -------- ----------- ------ -------
10::2 None None FALSE 3
192.168.210.222 None None FALSE 3

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5.11 show ntp status

Use this command to display the NTP configuration.


show ntp status

Parameter
Parameter Description
Description
N/A N/A

Defaults N/A

Command Privileged EXEC mode, global configuration mode, interface configuration mode, VLAN configuration
mode mode

Usage Guide Use this command to display the NTP configuration. No configuration is displayed before the
synchronization server is configured for the first time.

5-9
Command Reference NTP Commands

Configuration The following example displays the NTP configuration.


Examples Ruijie# show ntp status
Clock is synchronized, stratum 8, reference is 127.127.1.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**24
reference time is D4BD819B.433892EE (01:27:55.000 UTC )
clock offset is 0.00000 sec, root delay is 0.00000 sec
root dispersion is 0.00002 msec, peer dispersion is 0.00002 msec

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

5-10
Command Reference SNTP Commands

6 SNTP Commands

6.1 show sntp

Use this command to display the SNTP configuration.


show sntp

Parameter
Parameter Description
Description
N/A N/A

Defaults

Command Privileged EXEC mode, global configuration mode, interface configuration mode.
mode

Usage Guide N/A

Configuration The following example displays the SNTP configuration.


Examples Ruijie# show sntp
SNTP state : Enable
SNTP server : 192.168.4.12
SNTP sync interval : 60
Time zone : +8

Related
Command Description
Commands
sntp enable Enables SNTP.

Platform N/A
Description

6.2 sntp enable

Use this command to enable the SNTP function. Use the no form of this command to restore the
default value.
sntp enable
no sntp enable

Parameter
Parameter Description
Description

6-1
Command Reference SNTP Commands

N/A N/A

Defaults SNTP is disabled by default.

Command Global configuration mode.


mode

Usage Guide N/A

Configuration The following example enables SNTP.


Examples Ruijie(config)# sntp enable

Related
Command Description
Commands
show sntp Displays the SNTP configuration.

Platform N/A
Description

6.3 sntp interval

Use this command to set the interval for the SNTP client to synchronize its clock with the NTP/SNTP
server. Use the no form of this command to restore the default synchronization interval.
sntp interval seconds
no sntp interval

Parameter
Parameter Description
Description
seconds Synchronization interval. The unit is second, and the range is from 60 to 65,535.

Defaults The default synchronization interval is 1,800 seconds.

Command Global configuration mode.


mode

Usage Guide To make the synchronization interval configuration effective, run the sntp enable command.

Configuration The following example configures the synchronization interval to 3,600 seconds.
Examples Ruijie(config)# sntp interval 3600

Related
Command Description
Commands
sntp enable Enables SNTP.

6-2
Command Reference SNTP Commands

show sntp Displays the SNTP configuration.

Platform N/A
Description

6.4 sntp server

Use this command to specify an SNTP server. Use the no form of this command to remove the SNTP
server.
sntp server [ oob ] { ip- address | domain } [ source source-ip-address ]
no sntp server

Parameter
Parameter Description
Description
oob (Optional) Accesses the SNTP server from the MGMT interface.
ip-address IP address of the SNTP server.
domain Specifies the domain name of the SNTP server.
source-ip-address (Optional) Indicates the specified source IP address.

Defaults No SNTP server is configured by default.

Command Global configuration mode.


mode

Usage Guide As SNTP is fully compatible with NTP, the SNTP server can be used as an NTP server in Internet.

Configuration The following example specifies an SNTP server in Internet.


Examples Ruijie(config)# sntp server 192.168.4.12

Related
Command Description
Commands
show sntp Displays the SNTP configuration.
sntp enable Enables SNTP.

Platform N/A
Description

6-3
Command Reference SMART-DNS Commands

7 SMART-DNS Commands

7.1 show smartdns config

Use this command to display the SMART-DNS configurations.


show smartdns config

Parameter
Parameter Description
Description
config Queries the SMART-DNS configurations.

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Configure this command to display the SMART-DNS configurations

Configuration #Display the SMART-DNS configurations.


Example A# show smartdns config
smartdns:enable
cli:
smartdns 192.168.1.2 Gi0/1 map 10.123.123.124
smartdns 192.168.1.2 Gi0/2 map 10.123.123.124
……
Field description:
Field Description
smartdns Indicates whether the function is enabled.
cli Displays command information of the current
configurations.

Platform
The NBR6120-E does not support the SMART-DNS function.
Description

7.2 smartdns

Use this command to enable or configure SMART-DNS.


[ no ] smartdns { enable | sip interface map mip }

Parameter
Parameter Description
Description
enable Enables SMART-DNS.
sip Indicates the IP address of the intranet business server.
interface Indicates the interface on which the source IP address is translated

7-1
Command Reference SMART-DNS Commands

into the mapped IP address.


map Indicates mapping.
mip Indicates the public IP address of the business server.

Command Global configuration mode


Mode

Usage Guide Use this command to configure SMART-DNS.

Configuration #Enable or configure SMART-DNS.


Example Ruijie# config
Ruijie (config)# smartdns enable
Ruijie (config)# smartdns 192.168.1.2 gi 0/1 map 10.123.123.124
Ruijie (config)# smartdns 192.168.1.2 gi 0/2 map 61.123.123.124

Platform
The NBR6120-E does not support the SMART-DNS function.
Description

7-2
Command Reference DNS Proxy Commands

8 DNS Proxy Commands

8.1 blacklist domain-ip

Use this command to add a DNS blacklist.


blacklist domain-ip start-ip [end-ip]

Use the no form of this command to delete a DNS blacklist.


no blacklist domain-ip start-ip [end-ip]

Parameter
Parameter Description
Description
start-ip Indicates the start IP address of a blacklist.
end-ip Indicates the end IP address of a blacklist.

Defaults The blacklist is empty by default.

Command DNS proxy mode


Mode

Usage Guide A DNS blacklist will shield IP addresses or URLs that match certain rules. Use this command to check
the IP address or URL in DNS response packets and prevent users from being directed to some invalid
IP addresses provided in false DNS response packets. A maximum of 10 IP addresses or URLs can be
configured.

Configuration #Add the IP segment 1.1.1.1–1.1.1.100 to the blacklist in DNS proxy mode.
Example Ruijie(config)#dns-proxy
Ruijie(config-dns-proxy)# blacklist domain-ip 1.1.1.1 1.1.1.100

Verification Run the show running-config command to display the configuration result.

8.2 clear dns-proxy statistics

Use this command to clear the statistical information of the DNS proxy in privileged EXEC mode.
clear dns-proxy statistics

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode

8-1
Command Reference DNS Proxy Commands

Mode

Usage Guide Use this command to clear the statistical information of the DNS proxy.

Configuration #Clear the statistical information of the DNS proxy in privileged EXEC mode.
Example Ruijie# clear dns-proxy statistics

8.3 debug dns-proxy

Use this command to enable the DNS proxy debugging switch.


debug dns-proxy

Use the no form of this command to disable the DNS proxy debugging switch.
no debug dns-proxy

Parameter
Parameter Description
Description
N/A N/A

Defaults The DNS proxy debug switch is disabled by default.

Command Privileged EXEC mode


Mode

Usage Guide Debugging information includes debugging information of various types of events generated during
DNS proxy running:
 DNS proxy change events
 Various handling events generated during changes to the protocol state machine
 Handling for various types of packets received
 Interface related event handling

Enable this debugging switch to display all events and handling information of the DNS proxy. The
events and handling information are usually used for tracing the working process of the DNS
proxy.

Debugging information generated during handling failures helps diagnose and locate problems.

Configuration #Enable the DNS proxy debugging switch.


Example Ruijie# debug dns-proxy

#Disable the DNS proxy debugging switch.


Ruijie# no debug dns-proxy

8-2
Command Reference DNS Proxy Commands

8.4 dns-proxy

Use this command to enter the DNS proxy configuration mode in global configuration mode.
dns-proxy

Parameter
Parameter Description
Description
N/A N/A

Defaults N/A

Command Global configuration mode


Mode

Usage Guide Before configuring the DNS proxy, enter the DNS proxy configuration mode.

Configuration #Enter the DNS proxy configuration mode in global configuration mode.
Example Ruijie(config)#dns-proxy
Ruijie(config-dns-proxy)#exit
Ruijie(config)#

Verification Verify that the DNS proxy configuration mode is entered.

8.5 dns-proxy enable

Use this command to enable the DNS proxy.


dns-proxy enable

Use the no form of this command to disable the DNS proxy.


no dns-proxy enable

Parameter
Parameter Description
Description
N/A N/A

Defaults The DNS proxy is disabled by default.

Command Interface configuration mode


Mode

Usage Guide Use this command to enable the DNS proxy on a L3 interface. The DNS proxy does not limit the type of
the L3 interface. Generally, the DNS proxy provides extranet services for intranets; therefore, run the
dns-proxy enable command on a LAN interface, and run the ip name-server command on a WAN

8-3
Command Reference DNS Proxy Commands

interface.

Configuration #Enable the DNS proxy on Gi0/1.


Example Ruijie(config)#int gi0/1
Ruijie(config-if-GigabitEthernet 0/1)#dns-proxy enable

Verification Run the show running-config command to display the configuration result.

8.6 ip name-server

Use this command to configure an IP address of the DNS.


ip name-server ip-address [track id]

Use the no form of this command to delete the IP address of the DNS.
no ip name-server ip-address [track id]

Parameter
Parameter Description
Description
ip-address Specifies an IP address.
id Indicates an associated track ID.

Defaults No IP address of the DNS is configured by default.

Command Interface configuration mode


Mode

Usage Guide The DNS proxy can be used on a WAN interface only after the DNS server is configured. Generally,
operators provide an active DNS server and a standby DNS server. Both the DNS servers can be
configured on the WAN interface, so that the DNS proxy can enable the standby DNS server when the
active one fails. A maximum of four DNS servers can be configured on one interface.
Associate the DNS proxy with the track module to check whether the link to the DNS server is
reachable. If the association is not configured, the link is reachable by default when the interface is in
the Up state.

Configuration #Configure two Telecom DNS servers on Gi0/1.


Example Ruijie(config)#int gi0/1
Ruijie(config-if-GigabitEthernet 0/1)#ip name-server 218.85.157.99
Ruijie(config-if-GigabitEthernet 0/1)#ip name-server 218.85.152.99 track 1

Verification Run the show running-config command to display the configuration result.

8-4
Command Reference DNS Proxy Commands

8.7 load-balance

Use this command to configure load balancing policies.


load-balance {load | bandwidth}

Use the no form of this command to restore the default load balancing policy.
no load-balance

Parameter
Parameter Description
Description
load Indicates the load-based policy.
bandwidth Indicates the bandwidth-based policy.

Defaults The bandwidth-based policy is configured by default.

Command DNS proxy mode


Mode

Usage Guide Use this command to switch the load balancing policy of the DNS proxy. The bandwidth-based policy is
configured by default. Users can manually switch the policy to the bandwidth utilization rate-based
policy.

Configuration #Configure the load-based load balancing policy for the DNS proxy.
Example Ruijie(config)#dns-proxy
Ruijie(config-dns-proxy)#load-balance load
#Configure the bandwidth-based load balancing policy for the DNS proxy.
Ruijie(config-dns-proxy)#load-balance bandwidth

Verification Run the show running-config command to display the configuration result.

8.8 show dns-proxy configure

Use this command to display all configuration information of the DNS proxy in privileged EXEC mode.
show dns-proxy configure

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Use this command to display all configuration information of the DNS proxy.

8-5
Command Reference DNS Proxy Commands

Configuration #Display all configuration information of the DNS proxy in privileged EXEC mode.
Example Ruijie# show dns-proxy configure
>dns-proxy load balance:bandwidth
---------------------------------------------------------------------------
------
>dns-proxy whitelist
---------------------------------------------------------------------------
------
Type:source-ip
Source-ip:192.168.1.1 192.168.1.10

Type:name-server
Nameserver:8.8.8.8

>Dns-proxy blacklist
----------------------------------------------------------------
Start-ip End-ip
--------------- ---------------
1.1.1.1 1.1.1.10

Field description:

Field Description
bandwidth Indicates the bandwidth-based policy.
whitelist Indicates a whitelist.
source-ip Indicates the source IP address.
name-server Indicates a DNS server.
blacklist Indicates a blacklist.

8.9 show dns-proxy configure blacklist

Use this command to display the blacklist configuration information of the DNS proxy in privileged
EXEC mode.
show dns-proxy configure blacklist

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Use this command to display the blacklist configuration information of the DNS proxy.

8-6
Command Reference DNS Proxy Commands

Configuration #Display the blacklist configuration information of the DNS proxy in privileged EXEC mode.
Example Ruijie(config)#show dns-proxy configure blacklist
>Dns-proxy blacklist
----------------------------------------------------------------
Start-ip End-ip
--------------- ---------------
1.1.1.1 1.1.1.10
Field description:
Field Description
blacklist Indicates a blacklist.
Start-ip Indicates the start IP address.
End-ip Indicates the end IP address.

8.10 show dns-proxy configure whitelist

Use this command to display the whitelist configuration information of the DNS proxy in privileged
EXEC mode.
show dns-proxy configure whitelist

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Use this command to display the whitelist configuration information of the DNS proxy.

Configuration #Display the whitelist configuration information of the DNS proxy in privileged EXEC mode.
Example Ruijie(config)#show dns-proxy configure whitelist
>dns-proxy whitelist
---------------------------------------------------------------

Type:source-ip
Source-ip:192.168.1.1 192.168.1.10

Type:name-server
Nameserver:8.8.8.8
Field description:
Field Description
whitelist Indicates a whitelist.
source-ip Indicates the source IP address.
name-server Indicates a DNS server.

8-7
Command Reference DNS Proxy Commands

Verify that the whitelist configuration information of the DNS proxy is displayed.
Ruijie(config)#show dns-proxy configure whitelist
>dns-proxy whitelist
---------------------------------------------------------------
Type: source-ip
Host-name: 192.168.1.1 192.168.1.10

8.11 show dns-proxy name-server

Use this command to display the DNS configuration information of the DNS proxy in privileged EXEC
mode.
show dns-proxy name-server

Parameter
Parameter Description
Description
N/A N/A

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Use this command to display the DNS configuration information of the DNS proxy.

Configuration #Display the DNS configuration information of the DNS proxy in privileged EXEC mode.
Example Ruijie(config)#show dns-proxy name-server
>Dns-proxy name-server
------------------------------------------------------------------------
Interface Dns-server TrackId State Description
-------------------------- --------------- ------- ----- -----------
GigabitEthernet 0/0 192.168.58.110 1 down static
Field description:
Field Description
Interface Indicates the interface information.
dns-server Indicates a DNS.
trackid Indicates a track line.
state Indicates a state.

8.12 show dns-proxy statistics

Use this command to display the statistical information of the DNS proxy in privileged EXEC mode.
show dns-proxy statistics

Parameter
Parameter Description
Description

8-8
Command Reference DNS Proxy Commands

N/A N/A

Command Privileged EXEC mode, global configuration mode, and interface configuration mode
Mode

Usage Guide Use this command to display the statistical information of the DNS proxy.

Configuration #Display the statistical information of the DNS proxy in privileged EXEC mode.
Example Ruijie# show dns-proxy statistics
>recv dns request counts:494
>send dns request counts:463
>recv dns reply counts:493
>send dns reply counts:473
>hit the whitelist counts:11
>hit the anti-hijacklist counts:30

>dns proxy load-balance:


interface dns server Send Requests
---------------------- ---------------- --------------
GigabitEthernet 0/0 202.101.98.54 110
202.101.98.52 50
GigabitEthernet 0/1 202.101.98.54 110
202.101.98.52 50
Field description:
Field Description
recv dns request counts Indicates the number of received DNS request packets.
send dns request counts Indicates the number of sent DNS request packets.
recv dns reply counts Indicates the number of received DNS response packets.
send dns reply counts Indicates the number of sent DNS response packets.
hit the whitelist counts Indicates the number of times of hitting the whitelist.
hit the anti-hijacklist counts Indicates the number of times of hitting the blacklist.

8.13 whitelist

Use this command to configure a whitelist.


whitelist {source-ip start-ip[end-ip] | name-server ip [increase | decrease num]}

Use the no form of this command to delete a whitelist.


no whitelist {source-ip start-ip [end-ip] | name-server ip }

Parameter
Parameter Description
Description
start-ip Indicates the start source IP address of the whitelist.
end-ip Indicates the end source IP address of the whitelist.

8-9
Command Reference DNS Proxy Commands

ip Indicates a DNS server.


Indicates the number of lines by which a configuration item is moved
num
upward or downward.

Defaults The whitelist is empty by default.

Command DNS proxy mode


Mode

Usage Guide Use this command to prevent packets that match whitelist rules from being intercepted by the DNS
proxy. Whitelist rules involve the network segment, domain name, and destination DNS. The whitelist
supports the longest suffix match and precise match of a domain name.
A maximum of 10 items can be configured in a whitelist. The topmost configuration item has the highest
priority, which can be changed by moving the position of the configuration item upward or downward.

Configuration #Add the DNS 8.8.8.8 into the whitelist in DNS proxy mode.
Example Ruijie(config)# dns-proxy
Ruijie(config-dns-proxy)# whitelist name-server 8.8.8.8

Verification Run the show running-config command to display the configuration result.

8-10
Command Reference FTP Server Commands

9 FTP Server Commands

9.1 ftp-server enable

Use this command to enable the FTP server. Use the default form of this command to restore the
default setting.
ftp-server enable
default ftp-server enable

Parameter
Parameter Description
Description
N/A N/A

Defaults This function is disabled by default.

Command Global configuration mode


Mode

Usage Guide This command is used to enable the FTP server to connect the FTP client to upload/download the
files.

To enable the FTP client to access to the FTP server files, this command shall be co-used with
the ftp-server topdir command.

Configuration The following example enables the FTP Server and confines the FTP client access to the syslog
Examples subdirectory:

Ruijie(config)# ftp-server topdir /syslog

Ruijie(config)# ftp-server enable

The following example disables the FTP Server:

Ruijie(config)# no ftp-server enable

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9-11
Command Reference FTP Server Commands

9.2 ftp-server login timeout

Use this command to set the timeout interval for login to the FTP server. Use the no or default form
of this command to restore the default setting.
ftp-server login timeout time
no ftp-server login timeout
default ftp-server login timeout

Parameter
Parameter Description
Description
time Sets the timeout interval for login to the FTP server, in the range from
1 to 30 in the unit of minutes.

Defaults The default is 2 minutes.

Command Global configuration mode


Mode

Usage Guide The timeout interval refers to the maximum time when your account is allowed online after you login
to the server. If you don’t perform authentication again before the timeout interval expires, you will be
forced offline.

Configuration The following example sets the timeout interval for login to the FTP server to 5 minutes.
Examples Ruijie(config)# ftp-server login timeout 5

The following example restores the default setting.


Ruijie(config)# no ftp-server login timeout

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9.3 ftp-server login times

Use this command to set the number of login attempts. Use the no or default form of this command
to restore the default setting.
ftp-server login times time
no ftp-server login times
default ftp-server login times

9-12
Command Reference FTP Server Commands

Parameter
Parameter Description
Description
time Sets the number of login attempts, in the range from 1 to 10.

Defaults The default is 3.

Command Global configuration mode


Mode

Usage Guide The number of login attempts refers to the maximum count you are allowed to perform authentication.
If the number of your login attempts exceeds 3, you will be forced offline.

Configuration The following example sets the number of login attempts to 5.


Examples Ruijie(config)# ftp-server login times 5

The following example restores the default setting.


Ruijie(config)# no ftp-server login times

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9.4 ftp-server timeout

Use this command to set the FTP session idle timeout. Use the no form of this command to restore
the default setting.
ftp-server timeout time
no ftp-server timeout

Parameter
Parameter Description
Description
Sets the session idle timeout, in the range from 1 to 3600 in the unit of
time
minutes.

Defaults The default is 10 minutes.

Command Global configuration mode.


Mode

Usage Guide Use this command to set the FTP session idle timeout. If the session is idle, the FTP server deems

9-13
Command Reference FTP Server Commands

the session connection is invalid and disconnects with the user.

The session idle time refers to the time for the FTP session between two FTP operations

Configuration The following example sets the session idle timeout to 5 minutes:
Examples Ruijie(config)# ftp-server timeout 5

The following example restores the default setting.


Ruijie(config)# no ftp-server timeout

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9.5 ftp-server topdir

Use this command to set the directory range for the FTP client to access to the FTP server files. Use
the no form of this command to restore the default setting.
ftp-server topdir directory
no ftp-server topdir

Parameter
Parameter Description
Description
directory Sets the top-directory.

Defaults No top-directory is configured by default.

Command Global configuration mode.


Mode

Usage Guide The FTP server top directory specifies the directory range of the files accessed by the client. Can the
FTP client accesses to the files on the FTP server with the top directory correctly specified.
Without this command configured, FTP client fails to access to any file or directory on the FTP server.

Configuration The following example enables the FTP Server and confines the FTP client access to the syslog
Examples subdirectory.

Ruijie(config)# ftp-server topdir /syslog

9-14
Command Reference FTP Server Commands

Ruijie(config)# ftp-server enable

The following example restores the default setting.


Ruijie(config)# no ftp-server topdir

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9.6 ftp-server username password

Use this command to set the login username and password for the FTP server. Use the no form of
this command to restore the default setting.
ftp-server username username password [type] password
no ftp-server username username
default ftp-server username username

Parameter
Parameter Description
Description
username Sets the login username.
password Sets the log password

Defaults No username or password is set by default.

Command Global configuration mode


Mode

Usage Guide Use this command to set the login username for the FTP server. To log in to the FTP server, the
correct username and password shall be provided.
The maximum length of the username is 64 characters and the spaces are not allowed in the middle
of the username. The username consists of letters, semiangle number and semiangle mark. One
username can be configured for the FTP server at most.
The password must contain letters or numbers. Spaces before or behind the password are allowed
but will be ignored. The spaces within are part of the password.
The plaintext password is in the range from 1 to 25 characters. The encrypted password is in the
range from 4 to 52 characters.

The anonymous user login is not supported on the FTP server. The client fails to pass the
identity verification if the username is removed.

9-15
Command Reference FTP Server Commands

Configuration The following example sets the username to user:


Examples Ruijie(config)# ftp-server username user password pass

The following example restores the default setting:

Ruijie(config)# no ftp-server username user

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9.7 show ftp-server

Use this command to show the status information of the FTP server.
show ftp-server

Parameter
Parameter Description
Description
N/A N/A

Defaults N/A

Command Privileged EXEC mode


Mode

Usage Guide The FTP server status information includes:

 Enabled/Disabled server

 The FTP server top directory

 The FTP server user information, including username, password and connection number. If
connection is set up, the IP address, port, transmission type, active/passive mode is shown

Configuration The following example displays the related status information of the FTP server:
Examples Ruijie#show ftp-server

ftp-server information

===================================

enable : Y

9-16
Command Reference FTP Server Commands

topdir : tmp:/

timeout: 10min

username:aaaa password:(PLAINT)bbbb connect num[2]

[0]trans-type:BINARY (ctrl)server IP:192.168.21.100[21]

client IP:192.168.21.26[3927]

[1]trans-type:ASCII (ctrl)server IP:192.168.21.100[21]

client IP:192.168.21.26[3929]

username:a1 password:(PLAINT)bbbb connect num[0]

username:a2 password:(PLAINT)bbbb connect num[0]

username:a3 password:(PLAINT)bbbb connect num[0]

username:a4 password:(PLAINT)bbbb connect num[0]

username:a5 password:(PLAINT)bbbb connect num[0]

username:a6 password:(PLAINT)bbbb connect num[0]

username:a7 password:(PLAINT)bbbb connect num[0]

username:a8 password:(PLAINT)bbbb connect num[0]

username:a9 password:(PLAINT)bbbb connect num[0]

Related
Command Description
Commands
N/A N/A

Platform N/A
Description

9-17
Command Reference Time Range Commands

10 Time Range Commands

10.1 absolute

Use this command to configure an absolute time range.


absolute { [ start time date ] [ end time date ] }

Use the no form of this command to remove the absolute time range.
no absolute

Parameter
Parameter Description
Description
start time date Indicates the start time of the range.
end time date Indicates the end time of the range.

Defaults The default absolute time range is the maximum range, which is from 00:00 January 1, 0 to 23:59
December 31, 9999.

Command Time range configuration mode


Mode

Default Level 14

Usage Guide Use the absolute command to configure a time absolute time range between a start time and an end
time to allow a certain function to take effect within the absolute time range.
The maximum absolute time range is from 00:00 January 1, 0 to 23:59 December 31, 9999.

Configuration The following example creates a time range and enters time range configuration mode.
Examples Ruijie(config)# time-range no-http
Ruijie(config-time-range)#

The following example configures an absolute time range.


Ruijie(config-time-range)# absolute start 1:1 1 JAN 2013 end 1:1 1 JAN 2014

Check
Use the show time-range [ time-range-name ] command to display the time range configuration.
Method

Prompt
-
Message

Platform
-
Description

10-1
Command Reference Time Range Commands

10.2 periodic

Use this command to configure periodic time.


periodic day-of-the-week time to [ day-of-the-week ] time

Use the no form of this command to remove the configured periodic time.
no periodic day-of-the-week time to [ day-of-the-week ] time

Parameter
Parameter Description
Description
day-of-the-week Indicates the week day when the periodic time starts or ends.
time Indicates the exact time when the periodic time starts or ends.

Defaults No periodic time is configured by default.

Command Time range configuration mode


Mode

Default Level 14

Usage Guide Use the periodic command to configure a periodic time interval to allow a certain function to take effect
within the periodic time.

Configuration The following example creates a time range and enters time range configuration mode.
Examples Ruijie(config)# time-range no-http
Ruijie(config-time-range)#

The following example configures a periodic time interval.


Ruijie(config-time-range)# periodic Monday 1:1 to Tuesday 2:2

Check
Use the show time-range [ time-range-name ] command to display the time range configuration.
Method

Prompt
-
Message

Platform
-
Description

10.3 show time-range

Use this command to display the time range configuration.


show time-range [ time-range-name ]

10-2
Command Reference Time Range Commands

Parameter
Parameter Description
Description
time-range-name Displays a specified time range.

Command Privileged EXEC mode


Mode

Default Level 14

Usage Guide Use this command to check the time range configuration.

Configuration The following example displays the time range configuration.


Examples Ruijie# show time-range
time-range entry: test (inactive)
absolute end 01:02 02 February 2012

Prompt
-
Message

Platform
-
Description

10.4 time-range

Use this command to create a time range and enter time range configuration mode.
time-range time-range-name

Use the no form of this command to remove the configured time range.
no time-range time-range-name

Parameter
Parameter Description
Description
time-range-name Time range name

Defaults No time range is configured by default.

Command Global configuration mode


Mode

Default Level 2

Usage Guide Some applications (such as ACL) may run based on time. For example, an ACL can be effective within
certain time ranges of a week. To this end, first you must configure a time range. After the time range is

10-3
Command Reference Time Range Commands

created, you can configure relevant time control in time range mode.

Configuration The following example creates a time range.


Examples Ruijie(config)# time-range no-http
Ruijie(config-time-range)#

Check
Use the show time-range [ time-range-name ] command to display the time range configuration.
Method

Prompt
-
Message

Platform
-
Description

10-4
Command Reference SFTP Commands

11 SFTP Commands

11.1 sftp

Use this command to connect to the SFTP server to enter the SFTP client mode.
sftp [ oob ] [-c {3des | aes128-cbc | aes192-cbc | aes256-cbc} ] [ -p port-num ] [ -v { 1 | 2 } ] [ -m
{ hmac-md5-128 | hmac-md5-96 | hmac-sha1-160 | hmac-sha1-96 } ] { address } [ /source { ip A.B.C.D |
interface interface-name } ]

Parameter Parameters Description


Description oob (Optional) Accesses the SFTP server from the MGMT port. This option is
supported only when the device has the MGMT port.
port-num Server port
address Server address
(Optional) The version of SSH used to connect to the server. If it is not
specified, the SSHv2 is used by default. Two versions of SSH can be used
-v for connection:
1.SSHv1
2. SSHv2
(Optional) Specify an encryption algorithm. Three kinds of encryption
algorithms are available: Data Encryption Standard (DES), Triple Data
Encryption Standard (3DES) and Advanced Encryption Standard (AES).
AES: According to the lengths of the AES encryption keys, it includes three
types: aes128-cbc (128-bit key), aes192-cbc (192-bit key) and aes256-cbc
-c { 3des | aes128-cbc |
(256-bit key).
aes192-cbc | aes256-cbc }
 If the -c is not specified, SSH client sends all the supported algorithms
to the server during algorithm negotiation.
If it is specified, SSH client only sends the configured algorithm to the server
during algorithm negotiation. In this case, if the configured algorithm is not
supported by the server, the connection is interrupted.
(Optional) Specify a Hash-Based hash based MAC algorithm (HMAC).
 HMACs don’t support SSHv1. If the SSHv1 and HMACs are specified,
-m { hmac-md5-96 | the HAMCs are ignored.
hmac-md5-128 |  If the -m is not specified; SSH client will sent all the supported
hmac-sha1-96 | algorithms to the server during algorithm negotiation.
hmac-sha1-160 }  If it is specified, SSH client only sends the configured HMAC algorithm
to the server during algorithm negotiation. In this case, if the configured
HMAC is not supported by the server, the connection is interrupted.
/source Specify a source IP address or source interface for SFTP client.
ip A.B.C.D Specify a source IPv4 address for SFTP client.
interface interface-name Specify a source interface for SFTP client.
Defaults N/A

11-1
Command Reference SFTP Commands

Command Common User Mode


Mode

Default Level 1

Usage Guide This command is used to log into the SFTP server, and enter the SFTP client mode. In this mode, run put,
get, ls, rm, rmdir and mkdir commands to upload and download files to and from the server, add or delete
a file to and from the server and display files of the server.
Configuration Connect to the SFTP server and enter the SFTP client mode.
Examples Ruijie# sftp 192.168.57.55
User Name: ruijie
[email protected]'s password:

Connected to 192.168.57.55, 22
sftp-client>

Verification N/A

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.2 put

Use this command to upload a File


put local-file [remote-file]

Parameter Parameters Description


Description local-file The name of the file to be uploaded.
remote-file The name of the file in the server.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide This command is used to upload the file of the local device to the server in the SFTP client mode.

11-2
Command Reference SFTP Commands

Configuration The following example uploads a file to the server.


Examples sftp-client> put a.txt

=>100%
Upload file /a.txt(44 bytes) success

Verification Check whether the uploaded file exists in the server.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.3 get

Use this command to download a File


get remote-file [local-file]

Parameter Parameters Description


Description remote-file The name of the file to be downloaded from the server.
local-file Local file name

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide Run this command to download a file from the server to the local device in the SFTP client mode.

Configuration The following example downloads a file from the server.


Examples sftp-client> get b.txt

=>100%
Download file /b.txt(377 bytes) success

Verification Check whether the downloaded file can be seen in the working directory of the device.

Notification N/A

11-3
Command Reference SFTP Commands

Common
N/A
Errors

Platform
N/A
Description

11.4 quit

Use this command to quit the SFTP client mode.


quit

Parameter Parameters Description


Description N/A N/A

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide Similar to the commands of bye and exit, this command is used to exit the SFTP client mode, or to be precise,
to interrupt the connection between the port and the server.

Configuratio The following example exits the SFTP client mode.


n Examples sftp-client> exit

Verification Check whether the command mode turns back to privilege EXEC mode.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.5 rm

Use this command to delete a file.


rm remote-file

11-4
Command Reference SFTP Commands

Parameter Parameters Description


Description remote-file The name of the file to be deleted.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide Run this command to delete a file from the server in the SFTP client mode.

Configuration The following example deletes a file from the server.


Examples sftp-client> rm a.txt
Do you want to delete remote file [/a.txt]? [yes/no]:y
Removing /a.txt
Received status: Success
File /a.txt sucessfully removed.

Verification Check whether the file has been deleted from the server.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.6 rmdir

Use this command to delete a folder.


rmdir remote-path

Parameter Parameters Description


Description remote-path The folder to be deleted.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

11-5
Command Reference SFTP Commands

Usage Guide In the SFTP client mode, run this command is used to delete a folder from the server.

Configuration The following example deletes a folder from the server.


Examples sftp-client> rmdir A
Do you want to delete remote directory [/A]? [yes/no]:y
Received status: Success
Directory /A sucessfully removed.

Verification Check whether the folder has been deleted from the server.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.7 mkdir

Use this command to create a folder.


mkdir remote-path

Parameter Parameters Description


Description remote-path The name of the folder to be created.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, run this command to create a folder in the server.

Configuration The following example creates a folder.


Examples sftp-client> mkdir W
Received status: Success
New directory /W created..

Verification Check whether the folder has been created on the server.

Notification N/A

11-6
Command Reference SFTP Commands

Common
N/A
Errors

Platform
N/A
Description

11.8 ls

Use this command to display files in a directory.


ls [-a | -l] [remote-path]

Parameter Parameters Description


Description -a Display files and folders in the directory.
-l Display details about files and folders in the form of a list.
remote-path Query a directory name.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, run this command to check the information of the files and folders in the server. If
no parameter is specified, display the names of the files in the working directory.

Configuration The following example displays the information of a folder.


Examples sftp-client> ls -l
-rw-rw-rw 1 root root 52019 Mar 20 19:47 ad_logo2.jpg
-rw-rw-rw 1 root root 35933 Mar 20 19:48 ad_logo3.jpg
-rw-rw-rw 1 root root 93188 Jun 6 20:22 default1.zip
-rw-rw-rw 1 root root 42801 Mar 20 19:46 loginbg.jpg
-rw-rw-rw 1 root root 57872 Mar 19 09:50 tidb.dat

Verification Check the query information displayed in the SFTP client mode.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11-7
Command Reference SFTP Commands

11.9 cd

Use this command to change the working directory.


cd remote-path

Parameter Parameters Description


Description remote-path Directory in the server.

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, run this command to change the working directory of the server.

“cd” is used to return to the previous directory.

Configuration The following example changes the working directory.


Examples sftp-client> cd W
Received status: Success
Current Directory is: /W

Verification Check whether the return succeeded message is displayed.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.10 rename

Use this command to modify a filename.


rename oldname newname

Parameter Parameters Description


Description oldname Original filename
newname New filename

Defaults N/A

11-8
Command Reference SFTP Commands

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, run this command to change the name of the file in the server.

Configuratio The following example changes the filename.


n Examples sftp-client> rename b.txt a.txt
Received status: Success
File /b.txt sucessfully renamed.

Verification Check whether the filename has been changed.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.11 pwd

Use this command to display the working path where the server resides.
pwd

Parameter Parameters Description


Description N/A N/A

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, run this command to display the working directory of the server.

Configuration The following example displays the working directory of the server.
Examples sftp-client> pwd
Remote working directory: /

11-9
Command Reference SFTP Commands

Verification Check whether the working directory is displayed correctly.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.12 help

Use this command to display the help information.


help

Parameter Parameters Description


Description N/A N/A

Defaults N/A

Command SFTP Client Mode


Mode

Default Level 1

Usage Guide In the SFTP mode, run this command to display the help information about supported commands.

Configuration The following example displays the help information about the supported commands.
Examples sftp-client> help
Available commands:
bye Quit sftp
cd path Change remote directory to 'path'
exit Quit sftp
get remote [local] Download file
help Display this help text
mkdir path Create remote directory
put local [remote] Upload file
pwd Display remote working directory
quit Quit sftp
rename oldpath newpath Rename remote file
rm path Delete remote file
rmdir path Remove remote directory
ls [-al] [path] Display remote directory listing
? Synonym for help

11-10
Command Reference SFTP Commands

Verification Check whether the help information is displayed correctly.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11.13 sftp-client source

Use this command to configure the source address for SFTP client.
sftp-client source [ ip address | interface interface-num ]

Use the no form of this command to delete the source address of SFTP client.
no sftp-client source [ ip | interface ]

Parameter Parameters Description


Description address Source IP address
Interface-num Source interface

Defaults N/A

Command Global Configuration Mode


Mode

Default Level 1

Usage Guide Run this command to specify the source address for SFTP client.

Configuration 1: The following example specifies a source address for SFTP client.
Examples Ruijie(config)#sftp-client source ip 192.168.1.1
2: The following example specifies a source interface for SFTP client.
Ruijie(config)# sftp-client source interface mgmt 0

Verification Run the show running-config command to check the configuration.

Notification N/A

Common
N/A
Errors

11-11
Command Reference SFTP Commands

Platform
N/A
Description

11.14 sftp-client topdir

Use this command to configure the top-level directory of the SFTP server.
sftp-client topdir Directory

Use the no form of this command to delete the top-level directory.


no sftp-client topdir

Parameter Parameters Description


Description Directory Working directory

Defaults N/A

Command Global Configuration Mode


Mode

Default Level 1

Usage Guide In the SFTP client mode, if the underlying working directory of the local device is consistent with the
configured one, the top-level directory of the server is flash by default.

Configuration The following example specifies the top level working directory for the server.
Examples Ruijie(config)# sftp-client topdir flash2:

Verification Run the show running-config command to check the configuration.

Notification N/A

Common
N/A
Errors

Platform
N/A
Description

11-12

You might also like