CLI Guide - WatchGuard Technologies

CLI Guide - WatchGuard Technologies CLI Guide - WatchGuard Technologies

watchguard.com
from watchguard.com More from this publisher
25.06.2013 Views

CHAPTER 1: Using the Command Line Interface Deleting text in the Command Line Interface To delete characters to the left of the cursor, press the Backspace key, or press ^h. To delete all characters from the current position of the cursor back to the beginning of the command line, press ^u. Using the CLI to add to or replace existing settings and policies Existing settings can be modified using the WatchGuard CLI in two ways: 1 An existing item can be overwritten/replaced with an entirely new item 2 Additional entries or qualifications can be appended to an existing item Adding entries to an existing item requires use of the “plus” character (+). If a setting or entry already exists in this WatchGuard appliance, add a “plus” character (+) before additional elements to edit that setting. In the following example, an additional host with an IP address of 199.86.77.100 is added to the address group “VPNnet” WG(config)#address VPNnet + -host 199.86.77.100 WG(config)#exit Commit before exit? (Y/N):y WG#_ The named address group object VPNnet now has an additional (host) member with an IP address of 199.86.77.100. Grouping parameters in a command Groups of parameters may be repeated in a command line by surrounding the groups with “curly” brackets ({group1 param1 param2} {group2 param1 param2} etc.). In the fol- 10 WatchGuard Vclass 5.1

Getting started with the WatchGuard CLI lowing example of command line block repetition, the IP addresses, port numbers, and weighting is assigned for three servers in a round-robin load balanced cluster: WG(config)#nat –vip round –server \ {10.10.0.100 80 1} {10.10.0.101 80 2} \ {10.10.0.102 80 3} Note too, that the command line in the above example was “extended” with the use of the backslash (\) character, so that more parameters could be included in the command. Reviewing the recently used commands The WatchGuard CLI stores up to 20 commands (at each level in every mode) in a History buffer, which you can use to view your most recent tasks. • Type history at any prompt to review the last twenty commands applied at that level of the CLI. The CLI will append a number to each line, to indicate its place in the overall chronology. The higher the number, the more recently that command was enacted. (Note that active command history listings may have multiple-digit numbers.) • Type !! (two exclamation points) to recall and re-enact the most recently used command recorded in the buffer for this mode and level. • Type !6 (exclamation point followed by a number) to display and enact the command identified as “6” in the buffer at this CLI level. • Type !! to display the most recent command and to append it with arguments and values as needed. For example, if the last command was “show”, you could type “!!address” to display the current list of address groups. WatchGuard Command Line Interface Guide 11

Getting started with the <strong>WatchGuard</strong> <strong>CLI</strong><br />

lowing example of command line block repetition, the IP<br />

addresses, port numbers, and weighting is assigned for<br />

three servers in a round-robin load balanced cluster:<br />

WG(config)#nat –vip round –server \<br />

{10.10.0.100 80 1} {10.10.0.101 80 2} \<br />

{10.10.0.102 80 3}<br />

Note too, that the command line in the above example was<br />

“extended” with the use of the backslash (\) character, so<br />

that more parameters could be included in the command.<br />

Reviewing the recently used commands<br />

The <strong>WatchGuard</strong> <strong>CLI</strong> stores up to 20 commands (at each<br />

level in every mode) in a History buffer, which you can use<br />

to view your most recent tasks.<br />

• Type history at any prompt to review the<br />

last twenty commands applied at that level of the <strong>CLI</strong>.<br />

The <strong>CLI</strong> will append a number to each line, to indicate<br />

its place in the overall chronology. The higher the<br />

number, the more recently that command was enacted.<br />

(Note that active command history listings may have<br />

multiple-digit numbers.)<br />

• Type !! (two exclamation points) to recall and re-enact<br />

the most recently used command recorded in the<br />

buffer for this mode and level.<br />

• Type !6 (exclamation point followed by a number) to<br />

display and enact the command identified as “6” in the<br />

buffer at this <strong>CLI</strong> level.<br />

• Type !! to display the most<br />

recent command and to append it with arguments and<br />

values as needed. For example, if the last command<br />

was “show”, you could type “!!address” to display the<br />

current list of address groups.<br />

<strong>WatchGuard</strong> Command Line Interface <strong>Guide</strong> 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!