Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts

RESET CISCO ROUTER PASSWORD


In this post I will show you how to reset the password on a Cisco router. I will be using a Cisco 1841 router to demonstrate this process.
STEP 1: Connect the power to the Cisco 1841 router
STEP 2: Connect the console cable to the console port of the router.
I have a USB to Serial cable and on my computer, this shows as Com 3.
STEP 3: Use either Putty, Teraterm or HyperTerminal to connect the router’s.
In my case, I notice that the serial connected is at COM 3 . I use HyperTerminal for this demonstration.
For some reason, I could not get the break key sequence to work (I tried Ctrl+Break, Break, Alt+], etc…), I had to simulate the break key sequence this way:
STEP 4: HyperTerminal Setup
Use HyperTerminal, connect to the router using 1200 Baud rate, no parity, 8 data bits, 1 stop bit, no flow control.
Then press the space bar for 15 seconds, I saw garbage characters.
STEP 5: Then disconnect the HyperTerminal and reconnect using the default parameter of 9600 Baud rate.
Now I was in Rommon mode.
STEP 6: In Rommon, I perform this:
rommon 1 > confreg 0x2142
You must reset or power cycle for new config to take effect
rommon 2 > i (to restart)
Router>enable
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#enable secret mysecret
Router(config)#config-register 0x2102
Router(config)#exit
Router#wr
Building configuration…
[OK]
Router#reload
Proceed with reload? [confirm]
After the router restarted, I could log into the manager mode with the new password “mysecret”
Router>
Router>enable
Password:
Router#
Now I can show the running configuration of the router as follows:
Router#show run
Building configuration…
Current configuration : 716 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
enable secret 5 $1$pxZH$ymjW3jxDFjp6lN.A0f.Zo1
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
no aaa new-model
ip subnet-zero
ip cef
!
!
no ftp-server write-enable
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip classless
!
!
no ip http server
no ip http secure-server
!
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
login
!
end
Router#

As you can see that I am able to access my Cisco router after clearing the existing unknown password. This tip is very helpful when you buy reconditioned hardware. The total time of this lab was 10 minutes.

Configure PPPoE connection on a Cisco 1841 router

How to configure PPPoE connection on a Cisco router. We will be using the Cisco 1841 for this lab. 
First, erase everything on the router’s configuration and start from scratch.
STEP 1: Erasing the router
This method uses the config-register 0x2102 command in global configuration mode.
Check the configuration register on the router by issuing the show version command. The configuration register setting is displayed in the last line of the show version command output, and should be set to 0x2102. If this is not the case, enter the config-register 0x2102 command once in global configuration mode.
router# configure terminal
router(config)# config-register 0x2102
router(config)# end
router#
If the show version command is issued again, the same line in the command output will have ‘(will be 0x2102 at next reload)’ appended to the current register setting.
STEP 2: Erase the router’s configurations.
Erase the current start-up configuration on the router with the write erasecommand.
STEP 3: Reload the router with the reload command.
When prompted to save the configuration, DO NOT save.
router#reload

System configuration has been modified. Save? [yes/no]: n
Proceed with reload? [confirm]
Once the router reloads, the user will be presented with a ‘System Configuration Dialog’ as shown below. The router is now reset back to the original factory defaults.
— System Configuration Dialog —
Would you like to enter the initial configuration dialog? [yes/no]: n
Show the running config
Router#show run
Building configuration…
Current configuration : 658 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
no aaa new-model
ip subnet-zero
ip cef
!
no ftp-server write-enable
!
interface FastEthernet0/0
ip address dhcp
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip classless
ip http server
no ip http secure-server
!
control-plane
!
line con 0
line aux 0
line vty 0 4
login
!
end
Router#
Paste the following configuration
no parser cache
no service pad
service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname Test
!
boot-start-marker
boot-end-marker
!
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
no aaa new-model
ip subnet-zero
ip cef
!
!
ip dhcp excluded-address 192.168.1.10 192.168.1.20
!
ip dhcp pool 192.168.1.0/24
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 4.2.2.2
!
!
no ip domain lookup
vpdn enable
!
vpdn-group 1
request-dialin
protocol pppoe
!
no ftp-server write-enable
!
interface FastEthernet0/0
description Physical ADSL Interface (Facing the ISP)
no ip address
no ip mroute-cache
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
no cdp enable
!
interface FastEthernet0/1
description My LAN Interface
ip address 192.168.1.1 255.255.255.0
ip nat inside
no ip mroute-cache
duplex auto
speed auto
no cdp enable
!
interface Dialer1
description Logical ADSL Interface
ip address negotiated
ip mtu 1492
ip nat outside
encapsulation ppp
ip tcp adjust-mss 1452
no ip mroute-cache
dialer pool 1
dialer-group 1
no cdp enable
ppp authentication pap callin
ppp pap sent-username xxxxxxx password xxxxxxx
ppp ipcp dns request
ppp ipcp route default
ppp ipcp address accept
!
ip classless
!
!
no ip http server
no ip http secure-server
ip nat inside source list 10 interface Dialer1 overload
!
access-list 10 permit 192.168.1.0 0.0.0.255
dialer-list 1 protocol ip permit
no cdp run
!
!
control-plane
!
line con 0
exec-timeout 120 0
stopbits 1
line aux 0
line vty 0 4
exec-timeout 0 0
login local
length 0
!
scheduler max-task-time 5000
Step 4: Testing
Issue the command show ip int brief to show all interfaces. As you can see from the figure below, everything is up and running and the Dialer1 interface also obtained an IP address from Bell Canada.
And I tested the Internet connection; I could go to Google, anywhere….
Save the configuration:
wr mem
Restart the router and make sure it still works

During the reload process, there will be no Internet connectivity. Of course, when the router comes back up, will have Internet.

CONFIGURE PPPOE CONNECTION ON CISCO ROUTER 1841

Cisco 1841- erase everything on the router’s configuration and start from scratch.

router# configure terminal
router(config)# config-register 0x2102
router(config)# end
router#

router#write erase
router#reload

System configuration has been modified. Save? [yes/no]: n
Proceed with reload? [confirm]


Would you like to enter the initial configuration dialog? [yes/no]: n
Show the running config
Router#show run


Copy and Paste the following configuration into your router

no parser cache
no service pad
service timestamps debug uptime
service timestamps log uptime
service password-encryption
!
hostname cisco
!
boot-start-marker
boot-end-marker
!
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
no aaa new-model
ip subnet-zero
ip cef
!
!
ip dhcp excluded-address 172.17.0.1 172.17.0.50
!
ip dhcp pool 172.17.0.0/21
network 172.17.0.0 255.255.248.0
default-router 172.17.0.1
dns-server 213.42.20.20 195.229.241.222 8.8.8.8


Note:- 
  • If the DHCP Server is on different switch or firewall, remove the above-      given DHCP pool commands.
  • f0/1 IP address and access list, be same as that DHCP Server.
  • Don't forget to give this f0/1 IP Address as default router address on that DHCP Server.



!
!
no ip domain lookup
vpdn enable
!
vpdn-group 1
request-dialin
protocol pppoe
!
no ftp-server write-enable
!
interface FastEthernet0/0
description Physical_Internet_Interface
no ip address
no ip mroute-cache
duplex auto
speed auto
pppoe enable
pppoe-client dial-pool-number 1
no cdp enable
!
interface FastEthernet0/1
description Internal_LAN_Interface
ip address 172.17.0.1 255.255.248.0
ip nat inside
no ip mroute-cache
duplex auto
speed auto
no cdp enable
!
interface Dialer1
description Logical_Internet_Interface
ip address negotiated
ip mtu 1492
ip nat outside
encapsulation ppp
ip tcp adjust-mss 1452
no ip mroute-cache
dialer pool 1
dialer-group 1
no cdp enable
ppp authentication pap callin
ppp pap sent-username xxxxxxxx password xxxxxxxx
ppp ipcp dns request
ppp ipcp route default
ppp ipcp address accept
!
ip classless
!
!
no ip http server
no ip http secure-server
ip nat inside source list 10 interface Dialer1 overload
!
access-list 10 permit 172.17.0.0 0.0.7.255
dialer-list 1 protocol ip permit
no cdp run
!
!
control-plane
!
line con 0
exec-timeout 120 0
stopbits 1
line aux 0
line vty 0 4
exec-timeout 0 0
login local
length 0
!
scheduler max-task-time 5000
---------------------------------------------

Don't forget no shutdown command on interface f0/0 and f0/1

interface fastEthernet 0/0
no shut
interface fastEthernet 0/1
no shut
exit

Save the configuration after the test.

write memory



Cisco router looses configuration after reboot

If you encountered reboot of the device, being a Cisco router or Switch or Wireless Device, get back to factory settings. that means device is bypassing the startup configuration. This is what you get after a reboot:

--- System Configuration Dialog ---
Would you like to enter the initial configuration dialog? [yes/no]:

To fix this answer no to the question and press enter and type the following.

enable
show version

If you notice Configuration register is 0x2142 in the information displayed, then type the following
enable
configure terminal
config-register 0x2102
end
reload


And when asked if you want to save the configuration, type no
Some other Configuration Register codes and what they mean. The list below have been taken from the Cisco website.

0x0000-0x000F | Boot Field Parameters 0×0000 Stays at the system bootstrap prompt 0×0001 Boots system image on EPROM 0x0002-0x000F Specifies a default netboot filename.

0x0040 | Ignore NVRAM contents.
0x0080 | OEM bit enabled to exclude details in boot messages.
0x0100 | Break disabled
0x0400 | IP broadcast with all zeros
0x800-0x1000 | Console line speed
0x2000 | Boot default ROM software if network boot fails
0x4000 | IP broadcasts do not have net numbers
0x8000 | Enable diagnostic message and ignore NVRAM contents

Setup the initial IP address for Cisco NSS322

When plugging in the Cisco Smart Storage for the first time, setting up the IP Address can be a bit tricky and the setup CD isn’t quite plain and simple. So to setup the IP address manually plug in a monitor and a keyboard to the device and once the login process comes up, use the default username and password i.e. admin/admin.
Once you log in, type the following to set the IP Address:

ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
ifconfig eth0


You should see the IP address configured and all there is now to do is enter the address https://192.168.1.5 in your browser and access the web interface of the device.

Recover Cisco configuration and access when password is lost

 

When loosing your credentials on a Cisco router, you can recover it all if you have physical access to it. You have to connect with the console cable and do the following:
Turn off Device
Turn on Device
Press CTRL C or CTRL Break Until rommon 1> shows
Enter confreg
Select as below:
do you wish to change the configuration? y/n [n]: y
enable “diagnostic mode”? y/n [n]:
enable “use net in IP bcast address”? y/n [n]:
disable “load rom after netboot fails”? y/n [n]:
enable “use all zero broadcast”? y/n [n]:
enable “break/abort has effect”? y/n [n]:
enable “ignore system config info”? y/n [n]: y
change console baud rate? y/n [n]:
change the boot characteristics? y/n [n]:
Configuration Summary
(Virtual Configuration Register: 0×2142)
enabled are:
load rom after netboot fails
ignore system config info
console baud: 9600
boot: image specified by the boot system commands
or default to: cisco2-
do you wish to change the configuration? y/n [n]: n
You must reset or power cycle for new config to take effect
Enter reset
Wait for 2 minutes, turn off and on the device
Would you like to enter the initial configuration dialog? [yes/no]: no
Press enter to start
You should see Router>
Enter ena
Enter copy start run
Enter conf t
Enter user admin privilege 15 password 4dm1n
Enter enable secret 4dm1n (or whatever)
If need by change the VTY passwords
Enter copy run start
Enter do sh ver to see the register
Configuration register is 0×2142
Now enter config-register 0×2102
Enter do sh ver to confirm the register has been updated
Enter copy run start
Restart Router
Make sure no shut on all interface