Applies To:Show Versions
- 4.2.10, 4.2.3, 4.2.2, 4.2.1, 4.2.0
Working from the Command Line
Command line overview
You can use the command line to configure the WANJet appliance and perform several commands. While it is not usually necessary to use the command line interface, some administrators may prefer to use the restricted shell in some cases.
For example, you may find that it is easier to perform initial configuration on the WANJet appliance at the command line than it is using the LCD included on some platforms. You can configure the WANJet appliance IP address, subnet mask, gateway, and so on using the config command.
All of the commands available at the command line are also available through the Web UI, after you have completed the initial configuration. Refer to Using commands , for a list of all available commands including where to find them in the Web UI.
If you are having problems with the WANJet appliance (such as getting to the Web UI), you can reboot the appliance. From the command line on the console, you can attempt to boot from the alternate image (rather than the default), bringing up the Web UI and reviewing the WANJet appliance status.
In addition, if you do not have physical access to the WANJet appliance, you can use an SSH program to connect to the command line interface. You can perform initial configuration, as described in Configuring the WANJet appliance from the command line . You can also use SSH for troubleshooting the WANJet appliance. For example, if your corporate firewall is blocking port 10000, you can log on to the command line using the console to troubleshoot that fact. (Port 10000 is the port that the Web UI uses to connect to the WANJet appliance.)
Attaching a computer to the WANJet appliance
You need to attach a computer to the WANJet appliance to access the command line through a serial console. You use a terminal emulator program, such as HyperTerminal, to connect to the WANJet appliance's command line interface.
Different WANJet platforms require different console cables to connect the computer. Refer to Replacing the console cable , for more information on the cable provided for each platform.
To connect a computer to a WANJet appliance
- On a computer or laptop, plug the console cable into the serial port on the computer and tighten the cable screws.
- Plug the other end of the cable into the port labeled Console on the WANJet appliance. The console port is an RJ-45 port on the front of the WANJet 400 and 500, and a serial port on the back of the WANJet 200.
Getting to the command line
You can access the command line in the following ways:
You can use a terminal emulator program to access the command line if working locally using a serial console connected to the WANJet appliance. If you are using a computer running Microsoft® Windows®, you can use HyperTerminal™ or other terminal emulator program. You can also use any SSH program, such as PuTTY, AlphaCom, or SecureCRT® to get to the command line if working locally or remotely.
The following procedure uses HyperTerminal; other terminal emulators require similar setup steps. The procedure To use PuTTY to get to the command line , describes how to use an SSH client to get to the command line.
To use HyperTerminal to get to the command line
- On the connected computer, from the Start menu, choose All Programs, then Accessories, then Communications, and then click HyperTerminal.
The Connection Description popup screen opens.
- In the Name box, type a name for the connection, then click OK.
The Connect To popup screen opens.
- From the Connect using list, select the port where the WANJet appliance is connected to the computer.
The Properties screen for the port opens.
- From the Bits per second list, select 9600.
- From the Data bits list, select 8.
- From the Parity list, select None.
- From the Stop bits list, select 1.
- From the Flow control list, select Xon/Xoff.
- Click OK.
The connection session opens.
If the WANJet appliance login prompt does not appear, press Enter once or twice.
The login prompt appears in the console window.
- At the WANJet login prompt, type the user name you use to log on to the WANJet appliance.
- At the Password prompt, type the password.
The Welcome message is displayed, as shown in Figure 10.1 .
To use PuTTY to get to the command line
- From any computer on a network that can connect to the WANJet appliance, start PuTTY.
The PuTTY Configuration popup screen opens.
- In the Host Name (or IP address) box, type the IP address of the WANJet appliance.
- For the Protocol, select SSH.
- Click Open.
- When connecting to a WANJet appliance for the first time, a message asking you to check the host key appears. To continue, you must click Yes to indicate that you trust the host.
A console window opens.
- At the login as prompt, type the administrator user name (default is admin).
- At the admin@<IP address> password prompt, type the administrator password (default is admin).
The Welcome message is displayed, as shown in Figure 10.2 .
To log off the command line
When you are done working at the command line, you can log off by typing Exit or Logout.
After you have logged on to the command line through your terminal emulator or SSH client, you can use the commands listed in Table 10.1 . All of the commands listed in the table are also available through the Web UI.
The following procedures describe how to use the commands after having logged on to the WANJet appliance in the terminal emulator.
Configuring the WANJet appliance from the command line
You can perform initial configuration of the WANJet appliance from the command line. On platforms that include a liquid crystal display, or LCD, you can configure the addresses there instead. The Quick Start Card included in the shipping box with your WANJet appliance describes the initial hardware installation and setup instructions using the LCD.
To configure the WANJet appliance from the command line
- In the terminal emulator, type config.
You are prompted for new configuration values. Press Enter to keep the current value.
- At the Set WANJet IP prompt, type the IP address of the WANJet appliance (default is 192.168.168.100) and press Enter. This is the IP address you will use to log on to the Web UI (unless you want to use out-of-band management as described in step 6).
- At the Set WANJet NetMask prompt, type the netmask you want to assign to the WANJet appliance (default is 255.255.255.0) and press Enter.
- At the Set WANJet Gateway prompt, type the IP address of the gateway (default is 192.168.168.001) and press Enter.
The media types are displayed.
- To set the media type, type the appropriate alphanumeric code that represents the required speed and duplex setting for the eth0 (LAN) and eth1 (WAN) media types, then press Enter. You can use the default value of Auto Sense (called Auto Negotiate in the Web UI) unless you are familiar with the settings required in your network environment and want to change them.
- If you want to manage the WANJet platform from a separate management subnet, you can optionally set the IP addresses for the WANJet Management IP, WANJet Management NetMask, and WANJet Management Gateway. (These options are blank, by default.) If you set the Management IP address, this is the address you use to log on to the Web UI (instead of the WANJet IP).
- Determine how you want to allow access to the Web UI.
- To allow access from one IP address, at Set the IP of the first machine allowed to access WANJet UI, type the IP address of the only computer that you want to access the Web UI.
- To allow access from multiple IP addresses, leave this blank (the default). In the navigation pane, expand Security and click IP Access Control. See Granting Web UI access , located in Chapter 5.
- To allow access from any browser on any computer in your network (using the correct user name and password), leave this field blank (the default).
When you complete this step, the command line prompt returns and the new configuration information is applied to the WANJet appliance immediately. Values that you changed on the command line are also changed in the Web UI.
Running diagnostic tools from the command line
You can use the ping command to test whether a destination address is reachable across an IP network. For example, if you are having trouble connecting to a second WANJet appliance, you could ping the gateway IP address or the IP address of the other WANJet appliance.
To see the complete syntax of the ping or traceroute commands, type the command with no arguments.
To use ping from the command line
In the terminal emulator, type ping <destination>, where <destination> is the IP address or host name of the computer you are trying to reach. Ping output shows an overview of the command, followed by a list of responses received. It continues to show responses until you stop the command by typing Ctrl + C.
At the end of the command output, you can see ping statistics including the number of packets transmitted and received between the WANJet appliance on which you are working and the destination computer, the percentage of packet loss, the total time it took, and the round trip time between the two computers.
For example, the following command checks to see whether or not the computer at the IP address 192.168.72.254 is responsive. The -c 5 option specifies the count and stops sending requests after five replies are received (or when the deadline is reached). The -w 10 option indicates a deadline of 10 seconds.
ping -c 5 -w 10 192.168.72.254
Type ping with no arguments to see the complete syntax of the command. Refer to documentation on the Linux ping command for details on using all of the options. See Administration Tools , located in Chapter 8, for how to run the command in the Web UI.
To use traceroute from the command line
In the terminal emulator, type traceroute <host>, where <host> is the IP address or host name at the end of the route you are tracing. Traceroute output prints the route that packets take to the host, specifying the IP addresses of all of the computers (hops) in between the WANJet appliance and the host computer.
For example, the following command traces the route from the WANJet appliance you are working on to the computer at IP address 10.1.102.204. In the output, you see a summary of the command, then notice that it takes three hops to get to the IP address, as shown in Figure 10.3 .
Type traceroute with no arguments to see the complete syntax of the command. Refer to documentation on the Linux traceroute command for details on using all of the options. See Administration Tools , located in Chapter 8, for how to run the command in the Web UI.
To use diagnose-connectivity from the command line
In the terminal emulator, type diagnose-connectivity to investigate connectivity issues and display the following information:
Refer to All connectivity diagnostics , located in Chapter 8, for information on running a report from the Web UI that includes this information.
Shutting down or restarting the WANJet appliance from the command line
You can shut down the WANJet appliance or restart it from the command line. Refer to Shutting down and restarting the WANJet appliance , located in Chapter 5, for details on performing these tasks from the Web UI.
To shut down the WANJet appliance from the command line
The WANJet appliance initiates its shutdown sequence. On some platforms, the appliance powers off when the sequence completes. On others, you may need to press the power switch to turn the power off after shutting it down.
To restart the WANJet appliance from the command line
The WANJet appliance stops, then restarts automatically. You need to log on again to access the command line.
Replacing the console cable
The WANJet appliance includes a console cable for attaching a console to the appliance. If this cable is lost, or becomes damaged, you may need to create a new cable. This section describes the included cable, which you can use as a model to create or purchase a new cable.
The WANJet 200 uses a DB-9 null-modem female-to-female serial cable. This type of cable can be readily purchased, if needed.
Figure 10.4 illustrates the DB9 to RJ45 cable connector provided on the WANJet 400 and 500 platforms.
The numbers indicated in Figure 10.4 correspond to the mappings specified in Table 10.2 .