Pre-shared key on Cisco ASA55x0

Cisco devices store password crypted when “service password-encryption” is turned on. You should enable this on your network equipment.
You want to give imposters a hard time, so this is behavior you want.

Last week I found out a astonishing thing…

I configured a vpn on a Cisco ASA55x0. And misplaced the password.

I had two options;

  1. give the vpn a new pre-shared key,
  2. start a little search to find a loop hole. I decided the latter.

Show run or show start gives me, albeit in a decent way, the “finger“. The output is pre-shared key *, just an asterik nothing more nothing less. It gave the a gut feeling that pre-shared key a somewhere parsed and replaced by “*”. I know there is another way to read the config file.

more system:running-config

This did the trick. The proper pre-shared key was found after a little tinkering with pipe subcommands.

In hind sight; “show” parses the config file and replaces the password information. Whereas “more” does not parse the config file, it shows the content.

I do not know which software versions are affected. But I do know that you must keep access to the nodes restricted to the people and systems that  must have access. In other words: keep your config files and access to the config files safe.

Posted in security | Comments Off on Pre-shared key on Cisco ASA55x0

Cisco TCL – ping script.

70px-Tcl-powered.svgIn an earlier blog I wrote about a tiny hello world script.  Now I want to raise the bar a little bit, by creating a ping script. After a quick search on the internet I found a several kinds of scripts.  Each having their own maturity an complexity level. A script like this is convenient addition when setting up a lab. In case you need to check connectivity time and time again.

In this script we ping a number predefined host. If three consecutive pings get a reply than pinging this host is successful.

Lets start coding;

Create a script on the flash drive

puts [ open "flash:pingbulk.tcl" w+ ] {

Define the IP addresses we want to ping. Pay attention: this is static list.

 foreach ip {
 } {

Now the three consecutive ping logic will go here…
If a regexp find “!!!” than the ping is successful.

 if { [regexp "(!!!)" [exec "ping $ip timeout 1" ]] } {
 puts "$ip"
 } else { puts "$ip **** failed ***" }

As some habits die hard, we create an alias called pingbulk.
Once the alias is executed we see the following result;

R1#pingbulk **** failed ***

Entirely as expected; ip address is assigned to the loopback0 interface.
Ip address is assigned anywhere nor is the router connected to any network.nowhere to be found.

The complete script looks like;

puts [ open "flash:pingbulk.tcl" w+ ] {
foreach ip {
   } {
   if { [regexp "(!!!)" [exec "ping $ip timeout 1" ]] } {
     puts "$ip"
     } else { puts "$ip **** failed ***" }

Additional notes: Please take note of the accolade placement. TCL interprets on a per rule basis. If you type “puts [open “flash:file.tcl” w+ ]” than only a file is opened and closed with the name nvram:file.tcl. Nothing is read or written to and from this file.

Same applies to other constructs like “foreach” “if/else” etc…. Another nice addition would be to use the “ip host” statements present in the config. Making the scripts more dynamic.



Posted in cisco | Tagged , , , , | Comments Off on Cisco TCL – ping script.

Cisco TCL – first steps… Hello world

70px-Tcl-powered.svgFor some time Cisco offers TCL shell on their equipment. This is awesome, because sometimes you need a single command to retrieve information whereas IOS demands you to enter one or more commands.

But before we get lots in possibilities and impossibilities. Lets create a tiny script to say “Hello world”.   First we will write the script afterwards I explain the tricky parts.

R1(tcl)#puts [ open "flash:hworld.tcl" w+ ] {
+>(tcl)#puts "Hello world..."

First I run trough the commands;

Puts is short for PUT String. Output is ‘echoed’ on screen (stdout) unless defined otherwise. Definition is done in brackets. In the first instance a file is opened to which the output is written.

Open opens a file, w+ describes that a file is opened for write AND if no file of that name is found one must be created.

Script can executed by;

R1#tclsh flash:hworld.tcl
Hello world...


If you want to call TCL script more like a IOS command you can create an alias.

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#alias exec hello tclsh flash:hworld.tcl

An alias name “hello” is created. Once executed you will get the following result.

Hello world...


Okay, writing a tiny tclshell “hello world” script is not rocket-science.
Once you explore more and more you’ll get the hang of it and can do really fun stuff.

Posted in cisco | Tagged , | Comments Off on Cisco TCL – first steps… Hello world

Anki – Spaced Repetition

While studying, I am seeking for ways to study more efficient. In the beginning I stumbled upon a method called ‘spaced repetition’. This method is wildly popular in the U.S. Unfortunately when I attended high school my home country this method was not used. I guess when if I knew about this method earlier in life my career would have looked much different.

Since I am network professional, a computer is never far away. The computer hardware uses Windows, Ubuntu and Android as an OS.  I want the study progress to be available on all hardware. First I used different software, unfortunately the variety of  OS’s proved difficult.

Recently I found a tool automate spaced repetition and which enabled syncing between the computers and tablets. The tool is called Anki. ( ). At this point I have only checked syncing between Ubuntu and Android.

It works like a charm.

Posted in Lifehacking | Comments Off on Anki – Spaced Repetition

First Hop Redundancy Protocol – HSRP

Cisco proprietary HSRP protocol is a protocol for enabling a first hop fault tolerant router. Enabling your default gateway ip address to ‘live’ on more than one router. Back in the old days you had one router to exit a lan.
Once the router died or was out of service due to maintenance hosts in the LAN were not able to communicate out of the lan.

Cisco created a protocol which enabled two (or more) routers to listen to one ip address (layer 3) and one mac-address (layer 2).
Both layer 2 and 3 addresses have used in the redundancy setup otherwise you have to wait for arp entries to time-out.

While configuring you need to set the standby priority. Priority can be set between 0 and 255. Default value is 100.
When the HSRP Active interface has become unavailable, priority is decremented by 10. Choose you HSRP priorities smart.

In the topologies I have seen, the priorities chosen were 100 and 105 or 95 and 100. In all cases that were two router set-ups.
Of course you can be creative and create a three router set-up.

Communication between participating router is done through multicast ip’s HSRP v1 and HSRP v2

Important use “preemt” : to get the router with the highest priority to recover to Active after an outage.

 R1#sh run int e1/1
 interface Ethernet1/1
 description lan-1
 ip address
 ip helper-address
 standby 1 ip
 standby 1 priority 105
 standby 1 preempt
 R2#sh run int e1/1
 interface Ethernet1/1
 description lan-1
 ip address
 ip helper-address
 standby 2 ip
 standby 2 priority 100
 standby 2 preempt

The configuration of the DHCP server is not very complicated.

 ip dhcp excluded-address
 ip dhcp excluded-address
 ip dhcp pool lan-1

Be sure to set the default gateway to the HSRP address, otherwise you have a very neat solution which does not give you the fail save you need.

Posted in CCNP | Comments Off on First Hop Redundancy Protocol – HSRP

Access-list mask or wildcard

G’day all, today I was messing around with access-list.  And after getting my head around the weird subnets of rfc1918. Weird as in an A-class (/8) is reserved in A-space, B-class (/16) in reserved in C-space, and for the B-space has a /12 is reserved. Nothing is standard in the world of standards.

But that on a side-note. The whole rfc1918 got me distracted. So when I started creating the access-list, I mistakenly used the subnet mask instead of the wildcard.

First I made the access-list using subnet masks.

ISP1-R1(config)#ip access-list extended rfc1918-wrong
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#deny ip any any

Next I made the access-list using wild cards.

ISP1-R1(config)#ip access-list ex rfc1918-right
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#permit ip any
ISP1-R1(config-ext-nacl)#deny ip any any

I check the things that I do in a network. I think its a good habit and somebodies health might depend on it.

ISP1-R1#sh access-lists
Extended IP access list rfc1918-wrong
10 permit ip any
20 permit ip any
30 permit ip any
40 deny ip any any
Extended IP access list rfc1918-right
10 permit ip any
20 permit ip any
30 permit ip any
40 deny ip any any

You see that the access-list made using subnet mask are completely borked.

The moral of the story is as follows;

  • always check what you have configured.
  • Use subnet mask to assign ip addresses to interfaces ans wildcards for accesslists.


Posted in CCNP | Tagged , , , , | Comments Off on Access-list mask or wildcard

Juniper filters

In the networking world a multitude of vendors are present. And each of them have their magnificent features  but also their quirks. And one of the quirks, for the network vendors in general, is that terminology is not uniform.

Where Cisco likes to talk about Access-Control List or ACL for short Juniper likes to talk about filters. Juniper filters are awesome. Juniper likes to arrange information a tree-like structure. This enables Juniper for future changes in software approach.

Cisco has standard access-list, the down-side; modification can not be done. Deletion of one ACE is not possible.  The entire ACL has to be removed.

A slight improvement are extended access-lists. Every ACE has a number associated with it. And using some ip access-list resequence magic you can make some room to insert ACE’s.

This hassle is not known to Juniper engineers.

Simply create a access-list ehm …. filter

set firewall family inet filter generic-filter term discard then discard

This filter simply, forwards every packet to the great bit-bucket in the sky.

If you want to allow traffic from you lan towards webservers you add the following;

set firewall family inet filter generic-filter term web_lan from source-address
set firewall family inet filter generic-filter term web_lan from protocol tcp
set firewall family inet filter generic-filter term web_lan from destination-port 80
set firewall family inet filter generic-filter term web_lan then accept

Now you have two terms within the “generic-filter”

show configuration firewall
family inet {
    filter generic-filter {    
        term discard {
            then {
        term web_lan {
            from {
                source-address {
                protocol tcp;
                destination-port 80;
            then accept;

If you leave it this way traffic to the webservers are discarded instead of allowed. This is where Juniper added some pretty awesome magic;just shuffle the term to a place where is fits best.

insert firewall family inet filter generic-filter term web_lan before term discard

Of course you need to address some more issues like established traffic etc.

But this is how Juniper addresses filters. And there are a whole lot more things you can manage with filters. You can create a variables , and when a condition is met the counter is raised by the value you like.  Variable is readable in the context of show firewall.

Today my first steps in Juniper filtering. An awesome experience.

Posted in Juniper | Comments Off on Juniper filters

Be micro-ambitious

I love to read.  And one of my favorite topics is how information is stored in the brain.  How the brain learns.  What interval of learning is most effective an how goal setting works. 

A couple of books clearly state.  Do not set your goal too high.  But better set a lot of smaller goals.  In this way you can tick off many boxes whilst reaching your ultimate goal.  So be micro-ambitious instead of being ambitious.  

Posted in Lifehacking | Tagged , , | Comments Off on Be micro-ambitious

Juniper SRX 110

This week I bought an Juniper SRX 110. This device will help me to get more acquainted with the Junos cli structure.  From a Cisco perspective this box is slightly wider than a Cisco 8xx series router. But maintaining 1U height.

IMG_20170706_010630This box will sit in the utilities closet when I find time to tinker around with this new toy.



Posted in Juniper | Tagged , , | Comments Off on Juniper SRX 110

Policy Based Routing

Policy-Based routing is a neat trick to tweak traffic streams.

For Policy Based Routing to work you will the following;
– Define traffic stream in an access-list.
– Write down a policy.
– Determine the inbound interface.

First use an ACL to define the traffic streams.
You can use standard, extended or named access-list.

In this example traffic sourced from and destined for is defined in ACL 100.

access-list 100 permit ip host host
access-list 100 permit ip host host

Next you will to define the policy.
If you want to want set the next hop for this traffic stream. You have to do;

route-map just-a-name permit 10
 match ip address 100
 set ip default next-hop

Once you have formulated the traffic stream and the tweak all you have to do is apply it to an interface.

interface Ethernet0/0
 ip address
 ip policy route-map just-a-name

Be careful : the name of the route-map is CaSe senSitive.

Why is this a great little trick; you can use policy based routing to prevent asymetric routing in a HSRP setup. Or you can send specific traffic towards an IDS / firewall /deep packet inspection device. Or simply send traffic to an black-hole in case of unwanted/malicious traffic.


Posted in CCNP | Tagged , | Comments Off on Policy Based Routing