Selasa, 18 Maret 2008

Navigating the Terminal Console

After logging into the router you will be presented with the MikroTik RouterOS Welcome Screen and command prompt, for example:

  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK

Mikrotik RouterOS v2.4 (c) 1999-2001 http://www.mikrotik.com/
[MikroTik] >

The command prompt shows the identity name of the router and the current menu level, for example:

[MikroTik] >                          Base level menu
[MikroTik] interface> Interface configuration
[MikroTik] ip firewall static-nat> NAT rule management

The list of available commands at any menu level can be obtained by entering the question mark '?', for example:

[MikroTik] > ?
bridge Bridge settings
driver Driver management
e-mail sending e-mail from router
export print configuration as set of router commands
file Local router file storage.
import Run exported configuration script
interface Interface configuration
ip IP protocol settings
log System logs
password Change password
ping Send ICMP Echo packets
port Serial ports
quit Quit console
redo Redo previosly undone action
restore Restore previously backed up configuration
routing Routing protocol configuration
setup Do basic setup of system
system System information and utilities
tool Diagnostics tools
undo Undo previous action
user User management
[MikroTik] > ip ?
accounting Traffic accounting
address Address management
arp ARP entries management
dhcp-client DHCP client settings
dhcp-server DHCP server settings
dns DNS settings
export print configuration as set of router commands
firewall Firewall management
neighbor Neighbor discovery
packing IP Packet Packing setup
policy-routing Policy routing setup
ppp PPP general settings
queue Bandwidth management
route Route management
service
[MikroTik] >

The list of available commands and menus has short descriptions next to the items. You can move to the desired menu level by typing its name and hitting the [Enter] key, for example:

[MikroTik]>                      Base level menu
[MikroTik]> driver Enter 'driver' to move to the driver level menu
[MikroTik] driver> / Enter '/' to move to the base level menu from any level
[MikroTik]> interface Enter 'interface' to move to the interface level menu
[MikroTik] interface> /ip Enter '/ip' to move to the IP level menu from any level
[MikroTik] ip>

A command or an argument does not need to be completed, if it is not ambiguous. For example, instead of typing 'interface' you can type just 'in' or 'int'. To complete a command use the [Tab] key.

The commands may be invoked from the menu level, where they are located, by typing its name. If the command is in a different menu level than the current one, then the command should be invoked using its full or relative path, for example:

[MikroTik] ip route> print                  Prints the routing table
[MikroTik] ip route> .. address print Prints teh IP address table
[MikroTik] ip route> /ip address print Prints teh IP address table

The commands may have arguments. The arguments have their names and values. Some arguments, that are required, may have no name. Below is a summary on executing the commands and moving between the menu levels:

       Command                               Action
command [Enter] Execute the command
[?] Show the list of all available commands
command [?] Display help on the command and the list of arguments
command argument [?] Display help on the command's argument
[Tab] Complete the command/word. If the input is ambiguous, a
second gives possible options
/ Move up to the base level
/command Execute the base level command
.. Move up one level
"" Enter an empty string
"word1 word2" Enter 2 words that contain a space

You can abbreviate names of levels, commands and arguments.

For the IP address configuration, instead of using the 'address' and 'netmask' arguments, in most cases you can specify the address together with the number of bits in the network mask, i.e., there is no need to specify the 'netmask' separately. Thus, the following two entries would be equivalent:

/ip address add address 10.0.0.1/24 interface ether1
/ip address add address 10.0.0.1 netmask 255.255.255.0 interface ether1

However, if the netmask argument is not specified, you must specify the size of the network mask in the address argument, even if it is the 32-bit subnet, i.e., use 10.0.0.1/32 for address 10.0.0.1 and netmask 255.255.255.255