First of all you have to under stand the relevant modes before we start configuring a cisco router.
The basic CLI modes that we will be referring below are as following:
Router> <– User EXEC Mode
Router# <– Privileged EXEC mode
Router(config)# <– Global Configuration Mode
Router(config-if)# <– Interface Configuration Mode
Router(config-line)# <– Line Configuration Mode
NB:
- moving from User EXEC Mode to Privileged mode you have to issue the "enable" command after the > sign.
- Moving from Privileged Mode to Global configuration mode you have to issue the " conf t " command after the # sign
- "exit" command takes you back to the previous mode and " wr mem" writes the commands to memory.
SO LET US START.
1. In the first place we have to give the router a name following the steps below:
Router> en
Router# conf t
Router# hostname Spider-router1
Spider-router1#
2. Setting enable secret and telnet password:
Spider-router1# conf t
#enable secret Uganda4
#login
#line vty 0 4
#Password Uganda5
In this case , Uganda4 is the secret password that protects your terminal and Uganda5 is the password required to access the router remotely from the network.
3. We are going to assign ip address to the Interfaces.
First we have to issue the command # ip int bri to see all the interfaces we have and also see if they are Gigabit or Ethernet.
steps to configure interfaces are as follows :
A. Setup the LAN Interface GE0/0 ( Connects to the local network)
Spider-Router1# conf t
Spider-Router1(config)# interface GigabitEthernet 0/0
Spider-Router1(config-if)# ip address 192.168.1.20 255.255.255.0
Spider-Router1(config-if)# no shutdown
Spider-Router1(config-if)# exit
- I assume GigabitEthernet 0/0 interface is what we have dedicated as our LAN interface. The straight through cable from this this interface will be running up to your LAN switch that connects all your computers.
B. Setup the WAN Interface ( connects to External network such as Internet service provider)
Spider-Router1# conf t
Spider-Router1(config)# interface GigabitEthernet 0/1
Spider-Router1(config-if)# ip address 10.10.10.1 255.255.255.252
Spider-Router1(config-if)# no shutdown
Spider-Router1(config-if)# exit
- GigabitEthernet 0/1 is the interface that connects to the Service provider equipment and it only subnet defined only accepts two ip addresses for security reasons.
C . Adding Static and Dynamic routes in the router to forward traffic from one network to
another.
The Router’s main purpose is to find the best route path towards a destination network and forward packets according to the best path.
There are two main ways a router knows where to send packets. The administrator can assign static routes, or the router can learn routes by using a dynamic routing protocol.
For simple network topologies, static routing is preferred over dynamic routing.
The best way to understand static routing is following the following order while in global Configuration Mode:
Spider-Router1(config)# ip route [destination network] [subnet mask] [gateway ip]
ACTUAL ROUTING CONFIGURATION:
Spider-router1(config)# ip route 20.20.20.0 255.255.255.0 10.10.10.2
The command above tells the router that network 20.20.20.0/24 is reachable via gateway address 10.10.10.1
Another popular static route that we usually configure on Internet Border routers is the default static route:
My-Router(config)# ip route 0.0.0.0 0.0.0.0 10.10.10.2
The default static route above instructs the router to send ALL packets that the router does not have a more specific route entry to gateway address 10.10.10.2 which is probably the ISP gateway address).
TO SAVE YOUR CONFIGURATIONS:
Spider-Router1(config)# exit
Spider-Router1# copy running-config startup-config
or simply type : wr mem to save configurations.
- You can display your current configuration to verify your settings as following:
Spider-Router1# show running-config
or simply type : sh run
NEXT: CONFIGURING NAT ON CISCO ROUTER: