Monday, 22 January 2018

Cisco IOS and Basic Security

The Cisco Internetwork Operating System (IOS):- is the kernel of Cisco routers and most switches. The Cisco IOS is a proprietary kernel that provides routing, switching, internetworking, and tele-communications features. These are some important things that the Cisco router IOS software is responsible for:

1. Carrying network protocols and functions

2. Connecting high-speed traffic between devices

Adding security to control access and stop unauthorized network use providing scalability for ease of network growth and redundancy Supplying network reliability for connecting to network resources.

We can access the Cisco IOS through the console port of a router, from a modem into the auxiliary (or Aux) port, or even through Telnet.

Connecting to a Cisco Router

We can connect to a Cisco router to configure it, verify its configuration, and check statistics. There are different ways to do this, the first place you would connect to is the console port. The console port is usually an RJ-45 (8-pin modular) connection located at the back of the router. You can also connect to a Cisco router through an auxiliary port—which is really the same thing as a console port, the third way to connect to a Cisco router is in-band, through the program Telnet.

Bringing Up a Router

When you first bring up a Cisco router, it will run a power-on self-test (POST). If it passes, it will then look for and load the Cisco IOS from flash memory—if an IOS file is present. After that, the IOS loads and looks for a valid configuration—the startup-config—that’s stored in nonvolatile RAM, or NVRAM.


  • Router Modes:-

    Entering the CLI from a Non-ISR Router

    After the interface status messages appear and you press Enter, the Router> prompt will appear. This is called user exec mode (user mode), and it’s mostly used to view statistics, But it’s also a stepping stone to logging in to privileged mode. We can only view and change the configuration of a Cisco router in privileged exec mode (privileged mode), which you can enter with the enable command. Here’s how:

    Router>enable

    Router#

    We now end up with a Router# prompt, which indicates that you’re in Privileged mode, where you can both view and change the router’s configuration. We can go back from privileged mode into user mode by using the disable command, as seen here:

    Router# disable

    Router>

    At this point, you can type logout

    from either mode to exit the console: Router>logout

    Overview of Router Modes

    To configure from a CLI, you can make global changes to the router by typing configure terminal (or config t for short), which puts you in global configuration mode and changes what’s known as the running-config. A global command (a command run from global config) is set only once and affects the entire router. We can type config from the privileged-mode prompt and then just press Enter to take the default of terminal, as seen here:

    Router# config

    Configuring from terminal, memory, or network [terminal]? [ press enter ] Here are some of the other options under the configure command:

    Router (config) # exit

    or press

    Cntl-z

    Router# config?

    Confirm            Confirm replacement of running-config with a new config file

    Memory            Configure from NV memory

    Network            Configure from a TFTP network host

    Overwrite-network            Overwrite NV memory from TFTP network host

    Replace            Replace the running-config with a new config file

    Terminal            Configure from the terminal

    Interfaces

    To make changes to an interface, you use the interface command from global configuration mode:

    Router (config) # interface?

    Async   Async interface
    BVI    Bridge-Group Virtual Interface
    CDMA-Ix   CDMA Ix interface
    CTunnel   CTunnel interface
    Dialer   Dialer interface
    FastEthernet  FastEthernet IEEE 802.3
    Group-Async  Async Group interface
    Lex    Lex interface
    Loopback  Loopback interface
    MFR   Multilink Frame Relay bundle interface
    Multilink   Multilink-group interface
    Null    Null interface
    Port-channel  Ethernet Channel of interfaces
    Serial   Serial
    Tunnel   Tunnel interface
    Vif    PGM Multicast Host interface
    Virtual-PPP  Virtual PPP interface
    Virtual-Template Virtual Template interface
    Virtual-TokenRing Virtual Token Ring
    Range   interface range command
    


    Router (config) # interface
    fastEthernet 0/0
    Router (config-if) #
    Did you notice that the prompt changed to Router (config-if) #? This tells us that we’re in interface configuration mode. And wouldn’t it be nice if the prompt also gave us an indication of what interface you were configuring? Well, at least for now we’ll have to live without the prompt information, because it doesn’t. One thing is for sure: You really have to pay attention when configuring a router!

  • Gathering Basic Routing Information

    The show version command will provide basic configuration for the system hardware as well as the software version and the boot images. Here’s an example:

    Router# show version

    Cisco IOS Software, 2800 Software (C2800NM-ADVSECURITYK9-M), Version 12.4(12), RELEASE SOFTWARE (fc1)
  • Administrative Function

    The administrative functions that you can configure on a router and switch are Hostnames, Banners, Passwords and Interface descriptions.

    Remember, none of these will make your routers or switches work better or faster, but we just take the time to set these configurations on each of your network devices. That’s because doing this makes troubleshooting and maintaining your network so much easier.
    1. Hostnames

      We can set the identity of the router with the hostname command. This is only locally significant, which means that it has no bearing on how the router performs name lookups or how the router works on the internetwork.

      Here’s an example:

      Router # config t
      Router (config) # hostname Todd
      Todd (config) # hostname Atlanta
      Atlanta (config) # hostname Todd
      Todd (config) #
      
    2. Banners

      A Banner is more than just a little cool—one very good reason for having a banner is to give any and all who dare attempt to telnet or dial into our internetwork a little security notice. And we can create a banner to give anyone who shows up on the router exactly the information we want them to have.login banner, and message of the day banner (all illustrated in the following code):

      Router (config) # banner?
      login Set login banner
      motd Set Message of the Day banner
      


      Message of the day (MOTD) is the most extensively used banner. It gives a message to every person dialing into or connecting to the router via Telnet or an auxiliary port, or even through a console port as seen here:

      Router (config) # banner motd?
      LINE c banner-text c, where ‘c’ is a delimiting character
      Router (config) # banner motd #
      Enter TEXT message. End with the character ‘#’.$ Acme.com network, then you must disconnect immediately. #
      Router (config) # ^Z
      Router #
      or
      Router (config) # banner motd x Unauthorized access prohibited! x
      


      Login banner

      We 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 can’t be disabled on a per-line basis, so to globally disable it, you’ve got to delete it with the no banner login command.
    3. Setting Passwords

      Five passwords are used to secure your Cisco routers: console, auxiliary, telnet (VTY), enable password, and enable secret. The enable secret and enable password are used to set the password that’s used to secure privileged mode. This will prompt a user for a password when the enable command is used. The other three are used to configure a password when user mode is accessed through the console port, through the auxiliary port, or via Telnet.

      Enable Passwords

      We set the enable passwords from global configuration mode like this:

      Router (config) # enable?
      password Assign the privileged level password
      secret  Assign the privileged level secret


      The following points describe the enable password parameters:

      Router (config) # enable secret Todd
      Router (config) # enable password Todd

      The enable password you have chosen is the same as your enable secret. This is not recommended. Re-enter the enable password. If we try to set the enable secret and enable passwords the same, the router will give you a nice, polite warning to change the second password. If you don’t have older legacy routers, don’t even bother to use the enable password.

      User-mode passwords are assigned by using the line command:

      Router (config) # line?
      <0-337> First Line number
      aux      Auxiliary line
      console  Primary terminal line
      tty      Terminal controller
      vty      Virtual terminal
      x/y      Slot/Port for Modems
      x/y/z    Slot/Subslot/Port for Modems


      Here are the lines to be concerned with:

      aux

      Sets the user-mode password for the auxiliary port. It’s usually used for attaching a modem to the router, but it can be used as a console as well.

      console

      Sets a console user-mode password.

      vty

      Sets a Telnet password on the router. If this password isn’t set, then Telnet can’t be used by default. To configure the user-mode passwords, you configure the line you want and use either the login or no login command to tell the router to prompt for authentication. The next sections will provide a line-by-line example of the configuration of each line configuration

      Auxiliary Password
      To configure the auxiliary password, go into global configuration mode and type

      line aux ?
      We can see here that you only get a choice of 0–0 (that’s because there’s only one port):

      Router# config t
      Router (config) # line aux 0
      Router (config-line) password cisco
      Router (config-line) # login
      Router (config-line) # exit
      


      Console Password To set the console password, use the line console 0 command.

      Router# config t
      Router (config) # line consol 0
      Router (config-line) password cisco
      Router (config-line) # login
      Router (config-line) # exit
      


      Telnet Password

      Router# config t
      Router (config) # line vty 0 1180
      Router (config-line) # password telnet
      Router (config-line) # login
      


      Encrypting Your Passwords

      Because only the enable secret password is encrypted by default, you’ll need to manually configure the user-mode and enable passwords for encryption. To manually encrypt your passwords, use the service password-encryption command.

      Router# config t
      Router (config) # service password-encryption
      Router (config) # exit
      Router # sh run
      Router # config t
      Router (config) # no service password-encryption
      Router (config) # ^Z 

  • Setting Up Secure Shell (SSH)

    Instead of Telnet, you can use Secure Shell, which creates a more secure session than the Telnet application that uses an unencrypted data stream. Secure Shell (SSH) uses encrypted keys to send data so that your username and password are not sent in the clear. Here are the steps to setting up SSH: 
  • Configuring an IP Address on an Interface

    Even though we don’t have to use IP on your routers, it’s most often what people actually do use. To configure IP addresses on an interface, use the ip address command from interface configuration mode:

    Router (config) #int f0/1
    Router (config-if) # ip address 172.16.10.2 255.255.255.0

    Don’t forget to enable the interface with the no shutdown command. If you want to add a second subnet address to an interface, you have to use the secondary parameter. If we type another IP address and press Enter, it will replace the existing IP address and mask. This is definitely a most excellent feature of the Cisco IOS.

    Router (config-if) #ip address 172.16.20.2 255.255.255.0?
    secondary  Make this IP address a secondary address
    < cr >
    Router (config-if) # ip address 172.16.20.2 255.255.255.0 secondary
    Router (config-if) # ^Z
    Router (config-if) # do sh run
     
Routing

Cisco Component



Bootstrap

Bootstrap Stored in the microcode of the ROM, the bootstrap is used to bring a router up during initialization. It will boot the router and then load the IOS.

POST

POST (power-on self-test) Stored in the microcode of the ROM, the POST is used to check the basic functionality of the router hardware and determines which interfaces are present.

ROM monitor

ROM monitor Stored in the microcode of the ROM, the ROM monitor is used for manufacturing, testing, and troubleshooting.

Mini-IOS

Mini-IOS Called the RXBOOT or boot loader by Cisco, the mini-IOS is a small IOS in ROM that can be used to bring up an interface and load a Cisco IOS into flash memory. The mini-IOS can also perform a few other maintenance operations.

RAM

RAM (random Used to hold packet buffers, ARP cache, routing tables, and also access memory) the software and data structures that allow the router to function. Running-configuration is stored in RAM, and most routers expand the IOS from flash into RAM upon boot.

ROM

ROM (read-only memory) Used to start and maintain the router. It Holds the POST and the bootstrap program, as well as the mini-IOS. Flash memory Stores the Cisco IOS by default. Flash memory is not erased when the router is reloaded. It is EEPROM (electronically erasable programmable read-only memory) created by Intel.

NVRAM

NVRAM (nonvolatile RAM) Used to hold the router and switch configuration. NVRAM is not erased when the router or switch is reloaded. It does not store an IOS. The configuration register is stored in NVRAM.

Configuration register

Configuration register Used to control how the router boots up. This value can be found as the last line of the show version command output and by default is set to 0x2102, which tells the router to load the IOS from flash memory as well as to load the configuration from NVRAM.
  • Router Boot Sequence

    The Router Boot Sequence When a router boots up, it performs a series of steps, called the boot sequence, to test the hard- ware and load the necessary software. The boot sequence consists of the following steps:
    1. The router performs a POST. The POST tests the hardware to verify that all components of the device are operational and present.
    2. The bootstrap then looks for and loads the Cisco IOS software. The bootstrap is a program in ROM that is used to execute programs. The bootstrap program is responsible for finding where each IOS program is located and then loading the file. By default, the IOS software is loaded from flash memory in all Cisco routers. The default order of an IOS loading from a router is Flash, TFTP server, then ROM.
    3. The IOS software looks for a valid configuration file stored in NVRAM. This file is called startup-config and is only there if an administrator copies the running-config file into NVRAM.
    4. If a startup-config file is in NVRAM, the router will copy this file and place it in RAM and call the file running-config. The router will use this file to run the router. The router should now be operational. If a startup-config file is not in NVRAM, the router will broadcast out any interface that detects carrier detect (CD) for a TFTP host looking for a configuration, and when that fails (typically it will fail—most people won’t even realize the router has attempted this process), it will start the setup mode configuration process.
  • Managing Configuration Register

    All Cisco routers have a 16-bit software register that’s written into NVRAM. By default, the configuration register is set to load the Cisco IOS from flash memory and to look for and load the startup-config file from NVRAM.

    Understanding the Configuration Register Bits

    The 16 bits (2 bytes) of the configuration register are read from 15 to 0, from left to right. The default configuration setting on Cisco routers is 0x2102.

    Checking the Current Configuration Register Value

    You can see the current value of the configuration register by using the show version command (sh version or show ver for short), as demonstrated here:

    Router# sh version

    The show version command will display system hardware configuration information, software version, and the names of the boot images on a router.
  • Changing the Configuration Register

    You can change the configuration register value to modify how the router boots and runs.

    These are the main reasons you would want to change the configuration register:

    To force the system into the ROM monitor mode to select a boot source and default boot filename.
    1. To enable or disable the Break function.
    2. To control broadcast addresses.
    3. To set the console terminal baud rate
    4. To load operating software from ROM
    5. To enable booting from a Trivial File Transfer Protocol (TFTP) server Before you change the configuration register, make sure you know the current configuration register value
You can change the configuration register by using the config-register command.
Router (config) # config-register 0x2101
Router (config) # ^Z
Router# shver
Configuration register is 0x2102 (will be 0x2101 at next reload)


Here is our router after setting the configuration register to 0x2101 and reloading:

Router(boot)# shver

Configuration register is 0x2101 At this point, if you typed Show flash, you’d still see the IOS in flash memory ready to go.

But we told our router to load from ROM, which is why the host name shows up with (boot).

Router(boot)# sh flash

So even though we have our full IOS in flash, we changed the default loading of the router’s software by changing the configuration register. If you want to set the configuration register back to the default, just type this:
Router(boot)#config t
Router(boot)(config)# config-register 0x2102
Router(boot)(config)# ^Z
Router(boot)# reload
  • Summarization:-

    Summarization, also called route aggregation, allows routing protocols to advertise many networks as one address. The purpose of this is to reduce the size of routing tables on routers to save memory, which also shortens the amount of time for IP to parse the routing table and find the path to a remote network.
  • Recovering Passwords

    If you’re locked out of a router because you forgot the password, you can change the configuration register. The default configuration register value is 0x2102, meaning that bit 6 is off. With the default setting, the router will look for and load a router configuration stored in NVRAM (startup-config). To recover a password, you need to turn on bit 6. Doing this will tell the router to ignore the NVRAM contents. The configuration register value to turn on bit 6 is 0x2142.

    Password recovery steps:
    1. Boot the router and interrupt the boot sequence by performing a break, which will takethe router into ROM monitor mode.
    2. Change the configuration register to turn on bit 6 (with the value 0x2142).
    3. Reload the router.
    4. Enter privileged mode.
    5. Copy the startup-config file to running-config.
    6. Change the password.
    7. Reset the configuration register to the default value.
    8. Save the router configuration.
    9. Reload the router (optional).
  • Interrupting the Router Boot Sequence

    Your first step is to boot the router and perform a break. This is usually done by pressing the Ctrl+Break key combination when using HyperTerminal (personally, I use SecureCRT) whilethe router first reboots. Rommon 1 >

    Notice the line monitor: command “boot” aborted due to user interrupt. At this point, you will be at the rommon 1> prompt, which is called ROM monitor mode.

    Changing the Configuration Register

    Change the configuration register by using the config-register command. To turn on bit 6, use the configuration register value 0x2142.

    Remember that if you change the configuration register to 0x2142, the startup-config will be bypassed and the router will load into setup mode.
·        Rommon 1> prompt:
·        Rommon 1 >confreg 0x2142
·        You must reset or power cycle for new config to take effect
·        Rommon 2 >reset
Viewing and Changing the Configuration

Now you’re past the point where you would need to enter the user-mode and privileged-mode passwords in a router. Copy the startup-config file to the running-config file:

copy startup-config running-config

Or use the shortcut: copy start run
  • Backing Up the Cisco IOS

    To back up the Cisco IOS to a TFTP server, you use the copy flash tftp command. It’s a straight forward command that requires only the source filename and the IP address of the TFTP server.

    The key to success in this backup routine is to make sure you’ve got good, solid connectivity to the TFTP server. Check this by pinging the TFTP device from the router console prompt like this:

    Router# ping 1.1.1.2

    The Packet Internet Groper (Ping) utility is used to test network connectivity,after you ping the TFTP server to make sure that IP is working, you can use the copy flash tftp command to copy the IOS to the TFTP server as shown next:
·        Router# copy flash tftp
·        Source filename []?
·        C2800nm-advsecurityk9-mz.124-12.bin
·        Address or name of remote host []?
·        1.1.1.2
·        Destination filename [c2800nm-advsecurityk9-mz.124-12.bin]?
·        [Enter]
·        !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
·        !!!!!!!
·        21710744 bytes copied in 60.724 secs (357532 bytes/sec)


Restoring or Upgrading the Cisco Router IOS

What happens if you need to restore the Cisco IOS to flash memory to replace an original file that has been damaged or if you want to upgrade the IOS? You can download the file from a TFTP server to flash memory by using the copy tftp flash command. This command requires the IP address of the TFTP host and the name of the file you want to download.But before you begin, make sure the file you want to place in flash memory is in the default TFTP directory on your host. When you issue the command, TFTP won’t ask you where the file is, so if the file you want to use isn’t in the default directory of the TFTP host, this just won’t work.
Router# copy tftp flash
Address or name of remote host []?
1.1.1.2
Source filename []?
C2800nm-advsecurityk9-mz.124-12.bin
Destination filename [c2800nm-advsecurityk9-mz.124-12.bin]?
[Enter]
%Warning:There is a file already existing with this name
Do you want to over write? [Confirm]
[Enter]
Accessing tftp://1.1.1.2/c2800nm-advsecurityk9-mz.124-12.bin...
Loading c2800nm-advsecurityk9-mz.124-12.bin from 1.1.1.2 (via
FastEthernet0/0):
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 21710744 bytes]
21710744 bytes copied in 82.880 secs (261954 bytes/sec)
Router#
  • Gathering Neighbor Information

    The show cdp neighbor command (shcdpnei for short) delivers information about directly connected devices. It’s important to remember that CDP packets aren’t passed through a Cisco switch and that you only see what’s directly attached. So this means that if your router is connected to a switch, you won’t see any of the devices hooked up to that switch.
·        Corp# shcdp neighbors
·        Corp# shcdp neighbors detail

Routing

Sunday, 21 January 2018

Static Routing



Static routing occurs when you manually add routes in each router’s routing table. There are pros and cons to static routing, but that’s true for all routing processes.

Static routing has the following benefits:
  • There is no overhead on the router CPU, which means you, could possibly buy a cheaper router than you would use if you were using dynamic routing.
  • There is no bandwidth usage between routers, which means you could possibly save money on WAN links.
  • It adds security because the administrator can choose to allow routing access to certain networks only.
Static routing has the following disadvantages:
  • The administrator must really understand the internetwork and how each router is connected in order to configure routes correctly.
  • If a network is added to the internetwork, the administrator has to add a route to it on all routers by hand.
  • It’s not feasible in large networks because maintaining it would be a full-time job in itself.
the command syntax you use to add a static route to a routing table:

ip route [ destination network] [ mask ] [ next-hop address or exit interface ]

This list describes each command in the string:

ip route:-The command used to create the static route.

destination network:-The network you’re placing in the routing table.

Mask:-The subnet mask being used on the network.

Next-hop address:-The address of the next-hop router that will receive the packet and forward it to the remote network. This is a router interface that’s on a directly connected network. You must be able to ping the router interface before you add the route. If you type in the wrong next-hop address or the interface to that router is down, the static route will show up in the router’s configuration but not in the routing table.

Exit interface:-Used in place of the next-hop address if you want, and shows up as a directly connected route.
Router (config) # ip route 172.16.3.0 255.255.255.0 192.168.2.4
The ip route command tells us simply that it is a static route.
172.16.3.0 is the remote network we want to send packets to.
This 255.255.255.0 is the mask of the remote network.
192.168.2.4 is the next hop, or router, we will send packets to.


Or

Router (config) # ip route 172.16.3.0 255.255.255.0 s0/0/0

Default routing

It is used to send packets with a remote destination network not in the routing table to the next-hop router. You should only use default routing on stub networks—those with only one exit path out of the network.

To configure a default route, you use wildcards in the network address and mask locations of a static route

Router (config) # ip route 0.0.0.0 0.0.0.0 10.1.11.1





Routing

CCNA

CCNA (Cisco Certified Network Associate) is a entry level network certification now a day’s offered by Cisco. Basically, the CCNA is developed to judge the foundational knowledge of a candidate in networking field.
There are many streams in which a candidate can achieve the CCNA certificate, some of these are:

The CCNA - Routing and Switching certification is the very first step for a candidate to start his career journey in networking. Preparation for this certificate makes a candidate familiar with different basics of networking like Introduction to Networks, Routing concepts, Switching concepts, Protocol Essentials etc.

To get certified from Cisco in Routing and Switching at Associate level a candidate must need to appear in the CCNA – R&S Exam (Code- 200-120) and pass it with minimum passing criteria. The aim of this exam is to analyze a candidate's proficiency in installation, configuration, and troubleshooting for routed and switched networks.

Key points in CCNA tutorial with complete syllabus include TCP/IP, IP Addressing, Subnetting, RIP, IGRP, EIGRP, OSPF, Frame Relay, VLANs, WAN, OSI Model, Cisco Hierarchical Model, Ethernet Networking, EIGRP, VTP, DTP, NAT, Ethernet, Access Lists etc.
Routing

Ad (728x90)

 

Copyright © Technical Agenda™ is a registered trademark.
Designed by Templateism | Distributed by Templatelib