How to Automate Cisco Backup Using Configuration Archive

The absolute worst time to realize that a backup doesn’t exist is when that backup is actually needed. Although network devices often don’t house critical data like a typical SAN, backups are still a very important part of day to day operations. These backups are useful when a device fails or a configuration needs to be rolled back. This article is about using an often overlooked IOS feature as a method of automating the Cisco backup process. Primarily, this will look into different ways to create device backups using the archive commands.
Although administrators always have the ability to fire up a TFTP server and do a “copy running-config tftp”, this is one of those things that is often overlooked. In the event of an operation outage due to mistake or device failure, not having current backups can prolong the recovery process. Network devices, as key components to a typical business, should have their configuration backed up regularly. Not all organizations have network management solution that is capable of or configured to do this critical function.
As demonstrated in this article, this is a simple way to keep regular backups of IOS configurations. Third party and open source tools often provide the ability to reach into the network device from the outside and copy the configuration to a tftp server or do a backup directly from the output of “show” commands. The feature discussed here as an alternative to other third party solutions, provides administrators with the ability to backup a configuration by invoking manually, on a scheduled basis or when the running-config is saved.
This article assumes access to a TFTP server that is always on and reachable via static IP address. In the article, the files will be backed up to 192.168.2.2. A suitable Windows TFTP server can be found at the URLs below. My recommendation is to use the “service” edition so it can be daemonized in the Microsoft environment. If there is a need for some other flavor of TFTP, one should be readily available for your platform of choice.

Windows TFTP Servers

  • TFTPD32 (Download 32 Bit or 64 Bit as appropriate)
The router configuration is pretty straightforward. The basic configuration is as follows.
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#archive
R1(config-archive)#path tftp://192.168.2.2/
R1(config-archive)#exit
R1(config)#exit
That is all that is necessary for a very basic archive configuration. The challenge with this configuration is it is still quite a manual process. Nonetheless, it is a basic configuration and can be tested. To do so is a manual process executed by the “archive config” privilege mode command.
R1#archive config
This should produce an output similar to what is shown below. If not, there is some issue copying the file to the tftp path configured.
R1#archive config
!!
R1#
Looking in the TFTP directory, there should also be a new file listed. Most likely this is called something like “-1″.
Basic Configuration Archive TFTP FIle
Realizing that “-1″ is a bit obscure, it might make sense to name the files something like “hostname-x” where “x” is some kind of index number. There are two ways to accomplish this. The first method involves hard coding the path to include the hostname. The second method uses the “$h” variable to derive the hostname from the individual router configuration. I prefer to use the variable method so the configuration is portable from device to device.

Hostname in Path

R1(config)#archive
R1(config-archive)#path tftp://192.168.2.2/R1
R1(config-archive)#exit

Hostname Variable in Path

R1(config)#archive
R1(config-archive)#path tftp://192.168.2.2/$h
R1(config-archive)#exit
Now when the file is archived, it will be more descriptive.
Descriptive Cisco Archive Filename
At this point, it is very easy for an administrator to manually backup the IOS configuration. The problem with that it is still a manual process. Manual processes have a way of not getting the attention they deserve. There is an option that will allow this to be automatically performed any time the running-configuration is saved. Since administrators should be saving their configurations after any change, it helps solve the problem of not having an iteration of the configuration. This feature is enabled with the “write-memory” option.

Archive Write-Memory Option

R1(config)#archive
R1(config-archive)#write-memory
R1(config-archive)#exit
Now saving the configuration should also archive it. This is easily tested by doing a “wr” or “copy running-config startup-config”.
WR MEM Option
As can be seen in the image above, the output now shows “[OK]!!”. The !! is the acknowledgement from the TFTP process. In addition, there is another new file created.
The final option that can be added to the configuration is a scheduled backup. This is actually external to the archive process, but is a way to accomplish the goal. For some time, Cisco routers have had the ability to use the kron configuration to schedule router functions. This can be used to automate a weekly or monthly execution of the “archive config” command.

Kron Scheduling of Archive

R1(config)#kron policy-list Archive
R1(config-kron-policy)#cli archive config
R1(config-kron-policy)#exit
R1(config)#kron occure
R1(config)#kron occurenc Backup at 3:20 Sun recur
R1(config)#kron occurrence Backup at 3:20 Sun recurring
R1(config-kron-occurrence)#policy-list Archive
Now the router will execute the archive command every Sunday at 3:20AM. This should produce a current copy of the running configuration on the TFTP server.
To view the archived files from the router, the “show archive log” command can be executed.
R1#show archive
The next archive file will be named tftp://192.168.2.2/R1-4
 Archive #  Name
   0
   1       tftp://192.168.2.2/R1-1
   2       tftp://192.168.2.2/R1-2
   3       tftp://192.168.2.2/R1-3
As demonstrated in this article, there is a pretty easy way to keep regular backups of IOS configurations. Third party and open source tools often provide the ability to reach into the network device from the outside and copy something to a tftp server or do a backup directly. As an alternative, Cisco provides administrators with the archive feature that can be invoked manually, on a scheduled basis or when the running-config is saved. This feature, known as Cisco configuration archive, provides administrators who lack access to sophisticated third party network management solutions a viable solution to keep up with their IOS configuration files.
Đọc thêm..

How to reset the 3750 to factory default

config t
write erase
yes to confirm
then reload the switch
If you have VLAN's on the switch you will also have to delete the vlan.dat file
delete flash:vlan.dat
yes to confirm


Or

Steps to reset switches to default are are available at
http://www.cisco.com/en/US/products/hw/switches/ps607/products_tech_note09186a00800c4546.shtml
Đọc thêm..

VMPS Cisco - Dynamic Vlan


Dynamic VLAN

Reference:
Chapter 4 - Academy – Semester 7
Cisco CD Documentation
http://www.cisco.com/univercd/cc/td/...g/mascvmps.htm

Static VLAN (port-based VLAN) là loại VLAN thường gặp nhất, trong đó các port trên switch được gán trực tiếp và cố định vào VLAN.

Dynamic VLAN là loại VLAN mà trong đó các thành viên của VLAN được xác định bằng MAC address của thiết bị gắn vào switch. Quá trình này dựa vào bảng địa chỉ “MAC address to VLAN” lưu trong VMPS database. Khi đổi host sang switch khác, switch sẽ thực hiện chỉ định VLAN cho host đó.

- Mỗi dynamic port chỉ thuộc 1 VLAN. Traffic sẽ không lưu thông qua port này cho đến khi VMPS server chỉ định VLAN cho port này.

-Khi kích hoạt VMPS, VMPS database từ TFTP server sẽ download vào VMPS server trên switch(nếu reset VMPS server thì sẽ thực hiện download lại từ TFTP).

- Khi host được gắn vào dynamic port, VMPS client sẽ nhận được source MAC address. Sau đó, VMPS client sẽ tiến hành kiểm tra MAC này bằng cách gửi VQP request đến VMPS server, VMPS server sẽ gửi về VLAN number cho VMPS client. VMPS Client sẽ cấu hình port vào đúng VLAN dựa trên những thông tin nhận từ VMPS Server.


Lưu ý:
- Nhiều host có thể hoạt động trên cùng 1 dynamic port khi chúng cùng chung VLAN. Tối đa là 20 host (đối với 29xx XL) và 50 host (Catalyst 5xxx), dynamic port sẽ bị shutdown => Cần thực hiện lệnh no shut để reenable a shutdown dynamic port.
- Cần cấu hình VMPS trước khi cấu hình dynamic port.
- VMPS server và VMPS client phải cùng chung management VLAN.
- Khi cấu hình dynamic port sẽ tự động kích hoạt spanning-tree PortFast(PortFast là 1 tính năng của STP cho phép port gửi frame ngay khi physical link active), do đó chú ý disable portfast mode khi cần thiết.
- Static secure port không thể làm dynamic port => cần turn off security trên static secure port trước khi cấu hình dynamic.
- Trunk port không thể làm dynamic port => cần turn off trunking trên trunk port trước khi cấu hình dynamic.

Các bước cấu hình VMPS và dynamic port

Bước 1: Tạo VMPS database(text file) & lưu trên TFTP server

- Định nghĩa VMPS domain
- Định nghĩa security mode (default mode = open mode, VMPS operate both)
- Định nghĩa MAC-to-VLAN mapping
- Định nghĩa port group
- Định nghĩa VLAN group
- Định nghĩa VLAN port policy

vmps domain WBU
!
vmps mode open
!
vmps-mac-addrs
!
address 0012.2233.4455 vlan-name hardware
address 0000.6509.a080 vlan-name hardware
address aabb.ccdd.eeff vlan-name Green
address 1223.5678.9abc vlan-name ExecStaff
address fedc.ba98.7654 vlan-name --NONE--
address fedc.ba23.1245 vlan-name Purple

!Port groups
vmps-port-group WiringCloset1
device 192.168.1.1 port Fa1/3
device 172.16.1.1 port Fa1/4
vmps-port-group "Executive Row"
device 192.168.2.2 port es5%Fa0/1
device 192.168.2.2 port es5%Fa0/2
device 192.168.2.3 all-ports

!VLAN groups
vmps-vlan-group Engineering
vlan-name hardware
vlan-name software

!VLAN port Policies
vmps-port-policies vlan-group Engineering
port-group WiringCloset1
vmps-port-policies vlan-name Green
device 192.168.1.1 port Fa0/9
vmps-port-policies vlan-name Purple
device 192.168.2.2 port Fa0/10
port-group "Executive Row"

Bước 2: Cấu hình VMPS Server
VMPS Server chỉ chạy trên 2926G series và Catalyst 5000 (more…?) => Tập lệnh set-based.

1- Chỉ định cách thức download VMPS database(set vmps tftpserver ip-address [filename])
Console> (enable) set vmps tftpserver 172.16.254.222 vmps_config.db
Console> (enable)

2- Enable VMPS
Console> (enable) set vmps state enable
Vlan Membership Policy Server enable is in progress.
Console> (enable)
Sau khi thực hiện lệnh này file vmps_config.db sẽ download xuống Switch, switch trở thành VMPS server. Khi muốn update thông tin, có thể thực hiện lệnh download vmps (dùng để troubleshoot)

3- Chỉ định Primary/Secondary VMPS server
Console> (enable) set vmps server 172.20.26.150 primary
Console> (enable) set vmps server 172.20.26.152
Console> (enable) set vmps server 172.20.26.159

4. Kiểm tra VMPS server address
Console> (enable) show vmps server



Bước 3: Cấu hình VMPS Client

Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan dynamic
Switch(config-if)# end

Switch# show interface fa0/1 switchport
Name: Fa0/1
Switchport: Enabled
Administrative mode: dynamic access
Operational Mode: dynamic access
Administrative Trunking Encapsulation: isl
Operational Trunking Encapsulation: isl
Negotiation of Trunking: Disabled
Access Mode VLAN: 0 ((Inactive))
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: NONE
Pruning VLANs Enabled: NONE

Bước 4optional) Cấu hình Retry, Reconfirm Interval
The default reconfirm interval is 60 minutes. The default number of retries on a VQP query are 3
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# vmps reconfirm 60
Switch(config)# vmps retry 10
Switch(config)# end

Switch# show vmps
VQP Client Status:
--------------------
VMPS VQP Version: 1

Reconfirm Interval: 60 min
Server Retry Count: 10
VMPS domain server: 172.20.130.50 (primary, current)

Reconfirmation status
---------------------
VMPS Action: No Host

Để đảm bảo các dynamic port nhận được VLAN Membership ta thực hiện lệnh VMPS reconfim

Switch# vmps reconfirm
Switch# show vmps
VQP Client Status:
--------------------
VMPS VQP Version: 1
Reconfirm Interval: 60 min
Server Retry Count: 10
VMPS domain server: 172.20.130.50 (primary, current)

Reconfirmation status
---------------------
VMPS Action: Success
Đọc thêm..

WCCP - Web Cache Communication Protocol

Following with the notes/reviews from IPExpert CCIE R&S Blended Learning Solutions Video-on-Demand , we´re today presented with WCCP! :)
WCCP is used between Routers, Layer3 Switches and Web-Caches. It´s used to optimize resource utilization, and lower response times, when a user make a web request, for example, that´s the kind of traffic you want to redirect to the Web-Cache, hopefully you (better, your Web-Cache) have some information cached locally and that will decrease the response time.
As far as the exam is concearned, there´s no real Web-Cache on the LAB. Well... at least for now there isn´t! The "goal" would be setup the routers to talk with it, and that´s pretty much what we can be asked to do!
We´ll have no other way to test it than just a few show commands.
To enable your router (or layer 3 device) to talk to the Web-Cache, you need to enable WCCP with the global configuration command:
  • ip wccp web-cache
After that, we need to choose the traffic to send to the Web-Cache, it can be either the outside interface where requests goes out:
  • ip wccp web-cache redirect out
OR, the incoming interface as requests comes in:
  • ip wccp web-cache redirect in
Choose one (not both) that fits the best what was requested in your lab!
Just a few commands to do that, right?! Not too bad! But... which interface is supposed to be configured as "redirect in" and which interface is "redirect out" ?!
It´ll be easier to undesrtand checking the diagram bellow:
If you want to send the traffic coming from users connected in SW1 to the Web-Cache, you need to configure the interface F0/0 as ip wccp web-cache redirect in.
Now, if you want to send the traffic going out S0/0 to the internet, you need to configure the S0/0 as ip wccp web-cache redirect out. Don´t use both (redirect in and redirect out) choose the one that best fits the task requirements.
Remember, the redirect perspective is "router centric", so traffic coming from your network are IN and traffic going out to the internet from your network are OUT, just keeping this in mind, you´ll never have problems to figure which type of redirect to use when configuring WCCP.
Now, if for example, both user traffic to be sent to the Web-Cache, and the Web-Cache itself are connected to the same router interface (for example F0/0) we need to use the command: ip route-cache same-interface, this will "hairpin" the traffic coming from users in this interface to the Web-Cache. Off course, this solution is not the most efficient and it consumes the most resources (CPU, Interface bandwidth, etc), but, keep in mind that CCIE Lab is not graded on performance, it´s graded on achieving the results that the task is asking for!
Again, checking our diagram, if you want to send traffic from users either in F0/0 and F0/1 to the Web-Cache, we can do a ip wccp web-cache redirect in at F0/0 and F0/1 OR we can configureip wccp web-cache redirect out at S0/0, both will attend the request! Select the best option, and use it!
Also you can apply a "Redirect Filter" (an access-list) filtering just the traffic you want, that is done with some optional parameters in the global configuration command ip wccp web-cache:
  • ip wccp web-cache redirect-list --> used to select which user traffic to send / not to send to the Web-Cache;
  • ip wccp web-cache group-list --> used to select which Web-Cache to use;
  • ip wccp web-cache password --> used to configure a password to authenticate with the Web-Cache.
UDP port 2048 is the port used between the Router and the Web-Cache to communicate, and GRE is the tunnel method used. There´s nothing more to do at the routers than to say YES, I want to talk with the Web-Cache, and HOW to do the redirections, all other configurations goes in the Web-Cache itself.
As far as the CCIE Lab Exam will not include any real Web-Cache, we can only use the command show ip wccp web-cache detailto check some generic information and also if WCCP is enable and which interfaces are participating in the WCCP process!
Some examples:
access-list 10 permit host 10.1.1.1
access-list 10 permit host 10.1.1.2
ip wccp web-cache group-list 10
This will "notify" the router that only IP Addresses 10.1.1.1 and 10.1.1.2 are valid Web-Caches to register with!
Another one:
access-list 110 deny ip any host 200.207.108.2
access-list 110 permit ip any any
!
ip wccp web-cache redirect-list 100
!
interface FastEthernet 0/0
ip wccp web-cache redirect in
This example will configure the router to redirect web-related packets received via interface fastethernet 0/0, destined to any host except 200.207.108.2 to the Web-Cache.
And many others included in the IPExpert Video-on-Demand ! You can also check Cisco ´s DocCD to find some useful information and examples.
Đọc thêm..

Connecting Customer Trunk with QinQ

So, straight to the point, below is the diagram:

Sw-PE-1 and Sw-PE-2 is the Service Provider edge Switches. Sw-CE-1 and Sw-CE2 is the customer switches that have dot1q trunk connection . R1, R2, R5 and R6 is the customer routers.
R1 and R2 are in the VLAN 100 segment and have IP Network 100.100.1.0/24. R5 and R6 are in the VLAN 34 segment and have IP Network 10.10.10.0/24. The trunk between Sw-CE-1 and Sw-CE-2 just allowed VLAN 34 and 100 to traverse over it. Sw-PE-1 connected to Sw-CE-1 as a dot1q-tunnel, same like the connection from Sw-PE-2 to Sw-CE-2. Sw-PE-1 connected to Sw-PE-2 via Etherchannel.
The scenario is to make (R1 and R2) and (R5 and R6) are in the same broadcast domain. Beside that, the CDP and VTP information will pass the trunk between Sw-CE-1 and Sw-CE-2.
Below is the relevant configuration and verifying process to fulfil the scenario above (Just show the Layer 3 connection between R1 and R2 and Layer 2 Connection between Sw-CE-1 and Sw-CE-2):
Sw-PE-1:
Sw-PE-1#sh run int f0/15
interface FastEthernet0/15
description To-Sw-1
switchport access vlan 12
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel vtp
no cdp enable
end
Sw-PE-1#sh int f0/15 switchport
Name: Fa0/15
Switchport: Enabled
Administrative Mode: tunnel
Operational Mode: tunnel

Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 12 (VLAN0012)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Sw-PE-1#show l2protocol-tunnel interface f0/15 summ
COS for Encapsulated Packets: 5
Port Protocol Shutdown Drop Status
Threshold Threshold
(cdp/stp/vtp) (cdp/stp/vtp)
(pagp/lacp/udld) (pagp/lacp/udld)
——- ———– —————- —————- ———-
Fa0/15 cdp — vtp —-/—-/—- —-/—-/—- up
—- —- —- —-/—-/—- —-/—-/—-
Sw-PE-2:
Sw-PE-2#sh run int f0/16
interface FastEthernet0/16
switchport access vlan 12
switchport mode dot1q-tunnel
l2protocol-tunnel cdp
l2protocol-tunnel vtp
no cdp enable
end
Sw-PE-2#sh int f0/16 switchport
Name: Fa0/16
Switchport: Enabled
Administrative Mode: tunnel
Operational Mode: tunnel

Administrative Trunking Encapsulation: negotiate
Operational Trunking Encapsulation: native
Negotiation of Trunking: Off
Access Mode VLAN: 12 (VLAN0012)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk private VLANs: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Protected: false
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Appliance trust: none
Sw-PE-2#sh l2protocol-tunnel summary
COS for Encapsulated Packets: 5
Drop Threshold for Encapsulated Packets: 0
Port Protocol Shutdown Drop Status
Threshold Threshold
(cdp/stp/vtp) (cdp/stp/vtp)
(pagp/lacp/udld) (pagp/lacp/udld)
——- ———– —————- —————- ———-
Fa0/16 cdp  vtp —-/—-/—- —-/—-/—- up
—- —- —- —-/—-/—- —-/—-/—-
Sw-CE-1:
Sw-CE-1#sh run int f0/18
interface FastEthernet0/18
description To-Sw-3
switchport trunk encapsulation dot1
switchport trunk allowed vlan 34,10
switchport mode trunk
end
Sw-CE-1#sh run int f0/1
interface FastEthernet0/1
switchport access vlan 100
switchport mode access
end
Sw-CE-1#sh run int f0/5
interface FastEthernet0/5
switchport access vlan 34
switchport mode access
end
Sw-CE-1#
Sw-CE-1#sh int trunk
Port Mode Encapsulation Status Native vlan
Fa0/18 on 802.1q trunking 1
Port Vlans allowed on trunk
Fa0/18 34,100
Port Vlans allowed and active in management domain
Fa0/18 34,100
Port Vlans in spanning tree forwarding state and not pruned
Fa0/18 34,100
Sw-CE-1#
Verify that CDP information can pass the trunk link
Sw-CE-1#sh cdp nei
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
Sw-CE-2 Fas 0/18 161 S I WS-C3560G Gig 0/19
R1 Fas 0/1 133 R S I 3825 Gig 0/0
R5 Fas 0/5 128 R S I 2811 Fas 0/0
Sw-CE-1#
Sw-CE-2:
Sw-CE-2#sh run int g0/19
interface GigabitEthernet0/19
description To-Sw-4
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 34,100
switchport mode trunk
end
Sw-CE-2#sh run int g0/6
interface GigabitEthernet0/6
switchport access vlan 34
switchport mode access
end
Sw-CE-2#sh run int g0/2
interface GigabitEthernet0/2
switchport access vlan 100
switchport mode access
end
Sw-CE-2#sh int trunk
Port Mode Encapsulation Status Native vlan
Gi0/19 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi0/19 34,100
Port Vlans allowed and active in management domain
Gi0/19 34,100
Port Vlans in spanning tree forwarding state and not pruned
Gi0/19 34,100
Verify that CDP information can pass the trunk link
Sw-CE-2#sh cdp nei
Capability Codes: R – Router, T – Trans Bridge, B – Source Route Bridge
S – Switch, H – Host, I – IGMP, r – Repeater, P – Phone
Device ID Local Intrfce Holdtme Capability Platform Port ID
Sw-CE-1 Gig 0/19 130 S I WS-C3560- Fas 0/18
BB2 Gig 0/24 140 R S I 2821 Gig 0/0
R2 Gig 0/2 171 R S I 3825 Gig 0/1
R6 Gig 0/6 158 R S I 2811 Fas 0/1
Sw-CE-2#
Verify that VTP (VLAN Trunking Protocol can pass the trunk link between Sw-CE-1 and Sw-CE-2 (In this scenario, Sw-CE-1 is VTP Server and Sw-CE-2 is the VTP client. The VTP domain is CISCO):
Sw-CE-1#sh vtp status
VTP Version : 2
Configuration Revision : 4
Maximum VLANs supported locally : 1005
Number of existing VLANs : 7
VTP Operating Mode : Server
VTP Domain Name : CISCO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0×13 0xA1 0xBA 0x0E 0xC2 0x2A 0xC9 0xCE
Configuration last modified by 10.10.34.1 at 3-1-93 01:16:52
Local updater ID is 10.10.34.1 on interface Vl34 (lowest numbered VLAN interface
found)
Sw-CE-1#sh vlan | i 100
100 100-VLAN active Fa0/1
100 enet 100100 1500 – – – – – 0 0
Sw-CE-2#sh vtp status
VTP Version : 2
Configuration Revision : 4
Maximum VLANs supported locally : 1005
Number of existing VLANs : 7
VTP Operating Mode : Client
VTP Domain Name : CISCO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0×13 0xA1 0xBA 0x0E 0xC2 0x2A 0xC9 0xCE
Configuration last modified by 10.10.34.1 at 3-1-93 01:16:52
Sw-CE-2#sh vlan | i 100
100 100-VLAN active Gi0/2
100 enet 100100 1500 – – – – – 0 0
Sw-CE-2#
R1:
R1#sh run int g0/0
interface GigabitEthernet0/0
description To-Sw-1
ip address 100.100.1.1 255.255.255.0
duplex auto
speed auto
media-type rj45
negotiation auto
end
R2:
R2#sh run int g0/1
interface GigabitEthernet0/1
ip address 100.100.1.2 255.255.255.0
duplex auto
speed auto
media-type rj45
negotiation auto
end
So, let we verify the Layer 3 connection between R1 and R2
R1#ping 100.100.1.2
Sending 5, 100-byte ICMP Echos to 100.100.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
R2#ping 100.100.1.1
Sending 5, 100-byte ICMP Echos to 100.100.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Verify that R1 G0/0 and R2 G0/1 are in the same broadcast domain
R1#ping 255.255.255.255 repeat 1
Sending 1, 100-byte ICMP Echos to 255.255.255.255, timeout is 2 seconds:
Reply to request 0 from 100.100.1.2, 1 ms
R1#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 100.100.1.1 – 001b.d57e.7190 ARPA GigabitEthernet0/0
Internet 100.100.1.2 138 001b.d57e.7311 ARPA GigabitEthernet0/0
R2#ping 255.255.255.255 rep 1
Sending 1, 100-byte ICMP Echos to 255.255.255.255, timeout is 2 seconds:
Reply to request 0 from 100.100.1.1, 1 ms
R2#sh arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 100.100.1.1 139 001b.d57e.7190 ARPA GigabitEthernet0/1
Internet 100.100.1.2 – 001b.d57e.7311 ARPA GigabitEthernet0/1
Đọc thêm..

Configuration Register Values and their Meaning

configreg

If you know the value of your configuration register, you can determine its meaning. For information on the meaning of your configuration register setting, including potential issues and fixes, collect the output of the show version command, or the show tech-support command, and input into the Output Interpreter (registered customers only) tool. In order to use Output Interpreter (registered customers only) , you must be a registered customer, be logged in, and have JavaScript enabled.
This table contains some common settings which are valid on most platforms.
Note: Check the appropriate hardware installation guide to verify that the configuration register can be used before you change the configuration register on your router to one of the values in this table.
Configuration Register Setting Router Behavior
0x102
  • Ignores break
  • 9600 console baud
0x1202
  • 1200 baud rate
0x2101
  • Boots into bootstrap
  • Ignores break
  • Boots into ROM if initial boot fails
  • 9600 console baud rate
0x2102
  • Ignores break
  • Boots into ROM if initial boot fails
  • 9600 console baud rate default value for most platforms
0x2120
  • Boots into ROMmon
  • 19200 console speed
0x2122
  • Ignores break
  • Boots into ROM if initial boot fails
  • 19200 console baud rate
0x2124
  • NetBoot
  • Ignores break
  • Boots into ROM if initial boot fails
  • 19200 console speed
0x2142
  • Ignores break
  • Boots into ROM if initial boot fails
  • 9600 console baud rate
  • Ignores the contents of Non-Volatile RAM (NVRAM) (ignores configuration)
0x2902
  • Ignores break
  • Boots into ROM if initial boot fails
  • 4800 console baud rate
0x2922
  • Ignores break
  • Boots into ROM if initial boot fails
  • 38400 console baud rate
0x3122
  • Ignores break
  • Boots into ROM if initial boot fails
  • 57600 console baud rate
0x3902
  • Ignores break
  • Boots into ROM if initial boot fails
  • 2400 console baud rate
0x3922
  • Ignores break
  • Boots into ROM if initial boot fails
  • 115200 console baud rate
Đọc thêm..

Tweaking IO Memory Allocation

Recently I upgraded all of the community lab 1841 routers to 256 MB of DRAM. In doing so, I noticed something I hadn't before: the percentage of dynamic memory (DRAM) allocated to input/output (IO) memory seemed to vary among different revisions of hardware, even when they had the same modules and total amount of DRAM. This can lead to unexpected issues when implementing memory-intensive features, as was encountered by at least one lab user.
To inspect the amount of memory installed in a Cisco router, look for this line toward the bottom of the show version output:
Router# show version
...
Cisco 1841 (revision 6.0) with 239616K/22528K bytes of memory.
...
The first number is the amount of memory available to software processes, or process memory. The second number is the remaining amount, which has been allocated for IO memory (interface buffers). Adding the two numbers returns the total amount of DRAM installed:
  • 239616 KB + 22528 KB = 262144 KB
  • 262144 KB / 1024 = 256 MB
If you encounter a router which seems to have a disproportionately large or small IO memory allocation, the memory-size iomem command can be used to modify it as a percentage between 5 and 50 percent (in increments of 5%) of the total DRAM installed.
Router(config)# memory-size iomem 10
Smart-init will be disabled and new I/O memory size will take effect upon reload.
As indicated, this command disables smart initialization, which is responsible for automatic IO memory allocation based on the modules installed. After a reload, we can verify that the IO memory allocation has been modified, and the memory-size iomem 10 command is present in the configuration:
Router# show version
...
Cisco 1841 (revision 6.0) with 235520K/26624K bytes of memory.
...
Router# show running-config | include iomem
memory-size iomem 10
IO memory allocation can be restored to its default behavior (relying on smart-init) by issuing the command default memory-size iomem:
Đọc thêm..

Completely Clearing a Cisco Switch

I found this post on the excellent Cisco Blog:
Completely Clearing a Cisco Switch…The Easy Way!
Clearing out a Cisco switch configuration is always a pain because VLANs are kept in a seperate file from the startup-config (NVRAM). There’s two ways to clear a switch back to the factory defaults – the easy way and the REALLY easy way:

The easy way
 -
Switch# write erase
Switch# delete flash:vlan.dat
Switch# reload
The REALLY easy way -
Hold the “mode” button on the front of the switch for 10 seconds. The lights will blink then go solid – the switch completely wipes all configuration and then reboots. Obviously, this method only works on stackable switches as the chassis based switches do not have mode buttons.

Comments

Umm, is it me or is this not a terribly great feature. I know physical security is part of maintaining a secure environment, but this kind of kicks that higher up the requirements chain.
Any know of a way of disabling this ‘feature’?
Posted by: Scared at May 20, 2007 7:21 PM
In my experience this does not wipe the switch at all, it just renames the configfiles and reboots.
“no setup express” disables the button.
Posted by: ior at May 25, 2007 3:08 PM 
Let’s attempt to replicate this on a 3560 and see what happens.
Let’s go ahead and add some vlans, vtp config, and some descriptions on the first 5 interfaces:Switch(config)#vtp domain CISCO
Changing VTP domain name from NULL to CISCO
Switch(config)#vtp mode server
Device mode already VTP SERVER.
Switch(config)#vtp password PASSWORD
Setting device VLAN database password to PASSWORD
Switch(config)#int range fa0/1 – 5
Switch(config-if-range)#desc -> I like beer!!!
Switch(config-if-range)#vlan 2-10,13,69
Switch(config-vlan)#^Z
Switch#sh vtp
00:07:19: %SYS-5-CONFIG_I: Configured from console by consolestatus
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 16
VTP Operating Mode              : Server
VTP Domain Name                 : CISCO
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x9C 0×62 0xCB 0xFE 0xB7 0×89 0x4A 0xB8
Configuration last modified by 0.0.0.0 at 3-1-93 00:07:19
Local updater ID is 0.0.0.0 (no valid interface found)
Switch#sh vlan sum
Number of existing VLANs           : 16
 Number of existing VTP VLANs      : 16
 Number of existing extended VLANs : 0
Switch#sh int desc
Interface                      Status         Protocol Description
Vl1                            admin down     down
Fa0/1                          down           down     -> I like beer!!!
Fa0/2                          down           down     -> I like beer!!!
Fa0/3                          down           down     -> I like beer!!!
Fa0/4                          down           down     -> I like beer!!!
Fa0/5                          down           down     -> I like beer!!!
and the hostname :)
Switch(config)#hostname sw1
sw1(config)#^Z
sw1#
00:08:10: %SYS-5-CONFIG_I: Configured from console by console
sw1#write
Building configuration…
[OK]
Now let’s take a look at the flash:sw1#sh flash
Directory of flash:/
    2  -rwx        1216   Mar 01 1993 00:07:19  vlan.dat
    3  -rwx           5   Mar 01 1993 00:08:26  private-config.text
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
   85  -rwx        3485   Mar 01 1993 00:08:26  config.text
15998976 bytes total (9540608 bytes free)
Let’s go ahead and hold the mode button for 10 seconds:
As I hold the mode button – STAT, DUPLX, SPEED, and PoE lights blink together and then go solid.  I stop pushing the mode button at that point.
Notice this message after I release the mode button:sw1#
00:09:18: %SYS-7-NV_BLOCK_INIT: Initalized the geometry of nvram
00:09:18: %EXPRESS_SETUP-6-CONFIG_IS_RESET: The configuration is reset and the system will now reboot
00:09:19: %SYS-5-RELOAD: Reload requested
The switch comes back up:Switch uptime is 2 minutes
System returned to ROM by power-on
Switch#sh start
startup-config is not presentSwitch#sh flash
Directory of flash:/
    2  -rwx        1216   Mar 01 1993 00:07:19  vlan.dat    3  -rwx           5   Mar 01 1993 00:08:26  private-config.text.renamed    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
   85  -rwx        3485   Mar 01 1993 00:08:26  config.text.renamed
15998976 bytes total (9540608 bytes free)
The VTP configuration is still intact (due to vlan.dat not being deleted):Switch#sh vtp statu
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 1005
Number of existing VLANs        : 16VTP Operating Mode              : ServerVTP Domain Name                 : CISCOVTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x9C 0×62 0xCB 0xFE 0xB7 0×89 0x4A 0xB8
Configuration last modified by 0.0.0.0 at 3-1-93 00:07:19
Local updater ID is 0.0.0.0 (no valid interface found)
Switch#sh vlan sum
Number of existing VLANs           : 16 Number of existing VTP VLANs      : 16 Number of existing extended VLANs : 0
Interesting.  The startup-configuration is blown away but still appears in flash, albeit with “renamed” tacked on the end.  The vlan.dat file is still present, so we retain our VTP settings.  The private-config.text* file has also been retained, but with “renamed” appended to it as well. 
* According to this page, the private-config.text file is used by Cisco devices to store things like crypto private keys.
Let’s remove the “renamed” portion of the config.text file and restore our startup-configuration:
Switch#rename flash:config.text.renamed flash:config.text
Destination filename [config.text]?
Switch#sh start
Using 3485 out of 524288 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname sw1
!
!
ip subnet-zero
!
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
!
interface FastEthernet0/1
 description -> I like beer!!!
 no ip address
 no mdix auto
!
interface FastEthernet0/2
 description -> I like beer!!!
 no ip address
 no mdix auto
…..
So the config.text.renamed is the startup config.  It’s good to know that this is still around.  We can just rename it and then do “copy start run”
Switch#copy start run
%% Non-volatile configuration memory invalid or not present
Zoiks!!!  Maybe not! :-)
Let’s rename the private-config file and see if that helps.
Switch#$h:private-config.text.renamed flash:private-config.text
Destination filename [private-config.text]?
Switch#sh flash
Directory of flash:/
    2  -rwx        1216   Mar 01 1993 00:07:19  vlan.dat
    3  -rwx           5   Mar 01 1993 00:08:26  private-config.text    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
   85  -rwx        3485   Mar 01 1993 00:08:26  config.text
15998976 bytes total (9540608 bytes free)
Switch#copy start run
%% Non-volatile configuration memory invalid or not present
Nope.  Interesting.  Well a reload ought to do the trick
Switch#reload
Proceed with reload? [confirm]
00:27:04: %SYS-5-RELOAD: Reload requested
And it works:
sw1>en
sw1#sh run
Building configuration…
Current configuration : 3512 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname sw1!
!
ip subnet-zero
!
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
!
interface FastEthernet0/1
 description -> I like beer!!!
 no ip address
……
Okay.  Let’s see if we can turn this behavior off by configuring “no express setup”:
sw1(config)#no setup ?
  express  Configure whether express setup mode is enabled
sw1(config)#no setup express
Let’s see what’s in flash and then write the config:sw1#sh flash
Directory of flash:/
    2  -rwx        3378   Mar 01 1993 00:06:38  config.text
    3  -rwx           5   Mar 01 1993 00:06:38  private-config.text
    4  -rwx         976   Mar 01 1993 00:10:31  vlan.dat
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
15998976 bytes total (9541120 bytes free)
sw1#write
Building configuration…
[OK]
sw1#
Now let’s hold the mode button and see what happens.
Not a damned thing!!! :-)   I held the mode button down and all it ever did was move the light from STAT to DUPLX.
I would say that “no express setup” is a great command to throw into your base configuration for all of your switches.  While holding down the mode button until the lights are solid will default your configuration, that configuration will not be lost and your vlan.dat file will not be deleted (your vtp configuration will persist).  At least on the 3560, this is not a method that will acheive the same results as write erase, delete flash:vlan.dat, reload.
For comparison, here’s what happens with when we do these steps:
sw1#sh flash
Directory of flash:/
    2  -rwx           5   Mar 01 1993 00:11:59  private-config.text
    4  -rwx         976   Mar 01 1993 00:10:31  vlan.dat
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
   85  -rwx        3555   Mar 01 1993 00:11:59  config.text
15998976 bytes total (9541120 bytes free)
sw1#write erase
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
sw1#sh fla
00:16:59: %SYS-7-NV_BLOCK_INIT: Initalized the geometry of nvram
Write erase deletes “private-config.text” and “config.txt” from flash:
sw1#sh flash
Directory of flash:/
    4  -rwx         976   Mar 01 1993 00:10:31  vlan.dat
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
15998976 bytes total (9545216 bytes free)
sw1#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
sw1#sh flash
Directory of flash:/
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
15998976 bytes total (9546240 bytes free)
sw1#sh start
startup-config is not present
sw1#reload
System configuration has been modified. Save? [yes/no]: no
Proceed with reload? [confirm]
00:18:44: %SYS-5-RELOAD: Reload requested
….
After the reload:Switch>en
Switch#sh flash
Directory of flash:/
    5  drwx         192   Mar 01 1993 00:05:28  c3560-i9-mz.121-19.EA1d
15998976 bytes total (9546240 bytes free)

To summarize: Resetting the switch will not acheive the same result as deleting the vlan.dat, doing a “write erase”, and then reloading the switch.  It will blow away your startup-configuration, but the good news is that you can easily recover that file (along with the private-config.text file) and restore your configuration by just renaming a couple of files and reloading.  I would strongly recommend disabling this “feature” by using the “no express setup” command in your switch’s configuration.  There is no reason to allow someone to blow away your switch’s configuration by simply pressing a button. :-)
Đọc thêm..