Thursday, March 31, 2011

Basic IOS Commands


Basic IOS Commands

A Cisco router without a startup-config file will enter in the setup mode, which you can exit to access the Command Line Interface (CLI). The setup mode offers the Basic Management and Extended Setup. You can enter the setup mode again with the command setup at the CLI.
Cursor Commands:

Ctrl+A
start of line
Ctrl+F or ->
forward one char
Ctrl+R
redisplays a line
Ctrl+Z
ends configuration mode
Ctrl+E
end of the line
Esc+F
forward one word
Ctrl+U
erases a line
Tab
completes the command
Ctrl+B or <-
back one char
Ctrl+D or bksp
deletes one char
Ctrl+W
erases a word
Ctrl+P
displays the previous command (like arrow up)
Esc+B
back one word

Press return to initiate the user EXEC mode: “>
[whatever]: indicate that whatever is the default or current option.
enable/disable: used to enter or exit the privileged EXEC mode.
logout/exit: to terminate the session. exit goes up one level.

General commands entered in the “#” mode:
clock set hh:mm:ss d month yyyy: sets the current time and date.

Show history/terminal:

Shows last 10 commands (history) or terminal config and history buffer size (terminal).

Terminal history size size:

Sets the history buffer size where size is between 0-256.

Terminal no editing:

Disable or enable the terminal editing keys in the table above.

Show version:

Displays basic IOS and router information, as well as names of config files and boot images, and config register.

Show flash:

Displays the content of the Flash memory, and if only one IOS is in Flash memory, will output the same as show version.

Show startup-config/running-config:

Displays current and NVRAM based configuration files.
copy running-config startup-config: used and required to save the current configuration. Reverse to restore.

Erase startup-config:

Resets the router’s NVRAM. The router will boot in setup mode next time.

Ping/trace/telnet:

Tools provided to verify connectivity. U=Unreachable, ?=Unknown packet received, .=Time down, P=Unreachable port received.

Clear counters interface:

Clears the “show interface” counters on this interface.
show controllers type number: information about the physical interface itself. A space is required between type and number.

Reload:

Reboots the router and reloads the startup-config file.
boot system rom/flash img: indicate what image the router will use during the next boot.
boot system tftp img address: tells the router to use the configuration file img from a tftp server at address.

Config terminal/memory/network:

Used modify the configuration from the running-config, the startup-config or a from a TFTP server.

Commands entered in the Global Configuration “(config)#” mode:

Hostname name: used to define a hostname that is locally significant only.
enable [secret] password password: sets enable or secret mode password. secret will override the non-secure password if set and is encrypted.
[no] service password-encryption: encrypts or not (no) the enable and line passwords.
banner login/motd char: sets the login or message of the day banners, where char is the delimiting character.
interface type [slot/]number[.subinterface]. You can skip the space between the interface type and its number. Certain switches equipped with VIP cards use the syntax interface type slot/pan/number[.subinterface] where pan is the Port Adapter Number.
line (vty number number)/(aux/ console number): used to enter the configuration of the console, aux line or VTY lines (telnet).

Commands entered in the “(config-if)#” mode:
Description name:

Used to define a description for the interface. Name must have underscores rather than spaces. show run and show int 0/n will both show the descriptions set on the interfaces.
no shutdown: used and required to bring up an interface. The interface will show as administratively down.
Ip address ipaddress subnetmask:

Used to set the IP address and subnet mask of an interface.

Clock rate bps:

Sets the clock rate on serial ports.
bandwidth kbps: sets the bandwidth of a serial port for routing and STP protocols to establish the best path.
Commands entered in the “(config-line)#” mode:

Logging synchronous:

Stops console msgs from overwriting command line inputs.

Exec-timeout min sec:

Sets the time-out to min sec for the console.
[no] login: used to set the password when followed by password password. A password is required on the VTY lines before Telnet can be used by default unless no login is used.

Router Memory:
ROM:

Read-Only Memory which stores the bootstrap startup program, the power-on self-test (POST) procedures and a baseline IOS. The ROM also contains the ROM monitor, used for manufacturing testing and troubleshooting, and the Mini-IOS, or RXBOOT, which can be used to bring up an interface and load a Cisco IOS into flash memory.

Flash Memory:

EEPROM (Electronically Erasable Programmable Read-Only Memory) which stores the IOS (Internetwork Operating System).

NVRAM:

Non-Volatile Random Access Memory stores the startup config. A switch has a separate VTP NVRAM which can be deleted with the delete vtp command.

RAM or DRAM:

Random Access Memory - holds dynamic info such as the current configuration file, the current IOS, caching and buffering.

Wednesday, March 30, 2011

IP Addressing



IP Addressing:


Classes:
(n is the network address portion, and h is the host address portion)
Reserved Addresses:
Class A: n.h.h.h, n [0,127] (starts with 0) private: 10/8
Class B: n.n.h.h, n [128.0,191.255] (starts with 10) private: 172.16/12
Class C: n.n.n.h, [192.0.0,223.255.255] (starts with 110) private: 192.168/16
Class D: multicast
Class E: research
Network address of 0s : this network or segment
Network address of 1s : all networks
Host address of 0s : this host
Host address of 1s : all hosts
Address of 1s : all nodes on current network - flooded broadcast
Address of 0s : used by Cisco to designate the default route
Address 127.0.0.1 : this node used for loopback tests.

IP Subnetting:
Information
Formula
Mask
number
Mask
number
Subnet address
yi=(256-number)*i
10000000
128
11111000
248
First host
yi+1
11000000
192
11111100
252
Last host
yi+1-2
11100000
224
11111110
254
Subnet broadcast address
yi+1-1
11110000
240
11111111
255

i [1,ns]
Number of subnets: ns=2(hostbits-x) – 2 , – hostbits is the number of bits reserved for the host in that class (8 for class C, …)
Number of hosts: nh=2x –2
where x is the number of unmasked bits
It is essential to know how to manipulate subnets to create a given number of hosts or subnets. It is also essential to be able to calculate the broadcast address of a given host or network and subnet mask. 

DOD TCP/IP Model


 DOD TCP/IP Model:



Layers
OSI Model
Protocols
(Port or protocol numbers)
Definition
Process
Application
Presentation
Session
Telnet (23)
FTP (21)
TFTP (69)
SMTP (25)
SNMP (161)
DNS (53)
BootP
NFS
DHCP
HTTP (80)
Telephone Network - terminal emulation
File Transfer Protocol – file transfer that also allows authentication, directory browsing
Trivial File Transfer Protocol – stripped down FTP used to backup and restore routers’ config
Simple Mail Transfer Protocol – used to send email. POP3 (110) and IMAP (143) retrieve mail
Simple Network Management Protocol – collects valuable network info by polling devices (UDP)
Domain Name Service – resolves domain names into IP addresses
Bootstrap Protocol – used in diskless stations that receive network info and OS from the server
Network File System – allows different file system to interoperate. Uses UDP.
Dynamic Host Configuration Protocol – enhanced from BootP, can provide IP, subnet, domain, gateway, DNS and WINS information. Uses UDP.
Hyper Text Transfer Protocol – WWW protcol
Host-to-Host
Transport
TCP (6)
UDP (17)
NBP
Transmission Control Protocol – connection-oriented protocol using windowing as flow-control mechanism. Segments are numbered and the number of the last segment received is sent back in the acknowledge message.
User Datagram Protocol – unreliable connection-less protocol that has less overhead than TCP.
Port numbers: used by TCP and UDP. Numbers 0-1023 are well-known port numbers. Numbers 1024 to 65534 can be used by a transmitting host to initiate the communication.
Name Binding Protocol – AppleTalk protocol that matches logical device names to address.
Internet
Network
IP
ICMP (1)
ARP
RARP
Routing
Internet Protocol – four-byte number used to route packets on the internet. Connectionless Protocol
Internet Control Message Protocol – management protocol and message svc provider for IP. Used in “destination unreachable”, “buffer full”, “hop limit” messages, and in ping and trace. Implemented by all TCP/IP hosts.
Address Resolution Protocol – retrieves a MAC address from an IP address
Reverse Address Resolution Protocol – retrieves an IP address from a MAC address
All routing protocols operate at this layer
Network Access
Data-Link
Physical
Ethernet, FastEthernet, Token-Ring, FDDI