Fryguy

Archive for the ‘Uncategorized’ Category

1995 Mustang Cobra Hardtop Convertible

In Uncategorized on January 16, 2011 at 22:22

Well, if you have not figured it out from the title, this is not a technical blog posting.  I have had a few people ask me about my car and give me confused, bewildered, and otherwise mystified faces.  Why you wonder, well – most people do not know that Ford ever made this car.  Yes, it is a Mustang; Yes, it is a Cobra; Yes, it is a convertible; and Yes – it has a removable hard-top as well! This was a car that I have wanted since I first saw them in 1995 at a local dealership, but unfortunately at that time I was not able to afford one.  As they say, all good things come to those who wait.

The 1995 Cobra was powered by a 240-hp 5.0L V-8 and is the same engine used in the 1994 Mustang Cobra.  The cars do 0-60 in about 6.7 seconds (slow compared to most cars today but back then that was quick!) and has a top speed of 140 mph.  Color options for the standard Mustang Cobra were Black (1433), White (1125), and Red (1447), for a total of 4005 units, of those 1003 convertibles were produced.  The 1995 model year was the only year a convertible hardtop was produced and only 499 of these Hardtop Convertibles were produced – all in Black .  There was a hardtop/ragtop that was installed as a prototype on a V6 and some GT Mustangs but were never “officially” produced.  Another new feature for 1995 was the addition of SVT badging, the Cobra’s from the previous years did not designate themselves as Special Vehicle Team cars.

What is the purpose of the Hardtop Convertible one may ask?  Well, the whole reason behind it (from my understanding) is so you can have a convertible in the summer via the soft-top, and then when Winter comes, put the hardtop on and you are good to go.  It was designed to be an all year car, not like the regular convertibles of the day that were summer only.  The hardtop has glass in the rear with a defogger, so it is a fully functioning top. Interior light, headliner, etc!

You can see the V6 Hardtop Convertible as well as some of the other prototype cars in the VHS cassette that accompanied the purchase of the car.  This tape was the instructions for how to remove and install the hard-top.   When I purchased my car the VHS tape came with it – and it was in very good shape.  I have since paid for the VHS tape to be professionally transferred to DVD format so that I can review it any time I would like.  I have since taken the DVD video and converted it to WMV format. Below is the video:

This Cobra is number 934 of 1003 when it comes to the number of Cobra Convertibles ans #435/499 of the Hardtop Convertibles.  This card listed for $30,685 in 1995 – now, that might not seem like too much today, but remember that the average price of a NEW car was $15,000 and the average income in the USA was $35,000/yr !  This Cobra was definitely in the high-end of pricing for cars that year!  The hard-top option added $1825 to the price of the base Cobra Convertible – and rumor has it that each roof was hand-fitted to each car.  The factory have a very difficult time with these tops as they did not fit perfectly right off the line.

I have had this car a little over a year now (purchased in the fall of 2009) and have really enjoyed it.  I think that I will keep it for a few more years until it is time for another toy.  One thing I have vowed to do is keep this car stock and original.  That has been a very difficult task as after-market power adders are so easy to find for this car.  But in the end, I think that it is worth more to the next collector if it is all there.

Below are some pics of the car and various accessories:

Front View - 95 Cobra had the Running Pony emblem

Driver's side

With the hardtop on

Soft top on

Roof off

Roof

Interior

The ole 5.0

SVT Certificate

Brochure and VHS

Stand for the Hardtop

Winter rest...

Just some of the Mustang posters in the garage

Just some of the Mustang posters in the garage cont

Just about all the SN97 rear emblems

Original Sticker

Gestalt IT’s first datacenter-focused Field Day event

In Uncategorized on January 14, 2011 at 16:09

Well I got the official notice today that I will be attending a Gestalt IT Tech Field Day event on February 10th and 11th in 2011 in San Jose, CA.  I feel honored as well as humbled to be invited to this event.  It is a great chance to meet new people, learn from their experiences, listen to their war stories, as well as the chance to see what the vendors have to say.

What is Tech Field Day, you ask?  Well – to explain it best I am going to quote it from Gestalt’s website:

This unique event brings together innovative IT product vendors and independent thought leaders who have immense influence on the ways that products and companies are perceived and understood by the general public. The world of media has changed, with social media and blogging gaining special importance. Our Field Day is an opportunity for tech companies and independent writers to get to know each other. Ultimately, we hope to provide a forum for engagement, education, hands-on experience, and feedback. This event is run as a community service rather than a profit-motivated media business. In this way, costs are kept to a reasonable minimum, involvement is encouraged, and fun is part of everything we do.

Gestalt IT’s Tech Field Day #5 is their first data center focused event this year and will be held in Silicon Valley.  ( Ahh, a warmer climate for a few days – especially when you compare it to the North East right now.  ).  I am very excited to see the line-up for this even, companies like Symantec, DataRobotics (cool – Drobo!), NetEx, and Inflblox are just some of the companies I will get to listen to and learn from as well as have the opportunity to ask questions.

You can learn more about the event at the following link:  Gestalt IT Tech Field Day #5 or for more general information: Gestalt IT Tech Field Day

 

New Cisco Compact Switches!

In Uncategorized on January 11, 2011 at 19:48

Well, just the other day Cisco announced some new Compact switches that should replace the Cisco 2940(yeah, I know that they were EOL and replaced with 2960-8)  and 3560-8 series switches.  The product information can be found here – Link.  The new switches are the Cisco 3560-C and 2960-C series.

These really have my attention from an Enterprise perspective.  I cannot tell you how many conference rooms we have that have either the 2940 or the 3560-8 switches mounted under the table.  Those switches work great, except for the fact that we need to also run a power-cord to them.  I cannot tell you how many times our NOC has contacted us with regards to a switch being reset due to power-on and it turning out someone kicked the power cord.  We run the Cisco 3560-8 at places where we need PoE ports  for phones and such, and the 2940/2960 series are used where no PoE is required.

So what is so intriguing to me about the new 2960-C switches? Well, the biggest thing that I noticed is that you can now get switches that will be powered via PoE and  PoE+ ports instead of an external power cord. This is feature is called PD PSE -Powered Devices (PD) and Power Sourcing Equipment (PSE) and is in available it WS-C2960CPD series of switches.  The way that it works is that you connect the dedicated copper uplinks on the 2960CPD switch to a PoE or PoE+ capable switch, the switch then senses the device requesting the power and provides the power necessary to the device.  This is the 802.3af (PoE) and 802.3at (PoE+) standards and works just like an IP phone does connected to a switch. One thing to note on the PS/PSE 2960C is that you can also get an external power supply to power the device.  This is a nice feature if you do not have PoE capable devices today but plan to deploy them at a later date. Below is an image taken from Cisco’s website that shows the PD/PSE switches on the left and the non PD/PSE switches below

PD/PSE Capable 2960-C Switches

3560-C and 2960-C Switches non PD/PSE

What I can gather from the information that is currently available, but still cannot confirm, is that if you are using PoE+, the switch supports PoE pass-through so that you can also power a downstream IP Phone, Camera, etc via the compact switch.  This is a really good feature for conference rooms, kiosks, as well as areas where you do not want to run power cables.  This can help to insure that all your critical network devices are connected to protected (UPS/Generator) power sources in the event of a utility outage.  Most conference rooms that I have see are not considered critical rooms and are not usually on UPS power.  Most switch rooms and closets, on the other-hand, are almost always on some type of protected power.

Both switches feature the usual stuff expected in a network switch – VLAN, VTP, LACP, QoS, MDIX, UDLD, VTP, RSPAN, and such.  They also have some nice security features as well – Port Security, DHCP snooping, IP Source guard, PVLAN, port-based ACLs, Spanning-tree Root Guard and such.  The PVLAN feature for a conference room is an interesting concept.  Never truly thought about deploying it in a conference room switch, but might have to consider that in the future.  We do have conference rooms where Visitors are allowed to connect to an outside network, and perhaps configuring a switch with PVLANs there would be a nice way to prevent unauthorized snooping, virus passing, and just evil things that I would never do.

So, what are some of the differences between the 2960-C and 3560-C that are worth noting (or at least I noticed more then the others)?  Well, with the Cisco 3560-C you can get a L3 capable switch – just like it’s big brothers.  Having some of these features available is interesting, not sure if it is overly practical to be honest – but is a good feature to have if you are putting the switch in a lab network.    The Cisco 3560-C is also only powered via an external power supply and does not currently support PD/PSE.    One thing I did notice is that the GLC-T is NOT supported in these switches, you will probably need to buy the SFP-GE-T one.  The price difference is that the SFP-GE-T is about $50 more list (about 450 list for the SFP-GE-T and the GLC-T lists at about 400).

Another note on the L3 for the Cisco 3560-C, it is controlled by a license file on the switch itself.  There is no hardware difference between L2 and the L3 models, only a silly license file.  If you buy the 3560-C , you can transparently upgrade the software feature set through Cisco IOS® Software activation.   This is a nice way to do the upgrade – no IOS to upload just a simple activation routine.  I think they went this way because of the old 3500 switches that you buy with SMI code but can install EMI code and make it a full L3 switch.  This is good business sense, yet I think that it may make things a bit over-complicated at time.

Another nice feature on these is the support of a USB A type port.  This can make life much easier when it comes to either backing up configs, replacing a bad switch, or just IOS upgrades.  I have used the USB drives on ASR, Nexus 7000, 2800/3800, etc to upgrade code, backup configs before replacements, or even to quickly recover a device.    I have also been known to use the USB drive to load an image for another device at the site and configure the router as a TFTP server to serve the file out. (hmm, idea for future blog post :) )

One thing to note on the support and warranty on these is that they come with a limited lifetime warranty, 8x5xNBD replacement and 90 days of TAC out of the box.  By limited, means non-transferrable and only application to the original purchaser.

You can always find more information at Cisco’s website on these devices – here

http://www.cisco.com/en/US/products/ps11527/Products_Sub_Category_Home.html?CAMPAIGN=Sake+Switching+Launch&COUNTRY_SITE=us&POSITION=featuredproduct&REFERRING_SITE=Cisco.com+Index&CREATIVE=Compact+Switches&TIS=0113__0220_0250_0230_0240__

Sorry…

In Uncategorized on December 29, 2010 at 22:07

With the holidays and such, and now that I am sick – I have ignored this blog for a little bit. I promise I will get something good up soon. Need to focus on those VRF labs and get them published soon.

I promise…

March 11, 2011 – Tick-tock goes the clock

In Uncategorized on December 7, 2010 at 16:45

The clock is ticking and time is running out. Just submitted my CC to Cisco for the CCIE SP Lab payment. Guess it only a few months until I see San Jose, CA and the Cisco campus. Tick-tock.

Cisco ASR and LACP

In Uncategorized on December 2, 2010 at 11:50

I am currently working on a new site deployment utilizing some Cisco ASR1002 routers.  When we typically design a location we cross-connect the two WAN routers via a cross-over cable; this allows us to have the capability to continue to transit traffic over the connected WAN routers and WAN links if need to take down the Core at the site for maintenance.

If you look at the image below you will see three Sites – A – B – C.  Traffic that is destined to Site B from Site A will transit the connected WAN link.  So what happens if that WAN link goes down, it will transit through Site C instead.  By having the WAN routers connected via a cross-over cable, the traffic will stay at the end and not transverse the internal LAN of the site.

Ok, the background information is now out of the way. Lets continue.

Typically we use a single gigabit ethernet cross-over cable between the routers, due to hardware limitations. Well, with the ASR series we now have more interfaces that we can use for this connectivity.  What I have also found is that the ASR and IOS-XE support LACP and etherchannels.  This is a wonderful thing as it actually solves some of the problems of a single cross-over cable between routers.

So, how does one configure LACP on the ASR 1002?  It is done the same way as you would on the Nexus for L3 etherchannel. Below are the configuration commands as well as the ways to check.

For this example, we are going to create Port-Channel 12 on the router and assign interfaces G0/0/2 and G0/0/3 to the channel-group

Router#conf t
Router(config)#interface GigabitEthernet0/0/2
Router(config-if)# channel-group 12 mode active
Router(config-if)# no shut
Router(config-if)# exit
Router(config)#interface GigabitEthernet0/0/3
Router(config-if)# channel-group 12 mode active
Router(config-if)# no shut
Router(config-if)# exit

Now we can configure an IP address on the port-channel interface:
Router(config)#interface Port-channel12
Router(config-if)# ip address 10.1.1.1 255.255.255.252

T0 check the port-channel:

Router#sh int port-channel 12
Port-channel12 is up, line protocol is up
Hardware is GEChannel, address is c471.fe0c.55cb (bia c471.fe0c.55cb)
Internet address is 10.98.255.9/30
MTU 1500 bytes, BW 2000000 Kbit/sec, DLY 10 usec,

You can also look at the LACP information:

Router#sh lacp 12 neighbor
Flags:  S – Device is requesting Slow LACPDUs
F – Device is requesting Fast LACPDUs
A – Device is in Active mode       P – Device is in Passive mode

Channel group 12 neighbors

Partner’s information:

Partner Partner   LACP Partner  Partner   Partner  Partner     Partner
Port      Flags   State     Port Priority Admin Key Oper Key Port Number Port State
Gi0/0/2   SA      bndl      32768         0×0       0xC      0×3         0x3D
Gi0/0/3   SA      bndl      32768         0×0       0xC      0×4         0x3D
Router#

Now lets ping to test:

Router#p 10.1.1.2 t 1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1, timeout is 1 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Router#

If you noticed I typed t 1 – that means use a 1 second timeout.  I did that in case, for some reason, it does not PING successfully I only have to wait half the normal time of 2 seconds per ping.  This might not seem like a big deal, but if you use this on some LAB test – you can save some time and frustration. :)

Clearing hung TCP session on a Cisco router

In Uncategorized on November 19, 2010 at 08:34

While going through some of my old notes I came across some notes from a few years ago on hung TCP sessions on some of our routers. These hung sessions where due to the latency differences on a Multi-link T1 connection that was in place.  Below are the notes (generalized IP and Names) on how to detect and reset these connections.It is my hope for you to never have to use these commands, but since there is little out there on them I figured I would share.

1) We saw this error (connection queue limit reached) on the terminating gateway (10.10.3.5) during an incoming call attempt:

R1#
R1#debug ip tcp trans
TCP special event debugging is on
R1#term mon
R1#
Mar  6 04:49:55 PHL: TCP0: bad seg from 10.11.3.20 — connection queue limit reached: seq 3379916701 ack 0 rcvnxt 0 rcvwnd 4128 len 0
Mar  6 04:49:57 PHL: TCP0: bad seg from 10.11.3.20 — connection queue limit reached: seq 3379916701 ack 0 rcvnxt 0 rcvwnd 4128 len 0
Mar  6 04:50:01 PHL: TCP0: bad seg from 10.11.3.20 — connection queue limit reached: seq 3379916701 ack 0 rcvnxt 0 rcvwnd 4128 len 0
Mar  6 04:50:09 PHL: TCP0: bad seg from 10.11.3.20 — connection queue limit reached: seq 3379916701 ack 0 rcvnxt 0 rcvwnd 4128 len 0

R1#

2) Take a look at: 

R1#sh tcp brief
TCB       Local Address   Foreign Address        (state)
6353F5E8 10.10.3.5.1720   10.11.3.24.12871      SYNRCVD
63555A14 10.10.3.5.1720   10.11.3.23.12814      SYNRCVD
6353AEFC 10.10.3.5.1720   10.11.3.24.12872      SYNRCVD
6350B2DC 10.10.3.5.1720   10.11.3.24.12875      SYNRCVD
63488D44  10.10.3.5.23    10.11.3.23.11265      ESTAB
63571718 10.10.3.5.1720   10.11.3.24.12914      SYNRCVD
All of the TCB's associated with TCP port 1720 are 'hung' (SYNRCVD).
The associated TCP Control Block (TCB) are highlighted in a PINKISH colour.

3) To clear them, clear the associated TCB:

R1#clear tcp tcb 6353F5E8
[confirm]y
[OK]

R1#
R1#clear tcp tcb 63555A14
[confirm]y
[OK]

R1#
R1#clear tcp tcb 6353AEFC
[confirm]y
[OK]

R1#
R1#clear tcp tcb 6350B2DC
[confirm]y
[OK]

R1#
R1#clear tcp tcb 63571718
[confirm]y
[OK]

R1#

And the router started processing calls again.

R1#

Type 7 password decryption via IOS router (? bonus)

In Uncategorized on November 18, 2010 at 08:28

I have seen a few posts out there about this as well as links to sites that will decrypt a Cisco type 7 password.  Since I am trying to share what I know I figured I might as well throw my hat into the ring and include this information here.

If you have a type 7 enable password such as : enable password 7 00331A0A087D071F012F7F5B1B0F0C011754 and want to decrpyt it, all you need is another router that you can get to enable (priv 15) access on and configuration mode.

Enter configuration mode and create a key-chain. For the key-string, tell it type 7 and cut-and-past the encrypted key

Rack1R6(config)#key chain DecrpytThis
Rack1R6(config-keychain)#key 1
Rack1R6(config-keychain-key)#key-string 7 00331A0A087D071F012F7F5B1B0F0C011754

Then all you have to do from a command prompt is issue show key chain

Rack1R6#sh key chain
Key-chain DecrpytThis:
key 1 — text “WillFlynnSurvive?
accept lifetime (always valid) – (always valid) [valid now]
send lifetime (always valid) – (always valid) [valid now]
Rack1R6#

As you can see here, the password is WillFlynnSurvive?

This works for any Type 7 password, including users.  Below I have done a show run | inc user and they added Key 2 with he user type 7 password.

Rack1R6#sh run | inc user
username Flynn privilege 15 password 7 0478071303245F5D
Rack1R6#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Rack1R6(config)#key chain DecryptThis
Rack1R6(config-keychain)#key 2
Rack1R6(config-keychain-key)#key-string 7 0478071303245F5D
Rack1R6(config-keychain-key)#^Z
Rack1R6#sh key chain
Key-chain DecrpytThis:
key 1 — text “WillFlynnSurvive?”
accept lifetime (always valid) – (always valid) [valid now]
send lifetime (always valid) – (always valid) [valid now]
Key-chain DecryptThis:
key 2 — text “Cluless
accept lifetime (always valid) – (always valid) [valid now]
send lifetime (always valid) – (always valid) [valid now]
Rack1R6#

As you can see, the password for Key 2 ( the user one we just added ) is Cluless

 

Now, I am not sure if you noticed but for the first example the password is WillFlynnSurvive? – yes, that is a question mark in the password.  If you want to use a question mark as part of your password, you need to enter ctrl-v prior to typing the question mark in the password or the IOS will think you are looking for help. Old dirty CCIE lab prep tricks there.

 

 

Cisco Embedded Event Manager and its usefullness for TAC

In Uncategorized on November 16, 2010 at 12:49

A few years ago I had a TAC case open with Cisco.  The case was centered around an unusually high CPU condition on a Cisco 3800ISR series router.  This router was only routing traffic between the Ethernet interfaces, doing some SNAT (stateful NAT), and basic BGP routing – so the CPU should not have been in the 90%+ range.  Well, TAC wanted me to run some commands every 60 minutes 24×7 for a few days to see what was going on.  Now we all now that that is not an easy thing to do, so what I decided to do was grab an existing EEM script from Cisco’s website and modify it to provide all the information that the TAC engineer wanted.

Needless to say, the case was solved about 2 days later when we upgraded the code per their suggestion because of the identification of the bug. :)   I am guessing that having a router send you the logs and command output every hour either provided them the information they needed, or more likely, the engineer realized that  – well, you know.

So, for this post I have decided to post the EEM configuration as well as the EEM script in case you ever need to do something similar.  If I can save you some time, I am all for that.  I still use this script today – albeit in a different manner.  I now use it to get “Daily Health Checks” from the routers in the field.  Every day at noon they send me standard output commands so that we can check on them without having to log into each and every one of them.

So, without further typing – here is the script broken down: (to download this script, you can click here – HealthCheck_BLOG.tcl

Router Configuration:

First thing we will need to do is configure the Event Manager variables on the router:
The variables that we will use are:

  • Mail Server (SMTP) – 10.11.11.254
  • Receipt E-Mail address – Flynn@Domain.Com
  • From E-Mail address – CluRouter@Domain.Com
  • TCL file location – flash:/
  • User who runs the eem – eem_user

First we configure the EEM Environment using the event manager commands
Router(config)#event manager environment _email_server 10.11.11.254
Router(config)#event manager environment _email_to Flynn@Domain.Com
Router(config)#event manager environment _email_from CluRouter@Domain.Com
Router(config)#event manager directory user policy “flash:/”
Router(config)#event manager session cli username “eem_user”
!
Next we define the scheduling of this command (here at 16:00 every day)
Router(config)#kron occurrence Daily at 16:00 recurring
Router(config)#policy-list HealthCheck_BLOG
!

Now we can device that happens when this KRON job is run.
Router(config)#kron policy-list HealthCheck_BLOG
Router(config)#cli event manager run HealthCheck_BLOG.tcl
!

Lastly we can define the policy
Router(config)#event manager policy HealthCheck_BLOG.tcl
!

———————————————————————-
EEM Script section
———————————————————————-

This .tcl (originally was sendmail.tcl) file was taken from Cisco’s website and then modified.  I will explain only what I have modified in order to accomplish the task of sending logs.

The sections that I have modified are:
#———————– “show commands” —————-
#———————– send mail ———————-

Under the Show Commands section:
To display the clock and store the results in $result:

if [catch {cli_exec $cli(fd) "show clock"} result] {
error $result $errorInfo
}
set show_clock $result

To display the show ip interfaces and store the results in show_ip_interfaces

if [catch {cli_exec $cli(fd) "show ip interfaces"} result] {
error $result $errorInfo
}
set show_ip_interfaces $result

To show the command show align and store the results in the show_align variable
if [catch {cli_exec $cli(fd) "show align"} result] {
error $result $errorInfo
}
set show_align $result

To execute the command show buffers gig 0/0 dump and store in show_buffers_gig_0_0
if [catch {cli_exec $cli(fd) "show buffers gig 0/0 dump"} result] {
error $result $errorInfo
}
set show_buffers_gig_0_0 $result

Now to send the mail most of the variables where defined in the EEM environment originally, all that I had to do was the subject and body

#———————– send mail ———————-
#
# create mail form
action_syslog msg “Creating mail header…”
set body [format "Mailservername: %s" "$_email_server"]
set body [format "%snFrom: %s" "$body" "$_email_from"]
set body [format "%snTo: %s" "$body" "$_email_to"]
set _email_cc “”
set body [format "%snCc: %s" "$body" ""]

#setting the subject
set body [format "%snSubject: %sn" "$body" "SR TAC CASE NUMBER - $routername..."]

#outputting the command output into the e-mail body
set body [format "%sn%s" "$body" "The body of your msg goes here..."]
set body [format "%sn%s" "$body" "Report Summary:"]
set body [format "%sn%s" "$body" "   - Show Clock"]
set body [format "%sn%s" "$body" "   - Show ip interfaces"]
set body [format "%sn%s" "$body" "   - Show align"]
set body [format "%sn%s" "$body" "   - Show buffers gig 0/0 dump"]
set body [format "%snn%s" "$body" "---------- Show Clock----------"]
set body [format "%snn%s" "$body" "$show_clock"]
set body [format "%snn%s" "$body" "---------- Show IP Interfaces ----------"]
set body [format "%snn%s" "$body" "$show_ip_interfaces "]
set body [format "%snn%s" "$body" "---------- Show Align ----------"]
set body [format "%snn%s" "$body" "$show_align"]
set body [format "%snn%s" "$body" "---------- Show buffers gig 0/0 dump ----------"]
set body [format "%snn%s" "$body" "$show_buffers_gig_0_0"]

Below is a pure dump of the script if you want to look at it in its raw format

###############################################################################################################
#
#     Daily Health Check TCL Script taken from Cisco.Com web site
#
#    Update by Jeff Fry – 9/23/2008
#
###############################################################################################################

# Useful event registration tcl command extensions
# None
::cisco::eem::event_register_none queue_priority low nice 1 maxrun 600
# Watchdog Timer
#::cisco::eem::event_register_timer watchdog name errimt time $errim_period queue_priority low nice 1
# Syslog
#::cisco::eem::event_register_syslog occurs 1  pattern .*STANDBY.*STATECHANGE.* maxrun 90 queue_priority low nice 1
# Object Tracking
#::cisco::eem::event_register_track 1 state up queue_priority low nice 1
# Interface
#::cisco::eem::event_register_interface name $intf parameter txload entry_op ge entry_val 192 entry_val_is_increment FALSE queue_priority low nice 1
# Cron Job
#::cisco::eem::event_register_timer cron name test cron_entry “0 * * * *” queue_priority low nice 1 maxrun 20

#
# Namespace imports
#
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

#— Check required environment variable(s) has been defined

if {![info exists _email_server]} {
set result “EEM Policy Error: variable $_email_server has not been set”
error $result $errorInfo
}

if {![info exists _email_to]} {
set result “EEM Policy Error: variable $_email_to has not been set”
error $result $errorInfo
}

if {![info exists _email_from]} {
set result “EEM Policy Error: variable $_email_from has not been set”
error $result $errorInfo
}

#——————  hostname        ——————-
set routername [info hostname]

#
#——————-   ” cli open”   ——————-
#
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli $result
}

#————— end of  “cli open”   ——————-

#
#———————– “show commands” —————-
#
if [catch {cli_exec $cli(fd) "enable"} result] {
error $result $errorInfo
}

if [catch {cli_exec $cli(fd) "show clock"} result] {
error $result $errorInfo
}
set show_clock $result

if [catch {cli_exec $cli(fd) "show ip interfaces"} result] {
error $result $errorInfo
}
set show_ip_interfaces $result

if [catch {cli_exec $cli(fd) "show align"} result] {
error $result $errorInfo
}
set show_align $result

if [catch {cli_exec $cli(fd) "show buffers gig 0/0 dump"} result] {
error $result $errorInfo
}
set show_buffers_gig_0_0 $result

#———————- end of show commands ————

#
#———————– “enable” ———————-
#
if [catch {cli_exec $cli(fd) "enable"} result] {
error $result $errorInfo
}

#
#———————– send mail ———————-
#
# create mail form
action_syslog msg “Creating mail header…”
set body [format "Mailservername: %s" "$_email_server"]
set body [format "%snFrom: %s" "$body" "$_email_from"]
set body [format "%snTo: %s" "$body" "$_email_to"]
set _email_cc “”
set body [format "%snCc: %s" "$body" ""]
set body [format "%snSubject: %sn" "$body" "SR TAC CASE NUMBER - $routername..."]

set body [format "%sn%s" "$body" "The body of your msg goes here..."]
set body [format "%sn%s" "$body" "Report Summary:"]
set body [format "%sn%s" "$body" "   - Show Clock"]
set body [format "%sn%s" "$body" "   - Show ip interfaces"]
set body [format "%sn%s" "$body" "   - Show align"]
set body [format "%sn%s" "$body" "   - Show buffers gig 0/0 dump"]
set body [format "%snn%s" "$body" "---------- Show Clock----------"]
set body [format "%snn%s" "$body" "$show_clock"]
set body [format "%snn%s" "$body" "---------- Show IP Interfaces ----------"]
set body [format "%snn%s" "$body" "$show_ip_interfaces "]
set body [format "%snn%s" "$body" "---------- Show Align ----------"]
set body [format "%snn%s" "$body" "$show_align"]
set body [format "%snn%s" "$body" "---------- Show buffers gig 0/0 dump ----------"]
set body [format "%snn%s" "$body" "$show_buffers_gig_0_0"]

if [catch {smtp_send_email $body} result] {
action_syslog msg “smtp_send_email: $result”
}

action_syslog msg “E-mail sent!”
#—————— end of send mail ——————–

#
#——————— cli close ————————
#
cli_close $cli(fd) $cli(tty_id)

# eeeeeeeeeeeeeeeeeeeeeeeeeeee    End of sendmail.tcl eeeeeeeeeeeeeeeeeeeeee

Cisco IP Router DHCP Server and Client

In Uncategorized on November 15, 2010 at 14:15
Configuring DHCP on routers is not something that is normally
done in a production network.  Typically in a production network
DHCP servers are either Windows, Linux, or some other vendors
implementation.  Occasionally you will need to configure a Cisco
device to provided DHCP for initial purposes - say a new location
build-out, a lab network, or even just perhaps for your home
networking.

For this post, I will show you how to:
 - Configure your route to be a DHCP Server
 - Configure your router to be a client
 - Configure DHCP Reservations for a specific client
 - Release / Renew your DHCP lease
 - Configure DHCP options (150 for example)

Here is the network information we are going to use:

 Network   - 192.168.1.0/24
 Gateway   - 192.168.1.1
 DNS       - 192.168.1.2 and 192.168.1.3
 Domain    - FryGuyLab.Net
 Cisco UCM - 192.168.1.5 and 192.168.1.6
 WINS      - 192.168.1.2
 Node Type - Hybrid


So, first lets setup the DHCP Server router (R2)

Rack1R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Rack1R2(config)#ip dhcp pool DHCP_POOL_1
Rack1R2(dhcp-config)#network 192.168.1.0 /24
Rack1R2(dhcp-config)#default-router 192.168.1.1
Rack1R2(dhcp-config)#dns-server 192.168.1.2 192.168.1.3
Rack1R2(dhcp-config)#domain-name FryGuyBlog.Net
Rack1R2(dhcp-config)#option 150 ip 192.168.1.5 192.168.1.6
Rack1R2(dhcp-config)#netbios-node-type h-node
Rack1R2(dhcp-config)#netbios-name-server 192.168.1.2
Rack1R2(dhcp-config)#exit

Now, don't forget to exclude addresses if necessary. 
Here will exclude 192.168.1.1 - 192.168.1.10

Rack1R2(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.10
Rack1R2(config)#

Now we can go over to R1 and configure DHCP and then enable
the G0/0 interface on the router.

Rack1R1#show run int g0/0
Building configuration...

Current configuration : 103 bytes
!
interface GigabitEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 media-type rj45
end

Now we can configure the interface:

Rack1R1(config)#int g0/0
Rack1R1(config-if)#ip address dhcp
Rack1R1(config-if)#no shut
Rack1R1(config-if)#exit
Rack1R1(config)#exit
Rack1R1#
*Nov 15 18:37:55.302: %SYS-5-CONFIG_I: Configured from console
 by console
*Nov 15 18:37:56.102: %LINK-5-CHANGED: Interface GigabitEthernet0/0,
changed state to reset
Rack1R1#
*Nov 15 18:37:58.866: %LINK-3-UPDOWN: Interface GigabitEthernet0/0,
changed state to up
*Nov 15 18:37:59.866: %LINEPROTO-5-UPDOWN: Line protocol on Interface
GigabitEthernet0/0, changed state to up
Rack1R1#
*Nov 15 18:38:05.490: %DHCP-6-ADDRESS_ASSIGN: Interface GigabitEthernet0/0
 assigned DHCP address 192.168.1.13, mask 255.255.255.0, hostname Rack1R1

As you can see, we received a DHCP address of 192.168.1.13/24 from the
server. To check the DHCP Lease information on the client, issue the
show dhcp lease command

Rack1R1#show dhcp lease
Temp IP addr: 192.168.1.13  for peer on Interface: GigabitEthernet0/0
Temp  sub net mask: 255.255.255.0
 DHCP Lease server: 192.168.1.1, state: 3 Bound
 DHCP transaction id: 859
 Lease: 86400 secs,  Renewal: 43200 secs,  Rebind: 75600 secs
Temp default-gateway addr: 192.168.1.1
 Next timer fires after: 11:58:27
 Retry count: 0   Client-ID: cisco-001c.f6e6.6a90-Gi0/0
 Client-ID hex dump: 636973636F2D303031632E663665362E
 366139302D4769302F30
 Hostname: Rack1R1

Now to check the connectivity, lets PING the other router:
Rack1R1#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

Rack1R1#

To check the active leases on the server, issue the sh ip dhcp
binding command:
Rack1R2#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
 Hardware address/
 User name
192.168.1.13        0063.6973.636f.2d30.    Nov 16 2010 06:25 PM    Automatic
                    3031.632e.6636.6536.
                    2e36.6139.302d.4769.
                    302f.30
Rack1R2#

Now for reservations. 
We will configure the DHCP server (R2) to assign 192.168.1.254/24
 to R3's F0/0 interface.

On the DHCP Server (R2) - configure a special DHCP pool just
for that client:

Rack1R2#conf t
Rack1R2(config)#ip dhcp pool R3
Rack1R2(config)#host 192.168.1.254 255.255.255.0
Rack1R2(config)#client-identifier 0100.0bfd.5661.e0

To find out the Cleint Identifier to use, on R3 look at the Fa0/0
MAC address and then pre-pend 01 to the mac address. 
(see IETF RFC1700 Hardware table below)

Rack1R3#sh int f0/0
FastEthernet0/0 is up, line protocol is up
 Hardware is AmdFE, address is 000b.fd56.61e0 

On R3, configure the Fa0/0 interface as follows:
Rack1R3(config)#interface FastEthernet0/0
Rack1R3(config)#ip address dhcp client-id FastEthernet0/0
Rack1R3(config)#no shut
Rack1R3(config)#exit
Rack1R3#

You will then see:
*Mar 13 23:29:28.142: %DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0
assigned DHCP address 192.168.1.254, mask 255.255.255.0, hostname Rack1R3

And on R2 you will see under the DHCP binding:
Bindings from all pools not associated with VRF:
IP address          Client-ID/              Lease expiration        Type
 Hardware address/
 User name
192.168.1.13        0063.6973.636f.2d30.    Nov 16 2010 06:25 PM    Automatic
 3031.632e.6636.6536.
 2e36.6139.302d.4769.
 302f.30
192.168.1.254       0100.0bfd.5661.e0       Infinite                Manual
Rack1R2#

IETF Hardware Table from RFC1700
http://www.ietf.org/rfc/rfc1700.txt

Number Hardware Type (hrd)                           References
------ -----------------------------------           ----------
 1 Ethernet (10Mb)                                    [JBP]
 2 Experimental Ethernet (3Mb)                        [JBP]
 3 Amateur Radio AX.25                                [PXK]
 4 Proteon ProNET Token Ring                          [JBP]
 5 Chaos                                              [GXP]
 6 IEEE 802 Networks                                  [JBP]
 7 ARCNET                                             [JBP]
 8 Hyperchannel                                       [JBP]
 9 Lanstar                                             [TU]
 10 Autonet Short Address                             [MXB1]
 11 LocalTalk                                         [JKR1]
 12 LocalNet (IBM PCNet or SYTEK LocalNET)             [JXM]
 13 Ultra link                                        [RXD2]
 14 SMDS                                              [GXC1]
 15 Frame Relay                                        [AGM]
 16 Asynchronous Transmission Mode (ATM)              [JXB2]
 17 HDLC                                               [JBP]
 18 Fibre Channel                            [Yakov Rekhter]
 19 Asynchronous Transmission Mode (ATM)      [Mark Laubach]
 20 Serial Line                                        [JBP]
 21 Asynchronous Transmission Mode (ATM)              [MXB1]

Now, if you need to force release an IP address on a client, you can issue the command:

Rack1R1# release dhcp g0/0

If you need to renew the address, you can use the command

Rack1R1# renew dhcp g0/0