SIDEBAR ON CISCO BGP COMMANDS
There are two basic modes you can be in on a Cisco: Console/vty (virtual
terminal) command-line and "config mode". Usually it's clear which commands
belong where, but do keep in mind which mode you're in. The prompt will
usually tell you where you are.
Notes:
-
The most important thing when learning is to explore. Just type the
? command at any prompt to see the possibilities. For example,
?.
at the top level. Then, sho ?, then sho ip ?, etc...
This is how
most people find out new things - it's a bit easier than reading all of
the documentation. You can do the same thing with "set" commands in
configuration mode, but it's better to not set things routing-related that
you're not familiar with.
-
To interrupt hanging or long command, use Control-6 or Shift-Control-6.
You can change this if you want to but it's probably better not to.
-
Some Cisco commands (write, reload, ...) may ask you to confirm something.
Generally, hitting return at a [confirm] prompt means "yes".
-
Below, we use abbreviated versions of some commands. For example,
sho ver is really show version. Most people don't type out the whole
commands. You can abbreviate as long as abbreviating doesn't create
ambiguity. The Cisco will say % Ambiguous command: ... if
you've chopped a command too short.
Non-Configuration-Mode commands
enable
Like "su" in Unix - gives you God-level privileges. Without it you're
pretty much limited to "show" commands - and you can't do sho run or
sho conf either. And conf term or conf net is definitely right out.
sho ver
Shows you the hardware and software versions being run; a summary of
interfaces; and why the router was last started (or crashed).
sho proc
If your CPU (processor) utilization is over 70-80% you're in trouble;
start looking for ways to streamline your configuration and possibly
cut down on filtering or move some of the CPU load or traffic to another
router.
sho mem
This one is *very* important if you're running on a 4x00 with less
than 32mb or a 70x0, 720x, or 75xx with less than 64mb of ram - or
on any 2501 or older/smaller box. The "Free" column is the critical one.
sho run
Shows you the "running configuration": what state the router is actually in.
sho conf
Shows you the configuration in eeprom or flash: what state the router will
be in when you reload it.
sho int interface-name
Show you all sorts of information about an interface. The IP address
(if any); any description; input and output packets and bytes; errors
on the interface; interface resets; and many other goodies we'll go into
in the future.
reload
Restarts the router; it'll ask you to confirm - and whether to save any
changes you might have made to the configuration.
write
Writes any changes you might have made (copies the running configuration
to the startup configuration).
write net
Writes the running configuration to a remote tftp server.
sho ip route
Without any parameters, this will show you all routes in the
IP routing table.
sho ip route x.y.z.q
Shows routing information on one or more of the most specific routes that
contain that IP address - however, if you enter an IP address for which no
route but the default route (0.0.0.0) exists, the default route will not be
shown.
sho ip route x.y.z.q netmask longer-prefixes
Shows a list of routes that are within the IP range specified by x.y.z.q
as a starting point and netmask as a length. The longer-prefixes
keyword tells it to find all routes that fall in that range - of all
specificities (prefix length = specificity).
sho ip bgp
Without any parameters, this will show you all routes heard
via BGP.
sho ip bgp x.y.z.q
Shows routing information on one or more of the most specific BGP routes that
contain that IP address - if you enter an IP address for which no route
but the default route (0.0.0.0) exists, the default route will not be
shown.
sho ip bgp x.y.z.q netmask longer-prefixes
Shows a list of BGP routes that are within the IP range specified by x.y.z.q
as a starting point and netmask as a length. The longer-prefixes
keyword tells it to find all BGP routes that fall in that range - of all
specificities (prefix length = specificity).
sho ip bgp reg regexp
This shows you all BGP routes matching the regular expression regexp.
For example, sho ip bgp reg _1_ shows you all BBN routes.
sho ip bgp ?
You may want to explore the other sho ip bgp commands. Typing
sho ip bgp ? will get you a list of them. You can't do any harm
with a sho command...
sho ip bgp summ
conf term
enter configuration commands
end
While in configuration mode, enter all of your configuration commands.
When done, enter end and return - or hit ^Z.
conf net
Loads a sequence of commands (not necessarily a whole configuration file)
from a remote tftp server.
Configuration-Mode Commands
no
The no command is used *before* any other configuration-mode command -
it's the way that you tell a Cisco to unset a setting. For example,
no ip route x.y.z.q netmask destination. no router bgp ASN
would be fairly disastrous, though - it would take out the "router bgp"
clause and all of the neighbor and other statements underneath it. To
delete a neighbor and re-enter it, use router bgp ASN
and then no neighbor x.y.z.q.
ip route x.y.z.q netmask destination [metric]
The metric tag is optional (which is why it's shown in brackets).
The netmask used to be optional, but no longer is - and even on
routers where it is optional it never hurts to be specific! The
"ip route" command installs a route to the IP space starting at
x.y.z.q and spanning the length specified by netmask, pointed towards
destination as a next-hop. destination can be an interface name
or IP address.
interface interface-name
Many configuration commands are applied to interfaces; to see some of them,
type int s0 (or whatever an interface is on your router) and do a ?.
Then do an ip ?; then continue poking around without actually doing
anything...
Configuration-mode commands are either global or interface-specific.
If you enter an interface-specific commands at the global configuration
level the router won't take it (there's no "default" interface to apply
commands to). If you enter a global configuration command when in
interface configuration mode the router will just pop out of interface
configuration and into global configuration.
router bgp ASN
This starts the "BGP clause" in your router; things like network,
neighbor, aggregate-address, and other BGP-related commands are
entered after you put the router into BGP configuration mode. Just
as with interface configuration mode, if you enter a global-level
command (such as ip route ...) it'll pop you out of BGP configuration
mode.
end
This command ends configuration mode and returns you to the command
prompt. Changes are not saved unless you use the "write" command.
There are many other configuration commands, some of which are shown
in the BGP Part I document. We'll be going into more of them in the near
future when we talk more about configuring Ciscos.