Cisco Router Configuration Tutorial
http://www.lelew.com/
It is contemplated that it may be displayed in bold when introducing important terms and concepts. The commands contained in the text are displayed in a constant, and all names or addresses for examples are also like this, and should not be used in your actual network. Do not enter the name or address when you configure your system. Finally, in some examples, the IP address may be represented by XX.xx.xx.xx or aa.bb.cc.dd in the command of the command. In fact, these strings will never use when configuring your system. The conventions of this article point out that you should replace the specified place to an appropriate IP address.
1. This document covers something
There are several ways to configure Cisco routers. The configuration can be done by the TFTP server; can be done by the menu interface provided at startup; and can be done by the menu interface provided by the SETUP command; it can be done by the configuration saved to the memory. This tutorial does not overwrite these methods, which only covers the configuration that is performed by the iOS command line interface.
Note: This tutorial does not cover the router and it wants to route the network in a physical connection, which only covers the operating system configuration.
1.1 Reasons for using the command line
There are two reasons for using the command line interface without using the menu drive interface: one is speed. Once you have taken time to understand the command line command, you can complete a lot of operations more quickly than by using the menu. Basically, this is true relative to all command lines of the menu. For the command line interface of Cisco iOS, it is a particularly effective thing, and Cisco IOS is a standard that spans all Cisco routers. Second, a single interface can be configured without interrupting the services on other interfaces. Depending on the definition, the router has multiple interfaces. For example, in the Cisco 7200 Series router, the router has multiple ports, and each port has several hot swap modules. These modules can be individually configured via the command line to be a very valuable technology.
1.2 document structure
The first part of this article describes the command mode of iOS and the commands necessary for the Cisco router basic configuration. The second part of the document will demonstrate the usage of these commands in a case study. A case study is the actual configuration completed by the author of this article.
2. Ready
At the beginning, you may configure your router through the terminal. If the router has been configured, at least one port has been configured with the IP address, and if it is physically connected to the network, you may be able to Telnet to the router, configure it over the network. If the router has not been configured, you will have to connect directly to it with a terminal and a serial cable. For any Windows host, you can easily connect the router with a Hyperterminal. Plug the serial port into the serial port (COM) on the PC and insert the other end into the console port on the Cisco router. Start the super terminal, tell it the COM port used and click OK. Set the connection rate to 9600 baud, click OK. If the router is not turned on, start it.
If you want to configure the router by the Linux host, you want to run Seyon or Minicom. At least one of them, maybe two are in your Linux distribution kit.
Typically, you need to knock the Enter key to view the prompts made by the router. If the router has not been configured, it looks like this:
Router>
If the router is configured in advance, it looks like this:
Hostname of Router>
If you just turn on the router, it will ask you later if you want to start the initial configuration, answer NO. If you answer Yes, it will bring you into the menu interface. So answer NO.
2.1 mode (MODES)
The Cisco iOS command line interface is the concept of modes (MODES). When configuring the router, you have to enter and exit between several different modes, and the mode determines the command used. Each mode has a set of commands that can be used for this mode, and some of them can only be used for this mode. In any mode, the input question mark will display a list of commands for this mode. Router>?
2.2 Non-privileged and privileged model
When you connect the router for the first time and provide a password (if necessary), enter the exec mode. In the first mode, you can run the command by the command line. Here you can use non-privileged orders such as ping, telnet and rlogin. You can also use a set of show commands to get relevant system information. In the non-privileged mode, you can use commands such as Show Version to display the version number of the iOS that the router is running. Enter SHOW? All show commands for the current mode will be displayed.
Router> show?
You have to configure the router to enter the privilege mode. You can do this by using the enable command. Privilege mode is usually password protection unless the router is not configured. You have the choice of password protection privilege model, but you will recommend that you choose a privileged mode with password protection. After you run the command enable and provide your password, you will enter privilege mode.
In order to help users see the mode where they are, each time you enter different modes, the command line's prompt will change. When you switch from non-privileged mode to privilege mode, the prompt is:
Router>
become
Router #
This may not be the best way to handle, if there are only two modes. In fact, there are many models that may be absolutely necessary. Pay close attention to tips at all times.
There are many sub-patterns in privileged models. In this article, I will not keep up with the Cisco term in this mode. Frankly said, I think my explanation is clearer. Cisco describes two modes, non-privileged modes, and privilege patterns, and then used in privileged mode. My reason is very clear, I have to understand if you only consider many sub-models of privilege mode. Privilege mode, I also called it to make a parent mode. Once you enter the privileged mode (parent mode), the prompt is ended as a well number (#). Only after entering the privileged mode, you can enter the number of many models. The prompt method for each mode is:
Router #
All child mode still ends with #, they are included in privileged modes. Most modes have their own child mode. Once you enter the privileged mode, you have the right to access all configuration information. The configuration information can be selected by iOS, or is provided directly by the parent mode, or by one of the sub-patterns.
3. Configuration
If you just turn on the router, it will be completely unconfigured. If it has been configured, you may want to see its current configuration. Even if it has never been configured, you should be familiar with the usage of the show command before starting to configure the router. After running the command enable, enter the information you have displayed by running a few show commands. Remember, command show? All show commands available for current mode will be displayed. Simply test the following command:
Router # show interfacesRouter # show ip protocolsrouter # show ip routerouter # show IP ARP
When you enter the privileged mode by using the command enable, you are in the top-level mode of the privilege mode, that is, the "parent mode" that this article is considered. In this top or parent mode, you can display a lot of information about the router. As you know now, you can use the show command to do this. Here you can understand whether the interface configuration and interface is on or off. You can display information about the IP protocol used, such as dynamic routing protocols. You can view routes and ARP tables, which is a very important option. When configuring the router, you have to enter the various submersible to set the option, then return to the parent mode to display the command results. You have to return to the parent mode to enter other submersers. In order to return to the parent mode, press the CTRL-Z key. At this time, any command you just run will affect and bring you back into the parent mode.
3.1 Sharing Configuration (config)
Configuring any feature of the router must enter the configuration mode, which is the first sub-mode of the parent mode. In the parent mode, run the config command.
Router # configRouter (config) #
As shown above, the change in the prompt indicates the mode you now.
In configuration mode, you can set the extensive system option, also known as "shared configuration." For example, in order to easily identify your router, name your router is a good idea. In the configuration mode, you can do this with the hostname command.
Router (config) #hostname ExampleEnameExamplename (config) #
As shown above, when you use the HostName command to set the host name, the prompt is changed immediately, replacing the router with ExampleName. (Note: Name the router with an organization of naming scheme is a good idea.)
Another useful command running by configuration mode is a command to specify the DNS server used by the router:
Examplename (config) #ip name-server aa.bb.cc.ddexamplename (config) # ctrl-zexamplename #
This is also where you set the password for the privileged mode.
Examplename (config) #ENABLE SECRET EXAMPLEPASSWORDEXAMPLENAME (config) # ctrl-zexamplename #
Until you press the CTRL-Z button (or enter EXIT until you reach the parent mode), the command has not affected. You can enter the configuration mode, run a few different commands, and then press the CTRL-Z key to activate all commands. Each time you press the CTRL-Z button to return to the parent mode and prompt:
Examplename #
Here, you can use the show command to verify the effect of your commands you run in the config mode. In order to verify the result of the ip name-server command, run the show host.
3.2 Configure the interface
The named Cisco interface is straight, and the individual interface is specified by this appointment:
Media Type Slot # / Port #
"Medium Type" refers to a medium type of ports such as Ethernet, Token Ring, FDDI, serial port. The number of slots applies only to routers that provide you with a slot that can be installed. These modules include ports of several specific media, and 7200 series is an example. These modules are even hot-swappable. You can remove a module from your slot and use a different module instead of it without interrupt the service provided by other modules installed in the router. These slots are numbered in the router.
The ports involved in the number of ports are related to other ports in the module. The number of numbers is from left to right, all numbers start from 0, not 1.
For example, Cisco 7206 is a 7200 series router with 6 slots. One interface mentioned is the third port of the Ethernet module installed on the sixth slot, which should be an Ethernet 6/2 interface. Therefore, in order to display information of the interface, you can use the command: Examplename # show interface Ethernet 6/2
If your router has no slot, such as 1600, then the composition of the interface name is only:
Media Type Port #
E.g:
Examplename # show interface serial 0
Here is an example of configuring a series of ports with an IP address:
ExampleName # configExampleName (config) #interface serial 1 / 1ExampleName (config-if) #ip address 192.168.155.2 255.255.255.0ExampleName (config-if) #no shutdownExampleName (config-if) # ctrl-ZExampleName #
Then verify the configuration:
EXAMPLENAME # show interface serial 1/1
Note the no shutdown command. An interface may still be "turned off" on the correct configuration and physical connection. In this case, it does not work. The command that causes an interface to manage is shutdown.
Examplename (config) #interface serial 1 / 1examplename (config-if) #SHUTDOWNEXAMPLENAME (config-if) # ctrl-zexamplename # show interface Serial 1/1
In Cisco iOS, the opposite situation or deleting any command is to simply put NO in front of the command. For example, if we want to cancel IP addresses that have been assigned to Interface Serial 1/1:
Examplename (config) #interface serail 1 / 1examplename (config-if) #NO IP address 192.168.155.2 255.255.255.0examplename (config-if) Ctrl-Zexamplename # show interface Serial 1/1
Most interfaces configured for the LAN (LAN) may only be allocated network layer addresses and determine the interfaces that are not turned off. It usually does not require a predetermined data chain package. Note that the appropriate data chain package for WAN (WAN) is usually necessary, such as 中继 and ATM. The series interface defaults to HDLC. The discussion of the data chain protocol is exceeded. Want to know more details You need to find the iOS command package.
3.3 routing
On the Cisco router, IP routes are automatically activated. On your router, if the IP routing is always closed, you can return to the Config mode with the command ip routing.
Examplename (config) #ip routingexamplename (config) # Ctrl-z
There are two main ways to let the router know where the package is sent, and the network management can specify static routes, or the router can know the route by using the dynamic routing protocol (Dynamic Routing Protocol).
Today, static routing is usually used on a very simple network or in special situations where you must use static routes. In order to create a static route, the NMS informed the router operating system, and any network communication traffic that flows to a specified network layer address should be forwarded to another similar specified network layer address. In Cisco iOS, do this with the IP Route command. Examplename # configXamplename (config) #ip route 172.16.0.0 255.255.255.0 192.168.150.1Examplename (config) # Ctrl-Zexamplename # show ip route
About this example two things. First, the package target address must contain the subnet mask of the target network. Second, the forwarded IP address is the address specified by the next router along this path to the target. This is a majority of generic methods for installing static routing, while there is only one way to cover this article. However, you should know that there are other methods.
Dynamic routing protocols, running on the connected router, enabling those routers to share routing information. This allows the router to know the route and can take them. In the network topology, the advantage of this method is that the router can adapt to changes. If the route is physically deleted, or the adjacent router is shut down, the routing protocol searches for a new route. The route protocol can even be dynamically selected between possible routing based on network congestion or network reliability.
There are many different routing protocols that use different variables, which is known as "metrics" and decides to apply the route. Unfortunately, the router needs to run the same agreement as the adjacent router. However, many routers can run multiple protocols. Also, many protocols are designed to be able to pass routing information to other routing protocols, which is called "redistribution". The author did not attempted to have experience in reassignment. There is an iOS redistribution command. You can study if you think this is what you need. The case study of the partnership of this paper describes an optional scheme for processing different routing protocols in some circumstances.
The route protocol is a complex topic. The content of this article is just a brief description of them. To understand the routing protocol, there are many related resources available. About this topic is an excellent information resource is a Cisco site http://www.cisco.com.
This article describes how to configure routing information protocols (RIPs) for Cisco Routers. Through the command line, we must clearly inform the router to use the protocol to use, what the network protocol will be routed.
ExampleName # configExampleName (config) #router ripExampleName (config-router) #network aa.bb.cc.ddExampleName (config-router) #network ee.ff.gg.hhExampleName (config-router) # ctrl-ZExampleName # show ip protocols
Now, when you run the Show IP Protocols command, you will see an entry describing the RIP configuration.
3.4 Save Configuration
Once you configure routing and individual interfaces on the router, your router should be able to route communication. Give a moment to talk to its adjacent routers, then run the Show IP Route and Show IP ARP. In these routings learned through the routing protocol, there should be an entry now.
If you turn off the router right away and open again, you will have to reconfigure it again. Running configuration (Running Configuration) does not save to any storage medium. You can use the command show running-config to view this configuration. )
Examplename # show running-config
If you really want to save a successful runtime configuration, run the command copy running-config startup-config. Examplename # Copy Running-Config Startup-Config
Now your configuration is saved to a non-volatile random memory (NVRAM). Run the show startup-config to view the results.
EXAMPLENAME # Show Startup-Config
Now, you need to return the router to the configuration mode, run the command copy startup-config running-config.
Examplename # Copy Startup-Config Running-Config
3.5 Configuration Example
Router> enable
2. Router # config
3. Router (config) #hostname N115-7206
4. N115-7206 (config) #Interface serial 1/1
5. N115-7206 (Config-IF) IP Address 192.168.155.2 255.255.255.0
6. N115-7206 (Config-IF) No Shutdown
7. N115-7206 (config-if) Ctrl-Z
8. N115-7206 # Show interface serial 1/1
9. N115-7206 # config
10. N115-7206 (config) #interface Ethernet 2/3
11. N115-7206 (config-IF) #ip address 192.168.150.90 255.255.255.0
12. N115-7206 (config-if) #NO Shutdown
13. N115-7206 (config-if) # Ctrl-z
14. N115-7206 # Show interface Ethernet 2/3
15. N115-7206 # config
16. N115-7206 (Config) #Router RIP
17. N115-7206 (Config-router) #Network 192.168.155.0
18. N115-7206 (Config-router) #Network 192.168.150.0
19. N115-7206 (Config-router) # Ctrl-Z
20. N115-7206 # SHOW ip protocols
21. N115-7206 # ping 192.168.150.1
22. N115-7206 # config
23. N115-7206 (Config) #ip name-server 172.16.0.10
24. N115-7206 (config) # ctrl-z
25. N115-7206 # ping archie.au
26. N115-7206 # config
27. N115-7206 (Config) #enable secret password
28. N115-7206 (config) # ctrl-z
29. N115-7206 # Copy Running-Config Startup-Config
30. N115-7206 # EXIT
4. Question
There will be no problems will occur. Usually, it will appear in the form of a user to your notification, which is not possible to achieve a certain purpose, or any purpose. You need to detect how the router is trying to communicate, and you must be able to capture the fault point.
You are already familiar with the show command, two special commands, and know how other Show commands are used. , The most basic, the most useful command you use is:
Examplename # show interfaceseexamplename # show ip protocolsexamplename # show ip routeexamplename # show IP ARP4.1 Test connection
The fault point is likely not in the configuration of the router, or on the router. If you check the router's configuration and operation, everything looks unplenish, the problem may be on the farther line. In fact, it may be its own line, or may be another router, which possishes or cannot be under your control.
A very useful and simple detection tool is a ping command. Ping is an IP Information Control Protocol Tool (ICMP). Ping sends an ICMP and feeds the request back to the target IP address. If the target machine receives the request, it responds with ICMP to respond. This is very simple to exchange, and its group is:
Hello, Are you alive? (Hey, are you there?)
Yes, I am. (I am!)
Examplename # ping xx.xx.xx.xx
If Ping is successful, you know that you have a goal that is difficult to reach, and this goal is physically reachable.
If there is a router in your router and the target you are difficult to reach, the problem may be in one of the other routers. Even if you ping a router and it responds, the router may have other interfaces, and its routing table may be destroyed, or any number of other problems may exist.
In order to view the router who leaves the special purpose, how far, how far, use the trace command.
Examplename # trace xx.xx.xx.xx
The end of this utility will take a few minutes, so it should give it some time. It displays a list of all routes generated on the road of goals.
4.2 Debugging Command
IOS provides several debug commands, which are not included here. For more information, please visit the Cisco site.
4.3 Hardware and Physical Connection
Do not ignore the failure is the possibility of hardware or physical connection failure. Anything can be wrong, from the motherboard fault to the cable to the power failure. This article does not describe the troublesome solutions of these issues, except for these simple things.
Check if the router is turned on, determine if the cable is loose or damaged, and finally determine if the cable is inserted into the correct port. It is recommended to be too simple, or you need to check other fault sources.
4.4 Beyond your control
If the fault point is the remote end of the line, the problem may be systematically not under your control. You only choose to contact the device administrator and bring your questions to them and seek help to them. You have to pay attention to modest gift. Other network managers have their own problems, their own workload and their own priority. Their agenda may even conflict directly with your questions, such as changing the intention of the dynamic routing protocol, etc. You must work with them, even if you feel discouraged. Some of the alienated ownership make important routing, not a good idea to your network.
5. Case study (in construction)
6. Reference
Leinwand, Pinsky and Culpepper. Cisco router configuration. Indiana Indianapolis: Cisco, published, 1998.
Cisco system company, http://www.cisco.com/
7. More documents
In short, I want to know more about Cisco products and a lot of documents about the network, please visit: http://www.cisco.com/
More documents written by the author of this article: http://www.swcp.com/~jgentry