home *** CD-ROM | disk | FTP | other *** search
/ Sybex Virtual Trainer CCNP Switching / Sybex_Virtual_Trainer_CCNP_Switching.iso / ccnp2711 / media / content / 2711c11.xml < prev    next >
Encoding:
Text File  |  2001-03-11  |  77.7 KB  |  829 lines

  1. <CHAPTER ID="11"><TITLE>Access Policies</TITLE>
  2.  
  3. <CHAPTEROBJECTIVEBLOCK><CHAPTEROBJECTIVETITLE>The CCNP exam objectives covered in this chapter include the following:</CHAPTEROBJECTIVETITLE>
  4. <CHAPTEROBJECTIVE>Defining access policies</CHAPTEROBJECTIVE>
  5. <CHAPTEROBJECTIVE>Applying access policies to the access layer</CHAPTEROBJECTIVE>
  6. <CHAPTEROBJECTIVE>Applying access policies to the distribution layer</CHAPTEROBJECTIVE>
  7. <CHAPTEROBJECTIVE>Managing network devices</CHAPTEROBJECTIVE>
  8. <CHAPTEROBJECTIVE>Setting Cisco device passwords</CHAPTEROBJECTIVE>
  9. <CHAPTEROBJECTIVE>Configuring privilege levels</CHAPTEROBJECTIVE>
  10. <CHAPTEROBJECTIVE>Configuring banners</CHAPTEROBJECTIVE>
  11. <CHAPTEROBJECTIVE>Limiting VTY access </CHAPTEROBJECTIVE>
  12. <CHAPTEROBJECTIVE>Limiting HTTP access</CHAPTEROBJECTIVE>
  13. <CHAPTEROBJECTIVE>Managing the MAC address table</CHAPTEROBJECTIVE>
  14. <CHAPTEROBJECTIVE>Configuring port security</CHAPTEROBJECTIVE>
  15. <CHAPTEROBJECTIVE>Describing and configuring access lists</CHAPTEROBJECTIVE>
  16. <CHAPTEROBJECTIVE>Configuring route filtering</CHAPTEROBJECTIVE></CHAPTEROBJECTIVEBLOCK>
  17. <PARA><DROPCAP>I</DROPCAP>n this chapter, we'll show you how to identify the important components when you're designing and implementing access policies. How users access the network directly affects how you build your network and what policies you implement. </PARA>
  18. <PARA>Access policies start at the physical equipment and extend throughout the entire internetwork. In its IOS, Cisco provides different security options that you can run on a switch or router to help implement access policy security. </PARA>
  19.  
  20. <SECTION ID="11.1"><TITLE>Definition of an Access Policy</TITLE>
  21. <PARA><DROPCAP>T</DROPCAP>o document a standard implementation for user access, a company or corporation creates policies. Those policies should include access policies, which describe how users access the network and even how to stop unwanted connections into the network.</PARA>
  22. <PARA>Before any access control is implemented on a network, a standard access policy must be created. It would be difficult for all companies to use a standard access policy because networks and business requirements vary widely between companies. However, you should keep in mind some basic standards when designing your access policies.</PARA>
  23. <PARA>The following list includes some of the most common access policy standards:</PARA>
  24. <LIST MARK="bullet">
  25. <LISTITEM><PARA>Physical security to the network equipment</PARA></LISTITEM>
  26. <LISTITEM><PARA>VLAN management and port security</PARA></LISTITEM>
  27. <LISTITEM><PARA>Password implementation</PARA></LISTITEM>
  28. <LISTITEM><PARA>Control of access to the enterprise network</PARA></LISTITEM>
  29. <LISTITEM><PARA>Documentation of the type of traffic allowed from the switch blocks through the distribution layer to the core layer</PARA></LISTITEM>
  30. <LISTITEM><PARA>Route filtering (access lists)</PARA></LISTITEM>
  31. </LIST>
  32. <PARA>When designing your access policy, remember the big picture: access policies are meant to secure the corporate network and prevent unwanted and unneeded traffic from entering it or slowing it down. Network administrators should implement access policies based on a set of defined traffic standards as well as provide a level of security to campus network devices. </PARA>
  33.  
  34. <SECTION ID="11.1.1" POS="1"><TITLE>Applying Policies to the Hierarchical Model</TITLE>
  35. <PARA>Throughout this course, when discussing different aspects of network design, we have included a discussion of the Cisco three-layer hierarchical model. A discussion of network policies is no exception. Each layer in the Cisco hierarchical model can have a different access policy because each layer can be responsible for a different task. However, only the access layer and the distribution layer are typically used for implementing policies. </PARA>
  36.  
  37. <SECTION ID="11.1.1.1"><TITLE>Access Layer</TITLE>
  38. <PARA>As you already know, the access layer is where users gain access to the network. You need to create security without hindering the company's business requirements. You can provide security at the access layer with port security on layer 2 switches and passwords on all devices in the internetwork.</PARA>
  39. </SECTION>
  40.  
  41. <SECTION ID="11.1.1.2"><TITLE>Distribution Layer</TITLE>
  42. <PARA>The distribution layer is where routing occurs (that is, where layer 3 devices are present). At this layer, you create routing policies, which will ensure that only traffic that is necessary makes it to the core layer or is switched to another access layer. Because the distribution layer is also responsible for advertising routing information to the core layer, the routing policy can include route filtering with access lists and routing filters. </PARA>
  43. </SECTION>
  44.  
  45. <SECTION ID="11.1.1.3"><TITLE>Core Layer</TITLE>
  46. <PARA>The idea of the core layer is to pass data as quickly as possible, so typically, no access policies would apply here. Any policy implemented at the core will only slow down data traversing the core. The distribution layer is responsible for preventing unwanted traffic from entering the core layer. </PARA>
  47. </SECTION>
  48. </SECTION>
  49. </SECTION>
  50.  
  51. <SECTION ID="11.2"><TITLE>Managing Network Devices</TITLE>
  52. <PARA><DROPCAP>I</DROPCAP>t is important to be able to manage all your network devices. The first thing most administrators perform on their networking equipment is to set the passwords. This is probably a good thing to do right away. However, it is not the only thing you need to do. If all you set is the passwords, you are overlooking some of the other needed security items. This section will discuss the typical security that can be provided on a Cisco internetwork. </PARA>
  53. <PARA>You should create a plan for the following:</PARA>
  54. <LIST MARK="bullet">
  55. <LISTITEM><PARA>Physical security</PARA></LISTITEM>
  56. <LISTITEM><PARA>Passwords</PARA></LISTITEM>
  57. <LISTITEM><PARA>Privilege levels</PARA></LISTITEM>
  58. <LISTITEM><PARA>Banners</PARA></LISTITEM>
  59. <LISTITEM><PARA>Limiting Telnet and HTTP access</PARA></LISTITEM>
  60. </LIST>
  61.  
  62. <SECTION ID="11.2.1" POS="1"><TITLE>Physical Security</TITLE>
  63. <PARA>One of the first things you need to document when you're creating an access policy to describe network security is how to create physical security.</PARA>
  64. <PARA>Physically accessing equipment is the easiest way to gain access into a campus internetwork. It takes less than a minute to break into any Cisco router or switch if physical access to the device is granted. If you cannot get physical access to a Cisco router or switch, it is impossible to break into it unless you can guess the passwords. </PARA>
  65. <PARA>If someone has physical access to your network equipment, they can have almost complete control over it. Most devices have a backdoor for getting in without a password. Creating a security policy doesn't help if you don't create physical security as well. The following are some possible solutions for physical security access policies:</PARA>
  66. <LIST MARK="bullet">
  67. <LISTITEM><PARA>Create a configuration and control policy for each type of device. For each site and remote branch, have a security plan that details how the links will be secured. </PARA></LISTITEM>
  68. <LISTITEM><PARA>Design and implement server rooms and network closets that have locks-or even badge entry. Make sure the proper ventilation and power is installed, as well as UPS systems. </PARA></LISTITEM>
  69. <LISTITEM><PARA>Control direct access to network equipment. Creating and locking server and network rooms is only the beginning of your access policy. You need to buy and install locking racks that stop unauthorized users or administrators from gaining direct access to hardware.</PARA></LISTITEM>
  70. <LISTITEM><PARA>Secure network links by providing the same type of security for the wiring and network closets that you provide for the physical devices. </PARA></LISTITEM>
  71. </LIST>
  72. </SECTION>
  73.  
  74. <SECTION ID="11.2.2"><TITLE>Passwords</TITLE>
  75. <PARA>Passwords are probably the most important aspect of security on your network. Change your passwords frequently and make sure they are not easy-to-decipher passwords such as your wife's or husband's name or even the name of one of your kids. Family names are typically used as passwords because they are easy to remember. However, people trying to break into your network or a piece of equipment know this as well.</PARA>
  76. <PARA>Because there are many different ways to access and configure Cisco routers, passwords need to be set on all possible access points. To do this, you must know what they are. Remember, there are really only two ways to enter a Cisco router or switch:</PARA>
  77. <LIST MARK="bullet">
  78. <LISTITEM><PARA><KEYTERM>Out-of-band management</KEYTERM> includes the console and auxiliary ports. Set passwords on both of these physical ports. By default, no passwords are set and anyone can connect and manage the devices. "Out-of-band" comes from "managing the device out of the network." </PARA></LISTITEM>
  79. <LISTITEM><PARA><KEYTERM>In-band management</KEYTERM> includes Telnet, TFTP servers, and Network Management Stations (NMSs). These access points do not allow access by default, but passwords should still be applied. "In-band" comes from "managing the device from within the network." </PARA></LISTITEM>
  80. </LIST>
  81.  
  82. <SECTION ID="11.2.2.1"><TITLE>Setting Router Passwords</TITLE>
  83. <PARA>There are five types of passwords used to secure your Cisco routers. The first two set your enable password, which is used to secure privileged mode. This will prompt a user for a password when the command <INLINECODE>enable</INLINECODE> is used. The other three are used to configure a password when user mode is accessed through the console port, the auxiliary port, or via Telnet. </PARA>
  84. <NOTE>You should already be aware of how to set passwords on Cisco routers and switches and use the information presented in this section as a review.</NOTE>
  85.  
  86. <SECTION ID="11.2.2.1.1"><TITLE>Enable Passwords</TITLE>
  87. <PARA>Enable passwords are very important because they stop users from gaining access to privileged mode, where they can view and change the configuration of the device. You set the enable passwords from global configuration mode: </PARA>
  88. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">enable ?</EMPHASIS></CODELINE>
  89. <CODELINE>  last-resort  Define enable action if no TACACS servers respond</CODELINE>
  90. <CODELINE>  password     Assign the privileged level password</CODELINE>
  91. <CODELINE>  secret       Assign the privileged level secret</CODELINE>
  92. <CODELINE>  use-tacacs   Use TACACS to check enable passwords</CODELINE></CODESNIPPET>
  93. <PARA>The commands are as follows:</PARA>
  94. <RUNINBLOCK><RUNINHEAD><INLINECODE>last-resort</INLINECODE></RUNINHEAD>
  95. <RUNINPARA>Used if you set up authentication through a tacacs server and the server is not available. This will allow the administrator to still enter the router. However, it is not used if the tacacs server is working. </RUNINPARA></RUNINBLOCK>
  96. <RUNINBLOCK><RUNINHEAD><INLINECODE>password</INLINECODE></RUNINHEAD>
  97. <RUNINPARA>Sets the enable password on older, pre-10.3 systems. Not used if an enable secret is set. </RUNINPARA></RUNINBLOCK>
  98. <RUNINBLOCK><RUNINHEAD><INLINECODE>secret</INLINECODE></RUNINHEAD>
  99. <RUNINPARA>The newer, encrypted password. Overrides the enable password if set. </RUNINPARA></RUNINBLOCK>
  100. <RUNINBLOCK><RUNINHEAD><INLINECODE>use-tacacs</INLINECODE></RUNINHEAD>
  101. <RUNINPARA>Tells the router to authenticate through a tacacs server. This is convenient if you have dozens or even hundreds of routers. How would you like to change the password on 200 routers? With the tacacs server, you need to change the password only once. </RUNINPARA></RUNINBLOCK>
  102. <PARA>Here is an example of how to set the enable secret password:</PARA>
  103. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">enable secret todd</EMPHASIS></CODELINE>
  104. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">enable password todd</EMPHASIS></CODELINE>
  105. <CODELINE>The enable password you have chosen is the same as your enable secret. This is not recommended.  Re-enter the enable password.</CODELINE></CODESNIPPET>
  106. <PARACONTINUED>If you try to set the enable secret and enable passwords to be the same, the router will give you a nice, polite warning the first time, but if you type the same password again, it will be accepted. However, now neither password will work. If you don't have older legacy routers, don't bother to use the enable password. </PARACONTINUED>
  107. <PARA>Usermode passwords are assigned by using the <INLINECODE>line</INLINECODE> command: </PARA>
  108. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line ?</EMPHASIS></CODELINE>
  109. <CODELINE>  &lt;0-4>   First Line number</CODELINE>
  110. <CODELINE>  aux      Auxiliary line</CODELINE>
  111. <CODELINE>  console  Primary terminal line</CODELINE>
  112. <CODELINE>  vty      Virtual terminal</CODELINE></CODESNIPPET>
  113. <PARA>The commands are as follows:</PARA>
  114. <RUNINBLOCK><RUNINHEAD><INLINECODE>aux</INLINECODE></RUNINHEAD>
  115. <RUNINPARA>Sets the usermode password for the auxiliary port. This is typically used for configuring a modem on the router, but it can be used as a console as well. </RUNINPARA></RUNINBLOCK>
  116. <RUNINBLOCK><RUNINHEAD><INLINECODE>console</INLINECODE></RUNINHEAD>
  117. <RUNINPARA>Sets a console usermode password.</RUNINPARA></RUNINBLOCK>
  118. <RUNINBLOCK><RUNINHEAD><INLINECODE>vty</INLINECODE></RUNINHEAD>
  119. <RUNINPARA>Sets a Telnet password on the router. If the password is not set, then by default, Telnet cannot be used. </RUNINPARA></RUNINBLOCK>
  120. <PARA>To configure the usermode passwords, you configure the line you want and use either the <INLINECODE>login</INLINECODE> or <INLINECODE>no login</INLINECODE> command to tell the router to prompt for authentication. </PARA>
  121. </SECTION>
  122.  
  123. <SECTION ID="11.2.2.1.2"><TITLE>Auxiliary Password</TITLE>
  124. <PARA>To configure the auxiliary password, go to global configuration mode and type <INLINECODEUSERINPUT>line aux ?</INLINECODEUSERINPUT>. Notice that you only get a choice of 0-0 because there is only one port: </PARA>
  125. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">config t</EMPHASIS></CODELINE>
  126. <CODELINE>Enter configuration commands, one per line.  End with CNTL/Z.</CODELINE>
  127. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line aux ?</EMPHASIS></CODELINE>
  128. <CODELINE>  &lt;0-0>  First Line number</CODELINE>
  129. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line aux 0</EMPHASIS></CODELINE>
  130. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  131. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd</EMPHASIS></CODELINE></CODESNIPPET>
  132. <PARACONTINUED>It is important to remember the <INLINECODE>login</INLINECODE> command or the auxiliary port won't prompt for authentication. </PARACONTINUED>
  133. </SECTION>
  134.  
  135. <SECTION ID="11.2.2.1.3"><TITLE>Console Password</TITLE>
  136. <PARA>To set the console password, use the command <INLINECODE>line console 0</INLINECODE>. However, notice that when we tried to type <INLINECODE>line console 0 ?</INLINECODE> from the aux line configuration, we got an error. You can still type <INLINECODE>line console 0</INLINECODE> and it will be accepted, but the help screens don't work from that prompt. We typed <INLINECODE>exit</INLINECODE> to get back one level: </PARA>
  137. <CODESNIPPET><CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line console ?</EMPHASIS></CODELINE>
  138. <CODELINE>% Unrecognized command</CODELINE>
  139. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">exit</EMPHASIS></CODELINE>
  140. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line console ?</EMPHASIS></CODELINE>
  141. <CODELINE>  &lt;0-0>  First Line number</CODELINE>
  142. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line console 0</EMPHASIS></CODELINE>
  143. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  144. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd1</EMPHASIS></CODELINE></CODESNIPPET>
  145. <PARACONTINUED>Because there is only one console port, we can choose only line console 0. </PARACONTINUED>
  146. </SECTION>
  147.  
  148. <SECTION ID="11.2.2.1.4"><TITLE>Telnet Password</TITLE>
  149. <PARA>To set the usermode password for Telnet access into the router, use the <INLINECODE>line vty</INLINECODE> command. Routers that are not running the Enterprise edition of the Cisco IOS default to five VTY lines, 0 through 4. However, if you have the Enterprise edition, you will have significantly more. The routers we're using for this course have 198 (0-197). The best way to find out how many lines you have is to use the question mark: </PARA>
  150. <CODESNIPPET><CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line vty 0 ?</EMPHASIS></CODELINE>
  151. <CODELINE>&lt;1-197>    Last Line Number</CODELINE>
  152. <CODELINE>&lt;cr></CODELINE>
  153. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line vty 0 197</EMPHASIS></CODELINE>
  154. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  155. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd2</EMPHASIS></CODELINE></CODESNIPPET>
  156. <PARA>If you try to telnet into a router that does not have a VTY password set, you will receive an error stating that the connection is refused because the password is not set. You can tell the router to allow Telnet connections without a password by using the <INLINECODE>no login</INLINECODE> command:</PARA>
  157. <CODESNIPPET><CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line vty 0 197</EMPHASIS></CODELINE>
  158. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">no login</EMPHASIS></CODELINE></CODESNIPPET>
  159. <PARA>After your routers are configured with an IP address, you can use the Telnet program to configure and check them instead of having to use a console cable. You can use the Telnet program by typing <USERINPUT>telnet</USERINPUT> from any command prompt (DOS or Cisco). </PARA>
  160. </SECTION>
  161. </SECTION>
  162.  
  163. <SECTION ID="11.2.2.2"><TITLE>The Login Option</TITLE>
  164. <PARA>In the preceding examples, we used the <INLINECODE>login</INLINECODE> command to indicate to the router where to find the login information that tells it to prompt for authentication. For example, the <INLINECODE>login</INLINECODE> command was used in the console, auxiliary, and VTY lines. The system then automatically uses the line as a login and will prompt for the password set under that particular line. </PARA>
  165. <PARA>However, there are other options you can use that are more specific:</PARA>
  166. <RUNINBLOCK><RUNINHEAD><INLINECODE>login</INLINECODE></RUNINHEAD>
  167. <RUNINPARA>Indicates where to find the user information.</RUNINPARA></RUNINBLOCK>
  168. <RUNINBLOCK><RUNINHEAD><INLINECODE>login local</INLINECODE></RUNINHEAD>
  169. <RUNINPARA>Indicates that the information will be found locally in the username statement (the username statement will be described shortly).</RUNINPARA></RUNINBLOCK>
  170. <RUNINBLOCK><RUNINHEAD><INLINECODE>login authentication</INLINECODE></RUNINHEAD>
  171. <RUNINPARA>Used in conjunction with the <INLINECODE>login tacacs</INLINECODE> command to indicate that the login information is contained on a centralized authentication server. </RUNINPARA></RUNINBLOCK>
  172. <RUNINBLOCK><RUNINHEAD><INLINECODE>login tacacs</INLINECODE></RUNINHEAD>
  173. <RUNINPARA>Used in conjunction with the <INLINECODE>login authentication</INLINECODE> command to indicate that the login information is contained on a centralized authentication server. Using a centralized server makes it easier to maintain a large number of users and devices. </RUNINPARA></RUNINBLOCK>
  174. <PARA>Cisco recommends that you require your users to log in to the system with a username and password instead of just handing out the enable secret password to all administrators. Using this method allows you to keep track of administrators and what changes they have made on a device. </PARA>
  175. <PARA>To set up usernames, use the <INLINECODE>username</INLINECODE> command. Here is an example:</PARA>
  176. <CODESNIPPET><CODELINE>Username todd password console1</CODELINE></CODESNIPPET>
  177. <PARA>Setting the usernames won't do any good until you set the <INLINECODE>login local</INLINECODE> command on a line. If you want users to be prompted for a username on certain lines, make sure you set the <INLINECODE>login local</INLINECODE> command on those lines. Do not set the <INLINECODE>login local</INLINECODE> and then forget to set the usernames and passwords or you will be locked out of your router! The only way to recover is to reload or reboot the router, and this will work only if you didn't save the new configuration. You will have to perform a password recovery technique if you did save the configuration. </PARA>
  178. <PARA>Here is an example of setting the <INLINECODE>login local</INLINECODE> on the console and Telnet lines:</PARA>
  179. <CODESNIPPET><CODELINE>Line con 0</CODELINE>
  180. <CODELINE>Login local</CODELINE>
  181. <CODELINE>Line vty 0 4</CODELINE>
  182. <CODELINE>Login local</CODELINE>
  183. <CODELINE>Exit</CODELINE></CODESNIPPET>
  184. </SECTION>
  185.  
  186. <SECTION ID="11.2.2.3"><TITLE>Session Time-Outs</TITLE>
  187. <PARA>It is important to not leave open Telnet or console sessions running when you are not at your workstation. It is very easy to forget to log out, so setting the time-outs will provide an additional level of security for an unattended console.</PARA>
  188. <PARA>For an IOS-based router, use the <INLINECODE>exec-timeout</INLINECODE> command under the <INLINECODE>line</INLINECODE> command. The <INLINECODE>exec-timeout 0 0</INLINECODE> sets the time-out for the console EXEC session to zero, or to never time out. To set the line to time out after 10 minutes, use <INLINECODE>exec-timeout 10</INLINECODE>.</PARA>
  189. <PARA>Here is an example of how to configure the <INLINECODE>exec-timeout</INLINECODE> command on the console and telnet lines:</PARA>
  190. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line con 0</EMPHASIS></CODELINE>
  191. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">exec-timeout ?</EMPHASIS></CODELINE>
  192. <CODELINE>  &lt;0-35791>  Timeout in minutes</CODELINE>
  193. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">exec-timeout 0 ?</EMPHASIS></CODELINE>
  194. <CODELINE>  &lt;0-2147483>  Timeout in seconds</CODELINE>
  195. <CODELINE>  &lt;cr></CODELINE>
  196. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line vty 0 4</EMPHASIS></CODELINE>
  197. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">exec-timeout 10</EMPHASIS></CODELINE></CODESNIPPET>
  198. </SECTION>
  199.  
  200. <SECTION ID="11.2.2.4"><TITLE>Encrypting Your Passwords</TITLE>
  201. <PARA>Only the enable secret password is encrypted by default. You need to manually configure the usermode and enable passwords.</PARA>
  202. <PARA>Notice that you can see all the passwords except the enable secret when performing a <INLINECODE>show running-config</INLINECODE> on a router: </PARA>
  203. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">sh run</EMPHASIS></CODELINE>
  204. <CODELINE>[output cut]</CODELINE>
  205. <CODELINE>!</CODELINE>
  206. <CODELINE>enable secret 5 $1$rFbM$8.aXocHg6yHrM/zzeNkAT.</CODELINE>
  207. <CODELINE>enable password todd1</CODELINE>
  208. <CODELINE>!</CODELINE>
  209. <CODELINE>[output cut]</CODELINE>
  210. <CODELINE>line con 0</CODELINE>
  211. <CODELINE> password todd1</CODELINE>
  212. <CODELINE> login</CODELINE>
  213. <CODELINE>line aux 0</CODELINE>
  214. <CODELINE> password todd</CODELINE>
  215. <CODELINE> login</CODELINE>
  216. <CODELINE>line vty 0 4</CODELINE>
  217. <CODELINE> password todd2</CODELINE>
  218. <CODELINE> login</CODELINE>
  219. <CODELINE>line vty 5 197</CODELINE>
  220. <CODELINE> password todd2</CODELINE>
  221. <CODELINE> login</CODELINE>
  222. <CODELINE>!</CODELINE>
  223. <CODELINE>end</CODELINE>
  224. <CODELINE></CODELINE>
  225. <CODELINE>Router#</CODELINE></CODESNIPPET>
  226. <PARA>To manually encrypt your passwords, use the <INLINECODE>service password-encryption</INLINECODE> command. Here is an example of how to perform manual password encryption:</PARA>
  227. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">config t</EMPHASIS></CODELINE>
  228. <CODELINE>Enter configuration commands, one per line.  End with CNTL/Z.</CODELINE>
  229. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">service password-encryption</EMPHASIS></CODELINE>
  230. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">enable password todd</EMPHASIS></CODELINE>
  231. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">line vty 0 197</EMPHASIS></CODELINE>
  232. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  233. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd2</EMPHASIS></CODELINE>
  234. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line con 0</EMPHASIS></CODELINE>
  235. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  236. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd1</EMPHASIS></CODELINE>
  237. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">line aux 0</EMPHASIS></CODELINE>
  238. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">login</EMPHASIS></CODELINE>
  239. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">password todd</EMPHASIS> </CODELINE>
  240. <CODELINE>Router(config-line)#<EMPHASIS FORMAT="bold">exit</EMPHASIS></CODELINE>
  241. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">no service password-encryption</EMPHASIS></CODELINE>
  242. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">^Z</EMPHASIS></CODELINE></CODESNIPPET>
  243. <PARA>By typing the <INLINECODE>show running-config</INLINECODE> command, you can see that the enable password and the line passwords are all encrypted: </PARA>
  244. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">sh run</EMPHASIS></CODELINE>
  245. <CODELINE>Building configuration...</CODELINE>
  246. <CODELINE></CODELINE>
  247. <CODELINE>[output cut]</CODELINE>
  248. <CODELINE>!</CODELINE>
  249. <CODELINE>enable secret 5 $1$rFbM$8.aXocHg6yHrM/zzeNkAT.</CODELINE>
  250. <CODELINE>enable password 7 0835434A0D</CODELINE>
  251. <CODELINE>!</CODELINE>
  252. <CODELINE>[output cut]</CODELINE>
  253. <CODELINE>!</CODELINE>
  254. <CODELINE>line con 0</CODELINE>
  255. <CODELINE> password 7 111D160113</CODELINE>
  256. <CODELINE> login</CODELINE>
  257. <CODELINE>line aux 0</CODELINE>
  258. <CODELINE> password 7 071B2E484A</CODELINE>
  259. <CODELINE> login</CODELINE>
  260. <CODELINE>line vty 0 4</CODELINE>
  261. <CODELINE> password 7 0835434A0D</CODELINE>
  262. <CODELINE> login</CODELINE>
  263. <CODELINE>line vty 5 197</CODELINE>
  264. <CODELINE> password 7 09463724B</CODELINE>
  265. <CODELINE> login</CODELINE>
  266. <CODELINE>!</CODELINE>
  267. <CODELINE>end</CODELINE>
  268. <CODELINE></CODELINE>
  269. <CODELINE>Router#</CODELINE></CODESNIPPET>
  270. </SECTION>
  271.  
  272. <SECTION ID="11.2.2.5"><TITLE>Setting Passwords on a CLI-Based switch</TITLE>
  273. <PARA>To configure the usermode and enable mode passwords on a CLI-based switch, enter enable mode by using the <INLINECODE>enable</INLINECODE> command and then enter global configuration mode by using the <INLINECODE>config t</INLINECODE> command. </PARA>
  274. <PARA>Once you are in global configuration mode, you can set the usermode and enable mode passwords by using the <INLINECODE>enable password</INLINECODE> command. The switch's output below shows the configuration of both the usermode and enable mode passwords: </PARA>
  275. <CODESNIPPET><CODELINE>(config)#<EMPHASIS FORMAT="bold">enable password ?</EMPHASIS></CODELINE>
  276. <CODELINE>  level  Set exec level password</CODELINE>
  277. <CODELINE>(config)#<EMPHASIS FORMAT="bold">enable password level ?</EMPHASIS></CODELINE>
  278. <CODELINE>  &lt;1-15>  Level number</CODELINE></CODESNIPPET>
  279. <PARACONTINUED>To enter the usermode password, use level number 1. To enter the enable mode password, use level mode 15. Remember, the password must be at least four characters but not longer than eight characters. </PARACONTINUED>
  280.  
  281. <SECTION ID="11.2.2.5.1"><TITLE>Usermode Password</TITLE>
  282. <PARA>The switch output below shows the usermode password being set and denied because it is more than eight characters: </PARA>
  283. <CODESNIPPET><CODELINE>(config)#<EMPHASIS FORMAT="bold">enable password level 1 toddlammle</EMPHASIS></CODELINE>
  284. <CODELINE>Error: Invalid password length.</CODELINE>
  285. <CODELINE>Password must be between 4 and 8 characters</CODELINE></CODESNIPPET>
  286. </SECTION>
  287.  
  288. <SECTION ID="11.2.2.5.2"><TITLE>Enable Password</TITLE>
  289. <PARA>The following output is an example of how to set both the usermode and enable mode passwords on a CLI-based switch: </PARA>
  290. <CODESNIPPET><CODELINE>(config)#<EMPHASIS FORMAT="bold">enable password level 1 todd</EMPHASIS></CODELINE>
  291. <CODELINE>(config)#<EMPHASIS FORMAT="bold">enable password level 15 todd1</EMPHASIS></CODELINE>
  292. <CODELINE>(config)#<EMPHASIS FORMAT="bold">exit</EMPHASIS></CODELINE>
  293. <CODELINE>#<EMPHASIS FORMAT="bold">exit</EMPHASIS></CODELINE>
  294. <CODELINE>CLI session with the switch is now closed.</CODELINE>
  295. <CODELINE>Press any key to continue.</CODELINE></CODESNIPPET>
  296. <PARA>At this point, you can press Enter and test your passwords. You will be prompted for a usermode password after you press K and then an enable mode password after you type <INLINECODEUSERINPUT>enable</INLINECODEUSERINPUT>. Remember that the enable secret password always supercedes an enable password. On a CLI-based switch, use the <INLINECODE>enable secret</INLINECODE> command, just as you would with any router:</PARA>
  297. <CODESNIPPET><CODELINE>(config)#<EMPHASIS FORMAT="bold">enable secret sanfran</EMPHASIS></CODELINE></CODESNIPPET>
  298. <PARA>You can use a <INLINECODE>show running-config</INLINECODE> to see the current configuration on the switch:</PARA>
  299. <CODESNIPPET><CODELINE>#<EMPHASIS FORMAT="bold">sh run</EMPHASIS></CODELINE>
  300. <CODELINE>Building configuration...</CODELINE>
  301. <CODELINE>Current configuration:</CODELINE>
  302. <CODELINE></CODELINE>
  303. <CODELINE>enable secret 5 $1$FMFQ$wFVYVLYn2aXscfB3J95.w.</CODELINE>
  304. <CODELINE>enable password level 1 "TODD"</CODELINE>
  305. <CODELINE>enable password level 15 "TODD1"</CODELINE></CODESNIPPET>
  306. <PARA>Notice that the enable mode passwords are not encrypted by default, but the enable secret is. This is the same password configuration technique that you will find on a router. The passwords are not case sensitive. </PARA>
  307. <PARA>You can set the session time-out on a CLI-based switch with the <INLINECODE>time-out</INLINECODE> command under the line console: </PARA>
  308. <CODESNIPPET><CODELINE>(config)#<EMPHASIS FORMAT="bold">line console</EMPHASIS></CODELINE>
  309. <CODELINE>(config)#<EMPHASIS FORMAT="bold">time-out 300</EMPHASIS></CODELINE></CODESNIPPET>
  310. <PARACONTINUED>The <INLINECODE>time-out</INLINECODE> command is set in seconds (300 seconds is 5 minutes). </PARACONTINUED>
  311. </SECTION>
  312. </SECTION>
  313.  
  314. <SECTION ID="11.2.2.6"><TITLE>Setting Passwords on a Set-Based Switch</TITLE>
  315. <PARA>To configure the usermode and privilege mode passwords on a set-based switch, use the command <INLINECODE>set password</INLINECODE> for the usermode password and the command <INLINECODE>set enablepass</INLINECODE> for the enable password.</PARA>
  316.  
  317. <SECTION ID="11.2.2.6.1"><TITLE>Usermode Password</TITLE>
  318. <PARA>To set the usermode password, use the command <INLINECODE>set password</INLINECODE>, then press Enter:</PARA>
  319. <CODESNIPPET><CODELINE>Console> <EMPHASIS FORMAT="bold">en</EMPHASIS></CODELINE>
  320. <CODELINE>Enter password:</CODELINE>
  321. <CODELINE>Console> (enable) <EMPHASIS FORMAT="bold">set password</EMPHASIS> [press enter]</CODELINE>
  322. <CODELINE>Enter old password: </CODELINE>
  323. <CODELINE>Enter new password: </CODELINE>
  324. <CODELINE>Retype new password:</CODELINE>
  325. <CODELINE>Password changed.</CODELINE></CODESNIPPET>
  326. <PARA>When you see the "Enter old password" prompt, you can leave it blank and press Enter if you don't have a password set. The output for the "Enter new password" prompt doesn't show on the console screen. If you want to clear the usermode (login) password, type in the old password and then just press Enter when you're asked for a new password. </PARA>
  327. </SECTION>
  328.  
  329. <SECTION ID="11.2.2.6.2"><TITLE>Enable Password</TITLE>
  330. <PARA>To set the enable password, use the command <INLINECODE>set enablepass</INLINECODE>, then press Enter: </PARA>
  331. <CODESNIPPET><CODELINE>Console> (enable) <EMPHASIS FORMAT="bold">set enablepass</EMPHASIS></CODELINE>
  332. <CODELINE>Enter old password:</CODELINE>
  333. <CODELINE>Enter new password:</CODELINE>
  334. <CODELINE>Retype new password:</CODELINE>
  335. <CODELINE>Password changed.</CODELINE>
  336. <CODELINE>Console> (enable)</CODELINE></CODESNIPPET>
  337. <PARA>You can type <USERINPUT>exit</USERINPUT> at this point to log out of the switch completely, which will allow you to test your new passwords. You can set the session time-out on the set-based switch by using the <INLINECODE>set logout</INLINECODE> command: </PARA>
  338. <CODESNIPPET><CODELINE>Console> (enable) <EMPHASIS FORMAT="bold">set logout 5</EMPHASIS></CODELINE></CODESNIPPET>
  339. <PARACONTINUED>The <INLINECODE>set logout 5</INLINECODE> command will log out an open session not used for 5 minutes. </PARACONTINUED>
  340. </SECTION>
  341. </SECTION>
  342. </SECTION>
  343.  
  344. <SECTION ID="11.2.3"><TITLE>Privileged Levels</TITLE>
  345. <PARA>By default, all Cisco devices have two privilege levels: user mode and privilege mode. If you have a large network with many administrators, you should set usernames and passwords for each administrator. This will allow you to monitor each administrator and the changes they make to any device. </PARA>
  346. <PARA>This becomes a problem when each administrator has different duties; they should not all have the same amount of access to Cisco devices. By setting additional privilege levels, you can effectively provide each user with the ability to perform certain commands without giving them the opportunity to modify the configuration or even perform a debug on a device. The privilege mode, by default, allows a user to perform all commands, view and change the configuration, and run debugging commands. You probably would not want all administrators to have full privilege mode capabilities. </PARA>
  347. <PARA>There are 16 different levels of privilege that can be set, 0-15. By default, user mode is level 1 and the highest privilege mode is 15. Level 0 is used to set up a very limited subset of commands for a specific user or line. </PARA>
  348. <PARA>To set up privilege modes, use the <INLINECODE>privilege</INLINECODE> global configuration  command:</PARA>
  349. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">privilege ?</EMPHASIS></CODELINE>
  350. <CODELINE>  alps-ascu               ALPS ASCU configuration mode</CODELINE>
  351. <CODELINE>  alps-circuit            ALPS circuit configuration mode</CODELINE>
  352. <CODELINE>  atmsig_e164_table_mode  ATMSIG E164 Table</CODELINE>
  353. <CODELINE>  configure               Global configuration mode</CODELINE>
  354. <CODELINE>  controller              Controller configuration mode</CODELINE>
  355. <CODELINE>  crypto-map              Crypto map config mode</CODELINE>
  356. <CODELINE>  crypto-transform        Crypto transform config mode</CODELINE>
  357. <CODELINE>  dhcp                    DHCP pool configuration mode</CODELINE>
  358. <CODELINE>  exec                    Exec mode</CODELINE>
  359. <CODELINE>  flow-cache              Flow aggregation cache config mode</CODELINE>
  360. <CODELINE>  interface               Interface configuration mode</CODELINE>
  361. <CODELINE>  interface-dlci          Frame Relay dlci configuration mode</CODELINE>
  362. <CODELINE>  ipenacl                 IP named extended access-list config-</CODELINE>
  363. <CODELINE>                          uration mode</CODELINE>
  364. <CODELINE>  ipsnacl                 IP named simple access-list config-</CODELINE>
  365. <CODELINE>                          uration mode</CODELINE>
  366. <CODELINE>  ipx-router              IPX router configuration mode</CODELINE>
  367. <CODELINE>  ipxenacl                IPX named extended access-list config-</CODELINE>
  368. <CODELINE>                          uration mode</CODELINE>
  369. <CODELINE>  ipxsapnacl              IPX named SAP access-list config-</CODELINE>
  370. <CODELINE>                          uration mode</CODELINE>
  371. <CODELINE>  ipxsnacl                IPX named standard access-list config-</CODELINE>
  372. <CODELINE>                          uration mode</CODELINE>
  373. <CODELINE>  ipxsumnacl              IPX named Summary access-list config-</CODELINE>
  374. <CODELINE>                          uration mode</CODELINE>
  375. <CODELINE>  lane                    ATM Lan Emulation Lecs Config-</CODELINE>
  376. <CODELINE>                          uration Table</CODELINE>
  377. <CODELINE>  line                    Line configuration mode</CODELINE>
  378. <CODELINE>  map-class               Map class configuration mode</CODELINE>
  379. <CODELINE>  map-list                Map list configuration mode</CODELINE>
  380. <CODELINE>  null-interface          Null interface config-</CODELINE>
  381. <CODELINE>                          uration mode</CODELINE>
  382. <CODELINE>  route-map               Route map config mode</CODELINE>
  383. <CODELINE>  router                  Router configuration mode</CODELINE>
  384. <CODELINE>  rtr                     RTR Entry Configuration</CODELINE>
  385. <CODELINE>  subscriber-policy       Subscriber policy config-</CODELINE>
  386. <CODELINE>                          uration mode</CODELINE>
  387. <CODELINE>  vc-class                VC class configuration mode</CODELINE>
  388. <CODELINE>  voiceport               Voice configuration mode</CODELINE>
  389. <CODELINE>  voipdialpeer            Dial Peer configuration mode</CODELINE>
  390. <CODELINE>  vpdn-group              VPDN group configuration mode</CODELINE></CODESNIPPET>
  391. <PARA>There are a lot of commands that can be used with the <INLINECODE>privilege</INLINECODE> command, which allows for very granular control. Here is a list of some of the most commonly used privilege mode commands:</PARA>
  392. <RUNINBLOCK><RUNINHEAD><INLINECODE>configure</INLINECODE></RUNINHEAD>
  393. <RUNINPARA>Allows global configuration mode</RUNINPARA></RUNINBLOCK>
  394. <RUNINBLOCK><RUNINHEAD><INLINECODE>controller</INLINECODE></RUNINHEAD>
  395. <RUNINPARA>Allows controller configuration on interfaces</RUNINPARA></RUNINBLOCK>
  396. <RUNINBLOCK><RUNINHEAD><INLINECODE>exec</INLINECODE></RUNINHEAD>
  397. <RUNINPARA>Allows entrance to exec mode</RUNINPARA></RUNINBLOCK>
  398. <RUNINBLOCK><RUNINHEAD><INLINECODE>interface</INLINECODE></RUNINHEAD>
  399. <RUNINPARA>Allows interface configuration</RUNINPARA></RUNINBLOCK>
  400. <RUNINBLOCK><RUNINHEAD><INLINECODE>ipx-router</INLINECODE></RUNINHEAD>
  401. <RUNINPARA>Allows changes to the IPX routing protocols</RUNINPARA></RUNINBLOCK>
  402. <RUNINBLOCK><RUNINHEAD><INLINECODE>line</INLINECODE></RUNINHEAD>
  403. <RUNINPARA>Allows changes to the line commands</RUNINPARA></RUNINBLOCK>
  404. <RUNINBLOCK><RUNINHEAD><INLINECODE>map-class</INLINECODE></RUNINHEAD>
  405. <RUNINPARA>Allows changes and configuration of map-class</RUNINPARA></RUNINBLOCK>
  406. <RUNINBLOCK><RUNINHEAD><INLINECODE>map-list</INLINECODE></RUNINHEAD>
  407. <RUNINPARA>Allows entrance to map-list</RUNINPARA></RUNINBLOCK>
  408. <RUNINBLOCK><RUNINHEAD><INLINECODE>route-map</INLINECODE></RUNINHEAD>
  409. <RUNINPARA>Allows entrance to route map configuration mode</RUNINPARA></RUNINBLOCK>
  410. <RUNINBLOCK><RUNINHEAD><INLINECODE>router</INLINECODE></RUNINHEAD>
  411. <RUNINPARA>Allows changes to routing protocols </RUNINPARA></RUNINBLOCK>
  412. <PARA>To configure privileges, you configure an enable password for each level and then assign commands that each level can perform. For Cisco IOS devices, use the following command to set the level passwords:</PARA>
  413. <CODESNIPPET><CODELINE>Enable password level <EMPHASIS FORMAT="italic">level password</EMPHASIS></CODELINE></CODESNIPPET>
  414. <PARA>Then set the <INLINECODE>privilege</INLINECODE> command as follows using the list of most commonly used privilege mode commands as valid modes: </PARA>
  415. <CODESNIPPET><CODELINE>Privilege mode level <EMPHASIS FORMAT="italic">level command</EMPHASIS></CODELINE></CODESNIPPET>
  416. <PARA>Here is an example of how to set a password for a level 5 user, then enable that user to execute the <INLINECODE>ping</INLINECODE> command, which is a level 15 command: </PARA>
  417. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">enable password level 5 todd</EMPHASIS></CODELINE>
  418. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">privilege exec level 5 ping</EMPHASIS></CODELINE>
  419. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">^Z</EMPHASIS> </CODELINE></CODESNIPPET>
  420. <PARA>Type the command <INLINECODEUSERINPUT>show privilege</INLINECODEUSERINPUT> to see the current privilege: </PARA>
  421. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">sh priv</EMPHASIS></CODELINE>
  422. <CODELINE>Current privilege level is 15</CODELINE>
  423. <CODELINE>Router#</CODELINE></CODESNIPPET>
  424. <PARA>You can then have the user log in with the <INLINECODE>enable 5</INLINECODE> command, which will prompt the user for the level 5 enable password: </PARA>
  425. <CODESNIPPET><CODELINE>Router><EMPHASIS FORMAT="bold">ena 5</EMPHASIS></CODELINE>
  426. <CODELINE>Password:</CODELINE></CODESNIPPET>
  427. <PARA>Finally, you can type <INLINECODEUSERINPUT>show privilege</INLINECODEUSERINPUT> to see the new privilege level: </PARA>
  428. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">sh priv</EMPHASIS></CODELINE>
  429. <CODELINE>Current privilege level is 5</CODELINE>
  430. <CODELINE>Router#</CODELINE></CODESNIPPET>
  431. </SECTION>
  432.  
  433. <SECTION ID="11.2.4"><TITLE>Banners</TITLE>
  434. <PARA>You can set a banner on a Cisco router so that when either a user logs in to the router or an administrator telnets into it, for example, the banner will give them information that you want them to have. Another reason for having a banner is to add a security notice to users dialing in to your internetwork. There are four different banners available: </PARA>
  435. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">banner ?</EMPHASIS></CODELINE>
  436. <CODELINE>  LINE      c banner-text c, where 'c' is a delimiting character</CODELINE>
  437. <CODELINE>  exec      Set EXEC process creation banner</CODELINE>
  438. <CODELINE>  incoming  Set incoming terminal line banner</CODELINE>
  439. <CODELINE>  login     Set login banner</CODELINE>
  440. <CODELINE>  motd      Set Message of the Day banner</CODELINE></CODESNIPPET>
  441. <PARA>The Message of the Day is the most used and gives a message to every person dialing in or connecting to the router via Telnet, auxiliary port, or console port: </PARA>
  442. <CODESNIPPET><CODELINE>Router(config)#<EMPHASIS FORMAT="bold">banner motd ?</EMPHASIS></CODELINE>
  443. <CODELINE>  LINE  c banner-text c, where 'c' is a delimiting character</CODELINE>
  444. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">banner motd #</EMPHASIS></CODELINE>
  445. <CODELINE>Enter TEXT message.  End with the character '#'.</CODELINE>
  446. <CODELINE><EMPHASIS FORMAT="bold">$ized to be in Acme.com network, then you must disconnect immediately.</EMPHASIS></CODELINE></CODESNIPPET>
  447. <NOTE>The router wrapped the text above and inserted a dollar sign ($) to let the administrator know this. The complete message will be used, however, as shown in the output that follows. </NOTE>
  448. <CODESNIPPET><CODELINE>#</CODELINE>
  449. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">^Z</EMPHASIS></CODELINE>
  450. <CODELINE>Router#</CODELINE>
  451. <CODELINE>00:25:12: %SYS-5-CONFIG_I: Configured from console by console</CODELINE>
  452. <CODELINE>Router#<EMPHASIS FORMAT="bold">exit</EMPHASIS></CODELINE>
  453. <CODELINE></CODELINE>
  454. <CODELINE>Router con0 is now available</CODELINE>
  455. <CODELINE></CODELINE>
  456. <CODELINE>Press RETURN to get started.</CODELINE>
  457. <CODELINE></CODELINE>
  458. <CODELINE>If you are not authorized to be in Acme.com network, then you must disconnect immediately.</CODELINE>
  459. <CODELINE></CODELINE>
  460. <CODELINE>Router></CODELINE></CODESNIPPET>
  461. <PARA>The above MOTD banner tells anyone connecting to the router that they either must be authorized or must disconnect. It's important that you understand the delimiting character. You can use any character you want, and it is used to tell the router where the end of the message is. So you can't use the delimiting character in the message itself. Also note that at the end of the message, you should press Return, then the delimiting character, then Return again. If you don't do that, the message will still work, but if you have multiple banners, for example, they will be combined as one message and put on one line. </PARA>
  462. <PARA>These are the other banners: </PARA>
  463. <RUNINBLOCK><RUNINHEAD>Exec banner</RUNINHEAD>
  464. <RUNINPARA>You can configure a line-activation (exec) banner to be displayed when an EXEC process (such as a line-activation or incoming connection to a VTY line) is created.</RUNINPARA></RUNINBLOCK>
  465. <RUNINBLOCK><RUNINHEAD>Incoming banner</RUNINHEAD>
  466. <RUNINPARA>You can configure a banner to be displayed on terminals connected to reverse Telnet lines. This banner is useful for providing instructions to users who use reverse Telnet.</RUNINPARA></RUNINBLOCK>
  467. <RUNINBLOCK><RUNINHEAD>Login banner</RUNINHEAD>
  468. <RUNINPARA>You can configure a login banner to be displayed on all connected terminals. This banner is displayed after the MOTD banner but before the login prompts. The login banner cannot be disabled on a per-line basis. To globally disable the login banner, you must delete the login banner with the <INLINECODE>no banner login</INLINECODE> command.</RUNINPARA></RUNINBLOCK>
  469. </SECTION>
  470.  
  471. <SECTION ID="11.2.5"><TITLE>Limiting VTY Access</TITLE>
  472. <PARA>You will have a difficult time trying to stop users from telnetting into a router because any active port on a router is fair game for VTY access. However, you can use a standard IP access list to control access by placing the access list on the VTY lines themselves. </PARA>
  473. <NOTE>Access lists are in discussed in detail later in this chapter.</NOTE>
  474. <PARA>To place an access list on a VTY line, follow these steps:</PARA>
  475. <LIST MARK="number">
  476. <LISTITEM><PARA>Create a standard IP access list that permits only the host or hosts you want to be able to telnet into the routers to do so. </PARA></LISTITEM>
  477. <LISTITEM><PARA>Apply the access list to the VTY line with the <INLINECODE>access-class</INLINECODE>  command. </PARA></LISTITEM>
  478. </LIST>
  479. <PARA>Here is an example of allowing only host 172.16.10.3 to telnet into a router: </PARA>
  480. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 50 permit 172.16.10.3</EMPHASIS></CODELINE>
  481. <CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">line vty 0 4</EMPHASIS></CODELINE>
  482. <CODELINE>RouterA(config-line)#<EMPHASIS FORMAT="bold">access-class 50 in</EMPHASIS></CODELINE></CODESNIPPET>
  483. <PARACONTINUED>Because of the implied <INLINECODE>deny any</INLINECODE> at the end of the list, the access list stops any host from telnetting into the router except the host 172.16.10.3. </PARACONTINUED>
  484. </SECTION>
  485.  
  486. <SECTION ID="11.2.6"><TITLE>Controlling HTTP Access</TITLE>
  487. <PARA>HTTP can be used to gain access to a router or switch and both view and change the configuration of the device. Because any active interface can be used to allow access via HTTP, you can limit access by placing an access list under the HTTP server command. </PARA>
  488. <PARA>To turn on HTTP access, use the <INLINECODE>ip http server</INLINECODE> command. By default, the enable secret password is used to gain access. When you set up usernames and passwords, each user can be prompted for passwords when trying to access the device via a network browser. You can use the <INLINECODE>ip access-class</INLINECODE> command to add an access list to the HTTP server running on the device. Here is an example of setting up a user with HTTP access from their host 172.16.10.1: </PARA>
  489. <CODESNIPPET><CODELINE>Router#<EMPHASIS FORMAT="bold">config t</EMPHASIS></CODELINE>
  490. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">username tlammle password cisco</EMPHASIS></CODELINE>
  491. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">ip http server</EMPHASIS></CODELINE>
  492. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">access-list 10 permit host 172.16.10.1</EMPHASIS></CODELINE>
  493. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">ip http access-class 10</EMPHASIS></CODELINE>
  494. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">ip http authentication ?</EMPHASIS></CODELINE>
  495. <CODELINE>  enable  Use enable passwords</CODELINE>
  496. <CODELINE>  local   Use local username and passwords</CODELINE>
  497. <CODELINE>  tacacs  Use tacacs to authorize user</CODELINE>
  498. <CODELINE></CODELINE>
  499. <CODELINE>Router(config)#<EMPHASIS FORMAT="bold">ip http authentication local</EMPHASIS></CODELINE>
  500. <CODELINE>Router(config)#</CODELINE></CODESNIPPET>
  501. <PARACONTINUED>User tlammle can now use a network browser to log in and manage a Cisco device. </PARACONTINUED>
  502. <PARA>Password security for HTTP access is similar to password security for console and Telnet access. The following commands can be used for login authentication:</PARA>
  503. <RUNINBLOCK><RUNINHEAD><INLINECODE>enable</INLINECODE></RUNINHEAD>
  504. <RUNINPARA>Indicates that the enable password should be used. This is the default if nothing is specified. </RUNINPARA></RUNINBLOCK>
  505. <RUNINBLOCK><RUNINHEAD><INLINECODE>local</INLINECODE></RUNINHEAD>
  506. <RUNINPARA>Indicates that the local user database is used for authentication.</RUNINPARA></RUNINBLOCK>
  507. <RUNINBLOCK><RUNINHEAD><INLINECODE>tacacs</INLINECODE></RUNINHEAD>
  508. <RUNINPARA>Indicates that a tacacs server is used for authentication. </RUNINPARA></RUNINBLOCK>
  509. </SECTION>
  510. </SECTION>
  511.  
  512. <SECTION ID="11.3"><TITLE>Access Layer Policy</TITLE>
  513. <PARA><DROPCAP>T</DROPCAP>he access layer is where users gain access to the internetwork. If you want total security, you can unplug their workstations from the switch, but that's not usually possible. You need to both allow users to gain access to corporate services and secure your internetwork. Not an easy task. The biggest threat is users going into a network closet and just plugging into an access layer switch. Always lock the closet in which the network equipment is located. </PARA>
  514. <PARA>However, by managing the MAC address table, you can manage port security on access layer switches, which allows you to protect your internetwork from a user plugging a device into the switch. </PARA>
  515.  
  516. <SECTION ID="11.3.1" POS="1"><TITLE>Managing the MAC Address Table</TITLE>
  517. <PARA>Do you remember how bridges and switches filter a network? They use MAC (hardware) addresses burned into a host's network interface card (NIC) to make forwarding decisions. The switches create a MAC table that includes dynamic, permanent, and static addresses. This filter table is created when hosts send a frame and the switch learns the source MAC address and from which segment and port it was received. </PARA>
  518. <PARA>The switch keeps adding into the MAC filter table new MAC addresses that are sent on the network. As hosts are added or removed, the switch dynamically updates the MAC filter table. If a device is removed, or if it is not connected to the switch for a period of time, the switch will age out the entry. </PARA>
  519. <PARA>You can see the switch's filter table by using the command <INLINECODE>show mac-address-table</INLINECODE>. The following output shows the information received when using the <INLINECODE>show mac-address-table</INLINECODE> command: </PARA>
  520. <CODESNIPPET><CODELINE>Todd1900EN#<EMPHASIS FORMAT="bold">sh mac-address-table</EMPHASIS></CODELINE>
  521. <CODELINE>Number of permanent addresses : 0</CODELINE>
  522. <CODELINE>Number of restricted static addresses : 0</CODELINE>
  523. <CODELINE>Number of dynamic addresses : 4</CODELINE>
  524. <CODELINE></CODELINE>
  525. <CODELINE>Address          Dest Interface    Type     Source Interface List</CODELINE>
  526. <CODELINE>-----------------------------------------------------------------</CODELINE>
  527. <CODELINE>00A0.246E.0FA8    Ethernet 0/2      Dynamic      All</CODELINE>
  528. <CODELINE>0000.8147.4E11    Ethernet 0/5      Dynamic      All</CODELINE>
  529. <CODELINE>0000.8610.C16F    Ethernet 0/1      Dynamic      All</CODELINE>
  530. <CODELINE>00A0.2448.60A5    Ethernet 0/4      Dynamic      All</CODELINE></CODESNIPPET>
  531. <PARA>The addresses in the table above are from the four hosts connected to a 1900 switch. They are all <EMPHASIS FORMAT="italic">dynamic entries</EMPHASIS>, which means the switch looked at the source address of a frame as it entered the switch interface and placed that address in the filter table. Notice that we have hosts in interfaces 1, 2, 4, and 5. </PARA>
  532. <PARA>Administrators can specifically assign permanent addresses to a switch port. These addresses are never aged out. You can do this to provide security to a port, which means that unless you specifically configure a hardware address to a switch port, the hardware address won't work. Administrators can also create static entries in the switch; these entries actually create a path for a source hardware address. This can be really restrictive, and you need to be careful when setting static entries because you can basically shut your switch down if you do not plan the configuration carefully. </PARA>
  533.  
  534. <SECTION ID="11.3.1.1"><TITLE>Configuring Port Security</TITLE>
  535. <PARA>Another form of security on an access layer switch is <EMPHASIS FORMAT="italic">port security</EMPHASIS>. Port security is a way of stopping users from plugging a hub into their jack in their office or cubicle and adding a bunch of hosts without your knowledge. By default, 132 hardware addresses can be allowed on a single switch interface. To change this, use the interface command <INLINECODE>port secure max-mac-count</INLINECODE>. </PARA>
  536. <PARA>On a set-based switch, the command is <INLINECODE>set port security </INLINECODE><INLINECODEVARIABLE>mod/port</INLINECODEVARIABLE><INLINECODE> enable </INLINECODE><INLINECODEVARIABLE>mac_address</INLINECODEVARIABLE>.</PARA>
  537. <PARA>The following switch output shows the command <INLINECODE>port secure max-mac-count</INLINECODE> being set on a CLI-based switch, interface 0/2, to allow only one entry: </PARA>
  538. <CODESNIPPET><CODELINE>Todd1900EN#<EMPHASIS FORMAT="bold">config t</EMPHASIS></CODELINE>
  539. <CODELINE>Enter configuration commands, one per line.  End with CNTL/Z</CODELINE>
  540. <CODELINE>Todd1900EN(config)#<EMPHASIS FORMAT="bold">int e0/2</EMPHASIS></CODELINE>
  541. <CODELINE>Todd1900EN(config-if)#<EMPHASIS FORMAT="bold">port secure ?</EMPHASIS></CODELINE>
  542. <CODELINE>  max-mac-count  Maximum number of addresses allowed on the port</CODELINE>
  543. <CODELINE>  &lt;cr></CODELINE>
  544. <CODELINE></CODELINE>
  545. <CODELINE>Todd1900EN(config-if)#<EMPHASIS FORMAT="bold">port secure max-mac-count ?</EMPHASIS></CODELINE>
  546. <CODELINE>  &lt;1-132>  Maximum mac address count for this secure port</CODELINE>
  547. <CODELINE></CODELINE>
  548. <CODELINE>Todd1900EN(config-if)#<EMPHASIS FORMAT="bold">port secure max-mac-count 1</EMPHASIS></CODELINE></CODESNIPPET>
  549. <PARA>The secured port or ports you create can use either static or sticky-learned hardware addresses. If the hardware addresses on a secured port are not statically assigned, the port sticky learns the source address of incoming frames and automatically assigns them as permanent addresses. <EMPHASIS FORMAT="italic">Sticky-learn</EMPHASIS> is a term Cisco uses to refer to a port dynamically finding a source hardware address and creating a permanent entry in the MAC filter table. </PARA>
  550. </SECTION>
  551. </SECTION>
  552. </SECTION>
  553.  
  554. <SECTION ID="11.4"><TITLE>Distribution Layer Policy</TITLE>
  555. <PARA><DROPCAP>T</DROPCAP>he distribution layer is the place to implement most of your policies for the network. Here, you can exercise considerable flexibility in defining network operation. There are several items that generally should be taken care of at the distribution layer:</PARA>
  556. <LIST MARK="bullet">
  557. <LISTITEM><PARA>Implementation of tools such as access lists, packet filtering, and queuing</PARA></LISTITEM>
  558. <LISTITEM><PARA>Implementation of security and network policies, including address translation and firewalls</PARA></LISTITEM>
  559. <LISTITEM><PARA>Redistribution between routing protocols, including static routing</PARA></LISTITEM>
  560. <LISTITEM><PARA>Routing between VLANs and other workgroup support functions</PARA></LISTITEM>
  561. <LISTITEM><PARA>Broadcast and multicast domain definition</PARA></LISTITEM>
  562. </LIST>
  563. <PARA>Things to avoid at the distribution layer are limited to those functions that exclusively belong to one of the other layers. The best access polices assure that the distribution layer does not send excessive data to the core layers or other switch blocks. Access control at the distribution layer falls into several different categories:</PARA>
  564. <LIST MARK="bullet">
  565. <LISTITEM><PARA>Filtering traffic between VLANs and to the core layer. Typically, this is provided by an access list.</PARA></LISTITEM>
  566. <LISTITEM><PARA>Filtering routing protocol updates to the core block. This is provided by <KEYTERM>distribution lists</KEYTERM>, which are another form of access lists but are specific for routing protocols. </PARA></LISTITEM>
  567. </LIST>
  568.  
  569. <SECTION ID="11.4.1" POS="1"><TITLE>Access Lists</TITLE>
  570. <PARA>Most of the access policies are implemented at the distribution layer with some type of access list. Access lists are essentially lists of conditions that control access. They're powerful tools that control access both to and from network segments. They can filter unwanted packets and be used to implement security policies. With the right combination of access lists, network managers will be armed with the power to enforce nearly any access policy they can invent. </PARA>
  571. <NOTE>This is only an overview of access lists. For a detailed explanation, please see <EMPHASIS FORMAT="italic">CCNA: Cisco Certified Network Associate Study Guide</EMPHASIS>, by Todd Lammle (Sybex, 2000), and <EMPHASIS FORMAT="italic">CCNP: Routing Study Guide</EMPHASIS>, by Todd Lammle and Sean Odom (Sybex, 2000). </NOTE>
  572. <PARA>The IP and IPX access lists work similarly-they're both packet filters that packets are compared with, categorized by, and acted upon. Once the lists are built, they can be applied to either inbound or outbound traffic on any interface. Applying an access list will then cause the router to analyze every packet crossing that interface in the specified direction and take action accordingly.</PARA>
  573. <PARA>There are a few important rules a packet follows when it's being compared with an access list:</PARA>
  574. <LIST MARK="bullet">
  575. <LISTITEM><PARA>It's always compared with each line of the access list in sequential order; that is, it'll always start with line 1, then go to line 2, then  line 3, and so on. </PARA></LISTITEM>
  576. <LISTITEM><PARA>It's compared with lines of the access list only until a match is made. Once the packet matches a line of the access list, it's acted upon, and no further comparisons take place.</PARA></LISTITEM>
  577. <LISTITEM><PARA>There is an implicit "deny" at the end of each access list-this means that if a packet doesn't match up to any lines in the access list, it'll be discarded.</PARA></LISTITEM>
  578. </LIST>
  579. <PARA>Each of these rules has some powerful implications when IP and IPX packets are filtered with access lists.</PARA>
  580. <PARA>There are two types of access lists used with IP and IPX that we will discuss here:</PARA>
  581. <RUNINBLOCK><RUNINHEAD>Standard access lists</RUNINHEAD>
  582. <RUNINPARA>These use only the source IP address in an IP packet to filter the network. This basically permits or denies an entire suite of protocols. IPX standards can filter on both source and destination IPX addresses. IP standard access lists use numbers 1-99 and IPX standard access lists use numbers 800-899.</RUNINPARA></RUNINBLOCK>
  583. <RUNINBLOCK><RUNINHEAD>Extended access lists</RUNINHEAD>
  584. <RUNINPARA>These check for both source and destination IP addresses, the protocol field in the Network layer header, and the port number at the Transport layer header. IPX extended access lists use the source and destination IPX addresses, the Network layer protocol field, and socket numbers in the Transport layer header. IP extended access lists use numbers 100-199 and IPX extended access lists use numbers 900-999. </RUNINPARA></RUNINBLOCK>
  585. <PARA>Once you create an access list, you apply it to an interface with either an inbound or outbound list:</PARA>
  586. <RUNINBLOCK><RUNINHEAD>Inbound access lists</RUNINHEAD>
  587. <RUNINPARA>Packets are processed through the access list before being routed to the outbound interface. </RUNINPARA></RUNINBLOCK>
  588. <RUNINBLOCK><RUNINHEAD>Outbound access lists</RUNINHEAD>
  589. <RUNINPARA>Packets are routed to the outbound interface and then processed through the access list. </RUNINPARA></RUNINBLOCK>
  590. <PARA>There are also some guidelines that should be followed when you're creating and implementing access lists on a router:</PARA>
  591. <LIST MARK="bullet">
  592. <LISTITEM><PARA>You can assign only one access list per interface, per protocol, or per direction. This means that if you are creating IP access lists, you can have only one inbound access list and one outbound access list per interface. </PARA></LISTITEM>
  593. <LISTITEM><PARA>Organize your access lists so that the more specific tests are at the top. </PARA></LISTITEM>
  594. <LISTITEM><PARA>When a new test statement is added to the access list, it will be placed at the bottom of the list.</PARA></LISTITEM>
  595. <LISTITEM><PARA>You cannot remove one line from an access list. If you try to, you will remove the entire list. It is best to copy the access list to a text editor before trying to edit the list. The only exception is when you're using named access lists. </PARA></LISTITEM>
  596. <LISTITEM><PARA>Unless your access list ends with a <INLINECODE>permit any</INLINECODE> command, all packets will be discarded if they do not meet any of the list's tests. Every list should have at least one permit statement, or you might as well shut the interface down.</PARA></LISTITEM>
  597. <LISTITEM><PARA>Create access lists and then apply them to an interface. Any access list applied to an interface without an access-list present will not filter traffic. </PARA></LISTITEM>
  598. <LISTITEM><PARA>Access lists are designed to filter traffic going through the router. They will not filter traffic originating from the router. </PARA></LISTITEM>
  599. <LISTITEM><PARA>Place IP standard access lists as close to the destination as possible.</PARA></LISTITEM>
  600. <LISTITEM><PARA>Place IP extended access lists as close to the source as possible.</PARA></LISTITEM>
  601. </LIST>
  602.  
  603. <SECTION ID="11.4.1.1"><TITLE>Wildcards</TITLE>
  604. <PARA>Wildcards are used with access list configuration and summarization and with Open Shortest Path First (OSPF) configuration. Although applying wildcards looks more difficult than it really is, it is important to understand how. </PARA>
  605. <PARA>Wildcards are used with access lists to specify a specific host, network, or part of a network. To understand wildcards, you need to understand block sizes. Block sizes are used to specify a range of addresses. There are different block sizes available, including 64, 32, 16, 8, and 4.</PARA>
  606. <PARA>When you need to specify a range of addresses, you choose the block size closest to your needs. For example, if you need to specify 34 networks, you need a block size of 64. If you want to specify 18 hosts, you need a block size of 32. If you specify only 2 networks, then a block size of 4 would work. </PARA>
  607. <PARA>Wildcards are used with the host or network address to tell the router a range of available addresses to filter. To specify a specific host, the address would look like this:</PARA>
  608. <CODESNIPPET><CODELINE>172.16.30.5 0.0.0.0</CODELINE></CODESNIPPET>
  609. <PARA>The four zeros represent each octet of the address. Whenever a zero is presented, it means that octet in the address must match exactly. To specify that an octet can be any value, the value of 255 is used. As an example, here is how a full subnet is specified with a wildcard:</PARA>
  610. <CODESNIPPET><CODELINE>172.16.30.0 0.0.0.255</CODELINE></CODESNIPPET>
  611. <PARA>This tells the router to match up the first three octets exactly, but the fourth octet can be any value. </PARA>
  612. <PARA>Now, that was the easy part. What if you want to specify only a small range of subnets? This is where the block sizes come in. You have to specify the range of values in a block size. In other words, you can't choose to specify 20 networks. You can specify only the exact amount as the block size value. For example, the range would have to be either 16 or 32, but not 20. </PARA>
  613. <PARA>Let's say that you want to block access to a part of a network, the part that's in the range from 172.16.8.0 through 172.16.15.0. That is a block size of 8. Your network number would be 172.16.8.0, and the wildcard would be 0.0.7.255. Whoa! What is that? The 7.255 is what the router uses to determine the block size. The network and wildcard tell the router to start at 172.16.8.0 and go up a block size of eight addresses to network 172.16.15.0. </PARA>
  614. <PARA>It is actually easier than it looks. We could certainly go through the binary math for you, but actually, all you have to do is remember that the wildcard is always one number less than the block size. So, in our example, the wildcard would be 7 because our block size is 8. If you used a block size of 16, the wildcard would be 15. Easy, huh?</PARA>
  615. <PARA>Here are some examples to help you really understand it.</PARA>
  616. <PARA>The following example tells the router to match the first three octets exactly but that the fourth octet can be anything:</PARA>
  617. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.10.0 0.0.0.255</EMPHASIS></CODELINE></CODESNIPPET>
  618. <PARA>The next example tells the router to match the first two octets and that the last two octets can be any value: </PARA>
  619. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.0.0 0.0.255.255</EMPHASIS></CODELINE></CODESNIPPET>
  620. <PARA>Try to figure out this next line:</PARA>
  621. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.16.0 0.0.3.255</EMPHASIS></CODELINE></CODESNIPPET>
  622. <PARACONTINUED>The above configuration tells the router to start at network 172.16.16.0 and use a block size of 4. The range would then be 172.16.16.0 through 172.16.19.0.</PARACONTINUED>
  623. <PARA>The example below shows an access list starting at 172.16.16.0 and going up a block size of 8 to 172.16.23.0:</PARA>
  624. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.16.0 0.0.7.255</EMPHASIS></CODELINE></CODESNIPPET>
  625. <PARA>The next example starts at network 172.16.32.0 and goes up a block size of 32 to 172.16.63.0:</PARA>
  626. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.32.0 0.0.31.255</EMPHASIS></CODELINE></CODESNIPPET>
  627. <PARA>This last example starts at network 172.16.64.0 and goes up a block size of 64 to 172.16.127.0: </PARA>
  628. <CODESNIPPET><CODELINE>RouterA(config)#<EMPHASIS FORMAT="bold">access-list 10 deny 172.16.64.0 0.0.63.255</EMPHASIS></CODELINE></CODESNIPPET>
  629. <PARA>Here are two more things to keep in mind when you're working with block sizes and wildcards:</PARA>
  630. <LIST MARK="bullet">
  631. <LISTITEM><PARA>Each block size must start at 0. For example, you can't say that you want a block size of 8 and start at 12. You must use 0-7, 8-15, 16-23, and so on. For a block size of 32, the ranges are 0-31, 32-63, 64-95, and so on. </PARA></LISTITEM>
  632. <LISTITEM><PARA>Using the command <INLINECODE>any</INLINECODE> is the same thing as writing out the wildcard 0.0.0.0 255.255.255.255.</PARA></LISTITEM>
  633. </LIST>
  634. </SECTION>
  635. </SECTION>
  636.  
  637. <SECTION ID="11.4.2"><TITLE>Route Filtering</TITLE>
  638. <PARA>The distribute route command can be used to limit the number of networks advertised by permitting advertisements only to those specified. Distribution lists are applied from within a routing protocol to manipulate which route updates are sent and accepted on the specified interface. All that's necessary for networks in which the edge routers rely only on the default route is to advertise a few choice networks to them. Reducing the advertised routes conserves bandwidth and reduces the load on the edge router.</PARA>
  639. <PARA>Controlling the routing table of the core block reduces the routing table size on the core and can also stop users from accessing networks that you don't advertise unless you specifically provide them with a static route. </PARA>
  640. <PARA>You can also use access lists to manipulate route advertisements. As an example of this, look at the route table in the router output below before any changes are made in the EIGRP session:</PARA>
  641. <CODESNIPPET><CODELINE>Router_C#<EMPHASIS FORMAT="bold">show ip route</EMPHASIS></CODELINE>
  642. <CODELINE>Codes: C - connected, S - static, I - IGRP, R - RIP, M -   [output cut]</CODELINE>
  643. <CODELINE>Gateway of last resort is not set</CODELINE>
  644. <CODELINE></CODELINE>
  645. <CODELINE>     172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks</CODELINE>
  646. <CODELINE>C       172.16.40.4/30 is directly connected, Serial0</CODELINE>
  647. <CODELINE>D       172.16.30.0/24 [90/2195456] via 172.16.40.5         , 00:42:51,         Serial0</CODELINE>
  648. <CODELINE>D       172.16.20.4/30 [90/2681856] via 172.16.40.5        , 02:33:25,         Serial0</CODELINE>
  649. <CODELINE>D       172.16.0.0/16 is a summary, 03:03:56, Null0</CODELINE>
  650. <CODELINE>Router_C#</CODELINE></CODESNIPPET>
  651. <PARA>This information shows that there are three routes learned via EIGRP and one route that's directly connected. Next, we'll filter out the route for the 172.16.30.0 network:</PARA>
  652. <CODESNIPPET><CODELINE>Router_C#<EMPHASIS FORMAT="bold">conf t</EMPHASIS></CODELINE>
  653. <CODELINE>Enter configuration commands, one per line.  End with CNTL/Z.</CODELINE>
  654. <CODELINE>Router_C(config)#<EMPHASIS FORMAT="bold">access-list 30 deny 172.16.30.0 0.0.0.255</EMPHASIS></CODELINE>
  655. <CODELINE>Router_C(config)#<EMPHASIS FORMAT="bold">access-list 30 permit any</EMPHASIS></CODELINE>
  656. <CODELINE>Router_C(config)#<EMPHASIS FORMAT="bold">router eigrp 100</EMPHASIS></CODELINE>
  657. <CODELINE>Router_C(config-router)#<EMPHASIS FORMAT="bold">distribute-list 30 in serial0</EMPHASIS></CODELINE>
  658. <CODELINE>Router_C(config-router)#<EMPHASIS FORMAT="bold">^Z</EMPHASIS></CODELINE>
  659. <CODELINE>Router_C#</CODELINE></CODESNIPPET>
  660. <PARA>After applying access list 30 via the <INLINECODE>distribute-list</INLINECODE> command, we executed another <INLINECODE>show ip route</INLINECODE> on the router. Here is the result:</PARA>
  661. <CODESNIPPET><CODELINE>Router_C#<EMPHASIS FORMAT="bold">show ip route</EMPHASIS></CODELINE>
  662. <CODELINE>Codes: C - connected, S - static, I - IGRP, R - RIP, M -   [output cut]</CODELINE>
  663. <CODELINE>Gateway of last resort is not set</CODELINE>
  664. <CODELINE></CODELINE>
  665. <CODELINE>     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks</CODELINE>
  666. <CODELINE>C       172.16.40.4/30 is directly connected, Serial0</CODELINE>
  667. <CODELINE>D       172.16.20.4/30 [90/2681856] via 172.16.40.5,        00:00:02,         Serial0</CODELINE>
  668. <CODELINE>D       172.16.0.0/16 is a summary, 00:00:02, Null0</CODELINE>
  669. <CODELINE>Router_C#</CODELINE></CODESNIPPET>
  670. <PARA>You can see that the 172.16.30.0 network is no longer in the routing table. This is how the <INLINECODE>distribute-list</INLINECODE> command works. </PARA>
  671. </SECTION>
  672. </SECTION>
  673.  
  674. <SECTION ID="11.5"><TITLE>Summary</TITLE>
  675. <PARA><DROPCAP>T</DROPCAP>his chapter covered the different aspects of designing and implementing access polices on your internetwork. It is important to create for your network access policies that start at physical security and extend through the entire internetwork. </PARA>
  676. <PARA>In this chapter, we covered the following:</PARA>
  677. <LIST MARK="bullet">
  678. <LISTITEM><PARA>Defining and applying access policies at the access layer and distribution layer</PARA></LISTITEM>
  679. <LISTITEM><PARA>Managing network devices by setting passwords, using privilege levels and banners, and limiting VTY and HTTP access </PARA></LISTITEM>
  680. <LISTITEM><PARA>Managing the MAC address table by configuring port security</PARA></LISTITEM>
  681. <LISTITEM><PARA>Providing an overview of access lists and route filtering</PARA></LISTITEM>
  682. </LIST>
  683.  
  684. <SECTION ID="11.5.1" POS="1"><TITLE>Key Terms</TITLE>
  685. <PARA>Before you take the exam, be sure you're familiar with the following terms:</PARA>
  686. <LIST MARK="none">
  687. <LISTITEM><PARA><KEYTERM REF="11.4">distribution lists</KEYTERM></PARA></LISTITEM>
  688. <LISTITEM><PARA><KEYTERM REF="11.2.2">in-band management</KEYTERM></PARA></LISTITEM>
  689. <LISTITEM><PARA><KEYTERM REF="11.2.2">out-of-band management</KEYTERM></PARA></LISTITEM>
  690. </LIST>
  691. </SECTION>
  692.  
  693. <SECTION ID="11.5.2"><TITLE>Commands Used in This Chapter</TITLE>
  694. <PARA>The following list includes the commands used in this chapter:</PARA>
  695. <TABULARDATA>
  696. <TABULARBODY>
  697. <TABULARROW>
  698. <TABULARENTRY><EMPHASIS FORMAT="bold">Command</EMPHASIS></TABULARENTRY>
  699. <TABULARENTRY><EMPHASIS FORMAT="bold">Meaning</EMPHASIS></TABULARENTRY>
  700. </TABULARROW>
  701. <TABULARROW>
  702. <TABULARENTRY><INLINECODE>enable secret</INLINECODE></TABULARENTRY>
  703. <TABULARENTRY>Configures the enable secret password on a CLI device</TABULARENTRY>
  704. </TABULARROW>
  705. <TABULARROW>
  706. <TABULARENTRY><INLINECODE>enable password</INLINECODE></TABULARENTRY>
  707. <TABULARENTRY>Configures the enable password on a CLI device</TABULARENTRY>
  708. </TABULARROW>
  709. <TABULARROW>
  710. <TABULARENTRY><INLINECODE>set password</INLINECODE></TABULARENTRY>
  711. <TABULARENTRY>Configures the usermode password on a set-based device</TABULARENTRY>
  712. </TABULARROW>
  713. <TABULARROW>
  714. <TABULARENTRY><INLINECODE>set enablepass</INLINECODE></TABULARENTRY>
  715. <TABULARENTRY>Configures the enable password on a set-based device</TABULARENTRY>
  716. </TABULARROW>
  717. <TABULARROW>
  718. <TABULARENTRY><INLINECODE>line console</INLINECODE></TABULARENTRY>
  719. <TABULARENTRY>Configures the usermode console password on a CLI device</TABULARENTRY>
  720. </TABULARROW>
  721. <TABULARROW>
  722. <TABULARENTRY><INLINECODE>line vty</INLINECODE></TABULARENTRY>
  723. <TABULARENTRY>Configures the usermode Telnet password on a CLI device</TABULARENTRY>
  724. </TABULARROW>
  725. <TABULARROW>
  726. <TABULARENTRY><INLINECODE>line aux </INLINECODE></TABULARENTRY>
  727. <TABULARENTRY>Configures the usermode aux password on a CLI device</TABULARENTRY>
  728. </TABULARROW>
  729. <TABULARROW>
  730. <TABULARENTRY><INLINECODE>login local</INLINECODE></TABULARENTRY>
  731. <TABULARENTRY>Configures a line to set authentication locally</TABULARENTRY>
  732. </TABULARROW>
  733. <TABULARROW>
  734. <TABULARENTRY><INLINECODE>username</INLINECODE></TABULARENTRY>
  735. <TABULARENTRY>Configures a username and password for a local login</TABULARENTRY>
  736. </TABULARROW>
  737. <TABULARROW>
  738. <TABULARENTRY><INLINECODE>exec-timeout</INLINECODE></TABULARENTRY>
  739. <TABULARENTRY>Changes the time-out of a CLI-based device console</TABULARENTRY>
  740. </TABULARROW>
  741. <TABULARROW>
  742. <TABULARENTRY><INLINECODE>service password-encryption</INLINECODE></TABULARENTRY>
  743. <TABULARENTRY>Encrypts the usermode and enable password on a CLI-based device</TABULARENTRY>
  744. </TABULARROW>
  745. <TABULARROW>
  746. <TABULARENTRY><INLINECODE>no service password-encryption</INLINECODE></TABULARENTRY>
  747. <TABULARENTRY>Disables password encryption</TABULARENTRY>
  748. </TABULARROW>
  749. <TABULARROW>
  750. <TABULARENTRY><INLINECODE>time-out</INLINECODE></TABULARENTRY>
  751. <TABULARENTRY>Changes the time-out of a set-based device console</TABULARENTRY>
  752. </TABULARROW>
  753. <TABULARROW>
  754. <TABULARENTRY><INLINECODE>privilege </INLINECODE><INLINECODEVARIABLE>mode</INLINECODEVARIABLE></TABULARENTRY>
  755. <TABULARENTRY>Configures privilege modes on a CLI-based device</TABULARENTRY>
  756. </TABULARROW>
  757. <TABULARROW>
  758. <TABULARENTRY><INLINECODE>banner</INLINECODE></TABULARENTRY>
  759. <TABULARENTRY>Configures banners on a CLI-based device</TABULARENTRY>
  760. </TABULARROW>
  761. <TABULARROW>
  762. <TABULARENTRY><INLINECODE>access-class</INLINECODE></TABULARENTRY>
  763. <TABULARENTRY>Configures an access list on the VTY lines</TABULARENTRY>
  764. </TABULARROW>
  765. <TABULARROW>
  766. <TABULARENTRY><INLINECODE>ip http access-class</INLINECODE></TABULARENTRY>
  767. <TABULARENTRY>Configures an access list for HTTP security</TABULARENTRY>
  768. </TABULARROW>
  769. <TABULARROW>
  770. <TABULARENTRY><INLINECODE>ip http authentication local</INLINECODE></TABULARENTRY>
  771. <TABULARENTRY>Configures authentication for username and password when using HTTP to configure a device</TABULARENTRY>
  772. </TABULARROW>
  773. <TABULARROW>
  774. <TABULARENTRY><INLINECODE>sh mac-address-table</INLINECODE></TABULARENTRY>
  775. <TABULARENTRY>Views the MAC filter table on a CLI-based switch</TABULARENTRY>
  776. </TABULARROW>
  777. <TABULARROW>
  778. <TABULARENTRY><INLINECODE>port-secure mac-mac-count</INLINECODE></TABULARENTRY>
  779. <TABULARENTRY>Configures port security on a CLI-based switch</TABULARENTRY>
  780. </TABULARROW>
  781. <TABULARROW>
  782. <TABULARENTRY><INLINECODE>distribute-list</INLINECODE></TABULARENTRY>
  783. <TABULARENTRY>Configures an access list for use on a routing table</TABULARENTRY>
  784. </TABULARROW>
  785. </TABULARBODY>
  786. </TABULARDATA>
  787. </SECTION>
  788. </SECTION>
  789.  
  790. <TESTSECTION ID="11.6"><TITLE>Written Lab</TITLE>
  791. <!-- <TESTDATA>
  792. <TESTBLOCK><QUESTIONBLOCK><QUESTION>Port security is typically an access policy at which layer?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  793. <TESTBLOCK><QUESTIONBLOCK><QUESTION>Access lists are typically used for an access policy at which layer?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  794. <TESTBLOCK><QUESTIONBLOCK><QUESTION>What command applies an access list to a routing table?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  795. <TESTBLOCK><QUESTIONBLOCK><QUESTION>What command applies an access list to a VTY line?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  796. <TESTBLOCK><QUESTIONBLOCK><QUESTION>What command applies an access list to an HTTP server running on a router?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  797. <TESTBLOCK><QUESTIONBLOCK><QUESTION>What is the standard IP access list number range?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  798. <TESTBLOCK><QUESTIONBLOCK><QUESTION>Where would you place extended access lists in the network?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  799. <TESTBLOCK><QUESTIONBLOCK><QUESTION>How do you set port security on a set-based switch?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  800. <TESTBLOCK><QUESTIONBLOCK><QUESTION>If you wanted to set usernames and passwords for the console port, which command must you set under the <INLINECODE>line console 0</INLINECODE> command?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  801. <TESTBLOCK><QUESTIONBLOCK><QUESTION>What are the four types of banners you can set on a Cisco router?</QUESTION></QUESTIONBLOCK></TESTBLOCK>
  802. </TESTDATA> -->
  803. <SLUG NONUM="w1"/>
  804. </TESTSECTION>
  805.  
  806. <TESTSECTION ID="11.7"><TITLE>Answers to Written Lab</TITLE>
  807. <TESTDATA>
  808. <TESTBLOCK><ANSWERBLOCK><ANSWER>Access layer</ANSWER></ANSWERBLOCK></TESTBLOCK>
  809. <TESTBLOCK><ANSWERBLOCK><ANSWER>Distribution layer</ANSWER></ANSWERBLOCK></TESTBLOCK>
  810. <TESTBLOCK><ANSWERBLOCK><ANSWER><INLINECODE>distribute list</INLINECODE></ANSWER></ANSWERBLOCK></TESTBLOCK>
  811. <TESTBLOCK><ANSWERBLOCK><ANSWER><INLINECODE>access-class </INLINECODE><INLINECODEVARIABLE>number in/out</INLINECODEVARIABLE></ANSWER></ANSWERBLOCK></TESTBLOCK>
  812. <TESTBLOCK><ANSWERBLOCK><ANSWER><INLINECODE>ip http access-class </INLINECODE><INLINECODEVARIABLE>number</INLINECODEVARIABLE></ANSWER></ANSWERBLOCK></TESTBLOCK>
  813. <TESTBLOCK><ANSWERBLOCK><ANSWER>1-99</ANSWER></ANSWERBLOCK></TESTBLOCK>
  814. <TESTBLOCK><ANSWERBLOCK><ANSWER>Closest to the source</ANSWER></ANSWERBLOCK></TESTBLOCK>
  815. <TESTBLOCK><ANSWERBLOCK><ANSWER><INLINECODE>set port security </INLINECODE><INLINECODEVARIABLE>mod/port</INLINECODEVARIABLE><INLINECODE> enable </INLINECODE><INLINECODEVARIABLE>mac_address</INLINECODEVARIABLE>.</ANSWER></ANSWERBLOCK></TESTBLOCK>
  816. <TESTBLOCK><ANSWERBLOCK><ANSWER><INLINECODE>login local</INLINECODE></ANSWER></ANSWERBLOCK></TESTBLOCK>
  817. <TESTBLOCK><ANSWERBLOCK><ANSWER>Login, exec, incoming, and MOTD</ANSWER></ANSWERBLOCK></TESTBLOCK>
  818. </TESTDATA>
  819. </TESTSECTION>
  820.  
  821. <FIGCOL>
  822.     <FIG NONUM="w1">
  823.         <ILL MODE="wlab">
  824.             <FLASH SRC="graphics/writtenlabs/lab11_11.swf" WIDTH="580" HEIGHT="380" LOOP="FALSE" MENU="FALSE" QUALITY="HIGH" BGCOLOR="#FFFFFF" />
  825.         </ILL>
  826.     </FIG>
  827. </FIGCOL>
  828. </CHAPTER>
  829.