System Utility and Clear Commands
Use these commands to help troubleshoot connectivity issues and to restore various configurations to their factory defaults.
traceroute
M4250
M4350
Use the traceroute command to discover the routes that IPv4 or IPv6 packets actually take when traveling to their destination through the network on a hop-by-hop basis. Traceroute continues to provide a synchronous response when initiated from the CLI.
The user may specify the source IP address of the traceroute probes. Recall that traceroute works by sending packets that are expected not to reach their final destination, but instead trigger ICMP error messages back to the source address from each hop along the forward path to the destination. By specifying the source address, the user can determine where along the forward path there is no route back to the source address. Note that this is only useful if the route from source to destination and destination to source is symmetric. It would be common, for example, to send a traceroute from an edge router to a target higher in the network using a source address from a host subnet on the edge router. This would test reachability from within the network back to hosts attached to the edge router. Alternatively, one might send a traceroute with an address on a loopback interface as a source to test reachability back to the loopback interface address.
In the CLI, the user may specify the source either as an IPv4 address, IPv6 address, or as a routing interface. When the source is specified as a routing interface, the traceroute is sent using the primary IPv4 address on the source interface. With SNMP, the source must be specified as an address. The source cannot be specified in the web UI.
The switch does not accept an incoming packet that arrives on a routing interface if the packet’s destination address is on one of the out-of-band management interfaces (service port or network port). An example of such a packet is a traceroute response. Similarly, the switch does not accept a packet that arrives on a management interface if the packet’s destination is an address on a routing interface. Thus, it would be futile to send a traceroute on a management interface using a routing interface address as source, or to send a traceroute on a routing interface using a management interface as source. When sending a traceroute on a routing interface, the source must be that routing interface or another routing interface. When sending a traceroute on a management interface, the source must be on that management interface. For this reason, the user cannot specify the source as a management interface or management interface address. When sending a traceroute on a management interface, the user should not specify a source address, but instead let the system select the source address from the outgoing interface.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Default |
count: 3 probes interval: 3 seconds size: 0 bytes port: 33434 maxTtl: 30 hops maxFail: 5 probes initTtl: 1 hop |
| Format | traceroute {ip-address | [ipv6] {ipv6-address | hostname}} [initTtl initTtl] [maxTtl maxTtl] [maxFail maxFail] [interval interval] [count count] [port port] [size size] [source {ip-address | ipv6-address | unit/slot/port}] |
| Mode | Privileged EXEC |
Using the options described below, you can specify the initial and maximum time-to-live (TTL) in probe packets, the maximum number of failures before termination, the number of probes sent for each TTL, and the size of each probe.
| Parameter | Description |
|---|---|
| ip-address | The ip-address value should be a valid IP address. |
| ipv6-address | The ipv6-address value should be a valid IPv6 address. |
| hostname | The hostname value should be a valid hostname. |
| ipv6 | The optional ipv6 keyword can be used before ipv6-address or hostname. Giving the ipv6 keyword before the hostname tries to resolve it to an IPv6 address. |
| initTtl | Use initTtl to specify the initial time-to-live (TTL), the maximum number of router hops between the local and remote system. Range is 0 to 255. |
| maxTtl | Use maxTtl to specify the maximum TTL. Range is 1 to 255. |
| maxFail | Use maxFail to terminate the traceroute after failing to receive a response for this number of consecutive probes. Range is 0 to 255. |
| interval | Use the optional interval parameter to specify the time between probes, in seconds. If a response is not received within this interval, then traceroute considers that probe a failure (printing *) and sends the next probe. If traceroute does receive a response to a probe within this interval, then it sends the next probe immediately. Range is 1 to 60 seconds. |
| count | Use the optional count parameter to specify the number of probes to send for each TTL value. Range is 1 to 10 probes. |
| port | Use the optional port parameter to specify destination UDP port of the probe. This should be an unused port on the remote destination system. Range is 1 to 65535. |
| size | Use the optional size parameter to specify the size, in bytes, of the payload of the Echo Requests sent. Range is 0 to 65507 bytes. |
| source | Use the optional source parameter to specify the source IP address or interface for the traceroute. |
The following are examples of the CLI command.
Command example:
The following example shows that the traceroute is a success:
(NETGEAR Switch) # traceroute 10.240.10.115 initTtl 1 maxTtl 4 maxFail 0 interval 1 count
3 port 33434 size 43
Traceroute to 10.240.10.115 ,4 hops max 43 byte packets:
1 10.240.4.1 708 msec 41 msec 11 msec
2 10.240.10.115 0 msec 0 msec 0 msec
Hop Count = 1 Last TTL = 2 Test attempt = 6 Test Success = 6
Command example:
The following example shows that the IPv6 traceroute is a success:
(NETGEAR Switch) # traceroute 2001::2 initTtl 1 maxTtl 4 maxFail 0 interval 1 count 3
port 33434 size 43
Traceroute to 2001::2 hops max 43 byte packets:
1 2001::2 708 msec 41 msec 11 msec
The above command can also be executed with the optional ipv6 parameter as follows:
(NETGEAR Switch) # traceroute ipv6 2001::2 initTtl 1 maxTtl 4 maxFail 0 interval 1 count
3 port 33434 size 43
Command example:
The following example shows that the traceroute fails:
(NETGEAR Switch) # traceroute 10.40.1.1 initTtl 1 maxFail 0 interval 1 count 3
port 33434 size 43
Traceroute to 10.40.1.1 ,30 hops max 43 byte packets:
1 10.240.4.1 19 msec 18 msec 9 msec
2 10.240.1.252 0 msec 0 msec 1 msec
3 172.31.0.9 277 msec 276 msec 277 msec
4 10.254.1.1 289 msec 327 msec 282 msec
5 10.254.21.2 287 msec 293 msec 296 msec
6 192.168.76.2 290 msec 291 msec 289 msec
7 0.0.0.0 0 msec *
Hop Count = 6 Last TTL = 7 Test attempt = 19 Test Success = 18
Command example:
The following example shows that the IPv6 traceroute fails:
(NETGEAR Switch)# traceroute 2001::2 initTtl 1 maxFail 0 interval 1 count 3 port 33434
size 43
Traceroute to 2001::2 hops max 43 byte packets:
1 3001::1 708 msec 41 msec 11 msec
2 4001::2 250 msec 200 msec 193 msec
3 5001::3 289 msec 313 msec 278 msec
4 6001::4 651 msec 41 msec 270 msec
5 0 0 msec *
Hop Count = 4 Last TTL = 5 Test attempt = 1 Test Success = 0
clear config
M4250
M4350
This command resets the configuration to the factory defaults without powering off the switch. When you issue this command, a prompt appears to confirm that the reset should proceed. When you enter y, you automatically reset the current configuration on the switch to the default values. It does not reset the switch.
You can also reset the configuration for a specific interface only.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | clear config [interface {unit/slot/port | lag lag-intf-num | loopback loopback-id | vlan vlan-id}] |
| Mode | Privileged EXEC |
clear counters
M4250
M4350
This command clears the statistics for a specific port, for all ports, for a specific VLAN, for a specific LAG, or for the entire switch, based on the argument.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | clear counters {unit/slot/port | all | vlan vlan-id | lag lag-intf-num} |
| Mode | Privileged EXEC |
clear mac-addr-table
M4250
M4350
This command clears the dynamically learned MAC addresses for all ports, for a specific port, for a specific VLAN, or for the entire switch, based on the argument. You can also clear a specific MAC address.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Format | clear mac-addr-table {all | vlan vlan-id | interface unit/slot/port | macaddr [macmask]} |
| Mode | Privileged EXEC |
| Parameter | Description |
|---|---|
| all | All dynamically learned forwarding database entries in the forwarding database table. |
| vlan-id | The dynamically learned forwarding database entries for the VLAN ID. |
| unit/slot/port | The dynamically learned forwarding database entries for the interface. |
| macaddr macmask |
The dynamically learned forwarding database entries that match the range specified by the MAC address and MAC mask. If you do not specify the MAC mask, only the specified MAC address is removed from the forwarding database table. |
clear igmpsnooping
M4250
M4350
This command clears the tables managed by the IGMP Snooping function and attempts to delete these entries from the Multicast Forwarding Database.
| Format | clear igmpsnooping |
| Mode | Privileged EXEC |
clear ip access-list counters
M4250
M4350
This command clears the counters of all or a specific IP ACL (which you can identify by either its ID or its name) or specific IP ACL rule.
| Format | clear ip access-list counters [{acl-id | acl-name} [rule-id]] |
| Mode | Privileged EXEC |
clear mac access-list counters
M4250
M4350
This command clears the counters of all or a specific MAC ACL or specific MAC ACL rule.
| Format | clear mac access-list counters [acl-name [rule-id]] |
| Mode | Privileged EXEC |
clear ipv6 access-list counters
M4250
M4350
This command clears the counters of all or a specific IPv6 ACL or IPv6 ACL rule.
| Format | clear ipv6 access-list counters [acl-name [rule-id]] |
| Mode | Privileged EXEC |
clear traplog
M4250
M4350
This command clears the trap log.
| Format | clear traplog |
| Mode | Privileged EXEC |
clear vlan
M4250
M4350
This command resets VLAN configuration parameters to the factory defaults. When the VLAN configuration is reset to the factory defaults, GVRP and MVRP might be affected in the following situation:
- Static VLANs are deleted.
- GVRP is restored to the factory default as a result of handling the VLAN RESTORE NOTIFY event. Because GVRP is disabled by default, GVRP becomes disabled and all of its dynamic VLANs are deleted.
- MVRP is restored to the factory default as a result of handling the VLAN RESTORE NOTIFY event. Because MVRP is enabled by default, any VLANs that were already created by MVRP are unaffected. However, for platforms on which MVRP is disabled by default, the MVRP behavior must match GVRP. That is, MVRP is disabled and the MVRP VLANs are deleted.
| Format | clear vlan |
| Mode | Privileged EXEC |
logout
M4250
M4350
This command closes the current telnet connection or resets the current serial connection.
| Format | logout |
| Modes |
Privileged EXEC User EXEC |
ping
M4250
M4350
Use this command to determine whether another computer is on the network. Ping provides a synchronous response when initiated from the CLI and Web interfaces.
To specify an actual interface or port, do the following:
- For an M4250 series switch, use the argument slot/port.
- For an M4350 series switch, use the argument unit/slot/port, as shown in the command format.
| Default |
The default count is 1. The default interval is 3 seconds. The default size is 0 bytes. |
| Format | ping {ip-address | ipv6addr | hostname | ipv6 {ipv6-address | hostname | {interface {unit/slot/port | vlan vlan-id | loopback loopback-id | serviceport} link-local-address}} [count count] [interval seconds] [size size] [source {ip-address | ipv6addr | unit/slot/port | vlan vlan-id | loopback loopback-id | serviceport}] [outgoing-interface {unit/slot/port | vlan vlan-id | serviceport}] |
| Modes |
Privileged EXEC User EXEC |
Using the options described below, you can specify the number and size of echo requests and the interval between echo requests.
| Parameter | Description |
|---|---|
| ip-address | The IPv4 address. You can set an IPv4 address as the destination and another IPv4 address as the source. |
| ipv6address (or ipv6-address) | The IPv6 address. You can set an IPv6 address as the destination and another IPv6 address as the source. |
| hostname | The host name. You can set a host name as the destination. If you use the ipv6 keyword, the host name resolves to an IPv6 address. Otherwise, the host name resolves to an IPv4 address. |
| ipv6 | The optional keyword ipv6 can be used before the ipv6-address or hostname argument. Using the ipv6 optional keyword before hostname tries to resolve it directly to the IPv6 address. Also used for pinging a link-local IPv6 address. |
| count count | Use the count parameter to specify the number of ping packets (ICMP Echo requests) that are sent to the destination address. The range for count is 1 to 15 requests. |
| interval seconds | Use the interval parameter to specify the time between Echo Requests, in seconds. Range is 1 to 60 seconds. |
| size size | Use the size parameter to specify the size, in bytes, of the payload of the Echo Requests sent. Range is 0 to 65507 bytes. |
| interface |
Use the interface keyword to ping a link-local IPv6 address over an interface. The interface can be an interface number, a VLAN ID, a loopback ID, or the service port. You can also use the interface keyword to set the source interface. |
| link-local-address | The link-local IPv6 address to ping over an interface. |
| source | The source IPv4 or IPv6 address or interface to use when sending the echo requests packets. The interface can be an interface number, a VLAN ID, a loopback ID, or the service port. |
| outgoing-interface | The outgoing interface to use when sending the echo requests packets. The outgoing interface can be an interface number, a VLAN ID, or the service port. |
The following are examples of the CLI command.
Command example:
The following example shows that the IPv4 ping is a success:
(NETGEAR Switch) #ping 10.254.2.160 count 3 interval 1 size 255
Pinging 10.254.2.160 with 255 bytes of data:
Received response for icmp_seq = 0. time = 275268 usec
Received response for icmp_seq = 1. time = 274009 usec
Received response for icmp_seq = 2. time = 279459 usec
----10.254.2.160 PING statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (msec) min/avg/max = 274/279/276
Command example:
The following example shows that the IPv6 ping is a success:
(NETGEAR Switch) #ping 2001::1
Pinging 2001::1 with 64 bytes of data:
Send count=3, Receive count=3 from 2001::1
Average round trip time = 3.00 ms
Command example:
The following example shows that the IPv4 ping fails because the destination cannot be reached:
(NETGEAR Switch) # ping 192.168.254.222 count 3 interval 1 size 255
Pinging 192.168.254.222 with 255 bytes of data:
Received Response: Unreachable Destination
Received Response :Unreachable Destination
Received Response :Unreachable Destination
----192.168.254.222 PING statistics----
3 packets transmitted,3 packets received, 0% packet loss
round-trip (msec) min/avg/max = 0/0/0
Command example:
The following example shows that the IPv4 ping fails because the request times out:
(NETGEAR Switch) # ping 1.1.1.1 count 1 interval 3
Pinging 1.1.1.1 with 0 bytes of data:
----1.1.1.1 PING statistics----
1 packets transmitted,0 packets received, 100% packet loss
round-trip (msec) min/avg/max = 0/0/0
Command example:
The following example shows that the IPv6 ping fails:
(NETGEAR Switch) #ping ipv6 2001::4
Pinging 2001::4 with 64 bytes of data:
Send count=3, Receive count=0 from 2001::4
Average round trip time = 0.00 ms
ip scp server enable
M4250
M4350
This command enables SCP server functionality for SCP push operations on the switch, which allows files to be transferred from the host device to the switch using the SCP protocol. During an SCP file transfer operation, the management operations on the switch are blocked. After the completion of file download to the switch, the switch performs file validations similar to other download operations executed using the copy command.
To allow the SCP file transfers from the host system to the switch, you must enable the SCP server on the switch.
| Default | Disabled |
| Format | ip scp server enable |
| Mode | Privileged EXEC |
The transfer is initiated using the CLI on the host system, and not from the switch CLI. The following examples show the syntax for SCP push commands executed on a PC host for configuration and firmware images:
- scp <config file> user@<scp server IP>:startup-config
- scp <config file> user@<scp server IP>:backup-config
- scp <config file> user@<scp server IP>:factory-defaults
- scp <config file> user@<scp server IP>:<scriptfile.scr>
- scp <image file> user@<scp server IP>:active
- scp <image file> user@<scp server IP>:backup
no ip scp server enable
This command resets the SCP server functionality for SCP push operations on the switch to the default value (disabled).
| Format | no ip scp server enable |
| Modes | Privileged EXEC |
quit
M4250
M4350
This command closes the current telnet connection or resets the current serial connection. The system asks you whether to save configuration changes before quitting.
| Format | quit |
| Modes |
Privileged EXEC User EXEC |
reload (Privileged EXEC)
M4250
M4350
This command resets the switch without powering it off. Reset means that all network connections are terminated and the boot code executes. The switch uses the stored configuration to initialize the switch. You are prompted to confirm that the reset should proceed. The LEDs on the switch indicate a successful reset.
| Format | reload |
| Mode | Privileged EXEC |
reload configuration
M4250
M4350
This command gracefully reloads the configuration. If you do not specify a script name, the switch reloads the existing startup-config file. If you specify a script name, you must include the extension.
| Format | reload configuration [scriptname] |
| Mode | Privileged EXEC |
write memory
M4250
M4350
Use this command to save running configuration changes to NVRAM so that the changes you make will persist across a reboot. This command is the same as copy system:running-config nvram:startup-config. Use the confirm keyword to directly save the configuration to NVRAM without prompting for a confirmation.
| Format | write memory [confirm] |
| Mode | Privileged EXEC |
dying-gasp
M4250
M4350
This command causes a dying-gasp notification to be sent through the syslog if the switch loses power or resets abruptly. The switch reset might be due to an unexpected software failure, a LOG_ERROR, or a user-triggered switch reload. The Dying Gasp feature also notifies dying gasp events as an SNMP trap to the trap receiver.
The ability to send a dying-gasp notification on loss of power depends on the platform hardware capability. The switch hardware must be able to supply back power for approximately 300 ms to send the dying gasp notification after the abrupt power loss or reset occurs.
| Format | dying-gasp primary {syslog | snmptrap} secondary {syslog | snmptrap} |
| Mode | Global Config |
| Parameter | Description |
|---|---|
| primary | The Dying Gasp primary notification |
| secondary | The Dying Gasp secondary notification |
| syslog | Logs an entry in the syslog |
| snmptrap | Sends an SNMP trap |
show dying-gasp status
M4250
M4350
This command displays the dying gasp configuration status.
| Format | show dying-gasp status |
| Mode | Privileged EXEC |
| Parameter | Description |
|---|---|
| Dying Gasp Primary Mode |
Identifies the primary notification mode, which can be one of the following:
|
| Dying Gasp Secondary Mode |
Identifies the secondary notification mode, which can be one of the following:
|