Blog Cisco Vim Linux Python Perl Bash Latex Mac Puppet Windows Links

Blog -


My name is Martin, and this is me on the internet. I am currently working with networking at the Managed Service Provider TeleComputing. On my spare time I dabble with networking certifications and other interesting projects. As of now I am a CCNA R & S and CCNA Wireless, while I am working on my CCNA Security and CCNP R & S.

I am also to be found online on various social media networks, like Twitter, Facebook, and LinkedIn. In addition I am a big fan of reddit (although a lurker), and I share my .vimrc (and hopefully more in the future) on my own GitLab install, if you are really nosy.

Pushing IPv6 on your switches


My home network has become more and more IPv6 centric, and I have decided to stop using IPv4 for management on my switches. I currently have one Cisco 2960 Lanbase and one Cisco 3560 IPbase. I experienced som different things when trying to enable IPv6 on these switches.

First, IPv6 is not included in the defaul SDM template. To get IPv6 working the template "dual-ipv4-and-ipv6 default" must be selected through the sdm prefer command. To complete the selection a reload is required.

My provider does not run DHCPv6 so I use autoconfig to get addresses assigned to my interfaces. On my swi01 I enabled unicast-routing with the command ipv6 unicast-routing. This turned out to be a mistake. With IPv4 running it is necessary to define a default gateway with the command ip default-gateway X.X.X.X or defining a static route. When I enabled the unicast-routing I did not have a default gateway for my IPv6 traffic, and the only reason I was able to reach my switch was because I was set on the same subnet. When I looked in the routing table of the switch I did not have a default route. When I added a default route I was able to connect to different subnets.

On my swi02 I forgot to run the ipv6 unicast-routing command and I was surprised I was able to reach my monitoring server anyway. I check the routing table and it seems I already have a ::/0 route. Removing the ipv6 unicast-routing from my swi01 shows the same, it is able to get the ::/0 route from my router.

↑To the top [ 7 265 1488 ] [ Permalink ]

Deploying IPv6 from GET


While I have been working with networking (about a year and a half seriously/professionally), it has all been IPv4. IPv6 has been featured only in the certification studies and even then it has been awfully basic.

I am currently pursuing the CCNA Security and aiming to get certified before the old exam is retired (I bought the book a while ago and I don't want to have to buy another one). Like most of the associate certifications from Cisco they have a chapter on IPv6. It is very similar to IPv6 in the Routing & Switching track, but it seemed to stick better with me this time. I decided to make an effort to setup my home network with IPv6.

My Internet service provider is GET and on their website they state that they support IPv6 with prefix delegation. I used a MicroNugget from CBT Nuggets to setup prefix delegation on my router (a Cisco 881).

This is how I setup the router to get the prefix from Get.

interface FastEthernet 4
ipv6 enable
ipv6 address autoconfig default
ipv6 dhcp client pd FROM-ISP

The prefix received can be seen with the command show ipv6 interface Fa4 or show ipv6 general-prefix. With the show ipv6 interface command the DNS servers provided by the ISP is also seen, as well as various information like the referesh timer enad lifetime of the prefix.

So now I have a /60 from my ISP. What should I do with this? The suggested subnet size for IPv6 networks is /64 for simplicity and feature compliance. If you do not want to do the calculations, a /60 will give 16 /64 networks and plenty of addresses.

To setup the individual vlan to receive one /64 from the /60 network, I did the following on the interface for vlan 1.

int vlan 1
ipv6 enable
ipv6 address FROM-ISP ::1/64

To verify run show ipv6 interface vlan 1 and look after your global unicast address.

Now my clients are receiving/calculating their IPv6 address with base in the /64 I have assigned to the vlan. A show ipv6 neighbors will show the bindings between the IPv6 addresses and the MAC addresses, much like the show ip arp does with IPv4 addresses. If you need to look up the different states check out RFC 4861.

On my windows machine I am checking my ipconfig and I see that I have received/configured an IPv6 address. To properly test the connection I have disabled the IPv4 protocol on the machine. By looking through the ipconfig I can see I am missing DNS servers. I have not received them from my provider. Or, I have not relayed the DNS servers from the provider to my clients.

The clients are automatically configuring the IPv6 address, but only that. They get no information about DNS servers or domain-name. To do this IPv6 has the ability to send out DHCP information about "other configuration". And this has the fitting name "other-config-flag" on Cisco.

First it is necessary to create the DHCP pool.

ipv6 dhcp pool POOL-1
dns-server 2001:4860:4860::8888
dns-server 2001:4860:4860::8844

I am using Google's DNS servers, they have even managed to create an easy-to-remember IPv6 address!

On the vlan interface I need to add the other-config-flag and tell it to serve from the newly created DHCP pool.

int vlan 1
ipv6 nd other-config-flag
ipv6 dhcp server POOL-1

That should be it! Native IPv6 should now be flowing through your pipes! But remember, all the clients are now reachable on the Internet. There is no hiding behind the dynamic PAT anymore.

And if you want to roam the Internet without hanging on to that old and smelly IPv4 address... be prepared to be disappointed! It is almost impossible to keep up your normal browsing habits only with IPv6 addresses, so many websites have yet to implement this.

↑To the top [ 55 651 4091 ] [ Permalink ]

Starting a Windows life


I got started out on Windows. I think most of us did, really. But in the mid-2000's I got changed over to the Apple side of things and it has been like that ever since. For my studies it has been mainly running Linux servers and only rarely have I had to touch upon a Windows machine.

I have decided to change that.

Today I installed Windows Server 2012 on Virtualbox. I am intending to follow the Training guide for administering Windows Server 2012 to learn myself Windows administration. I have gone through the really basic stuff tonight. Setting up a Domain Controller, adding some users, adding a machine to the domain. It has all gone pretty smooth. The only hiccup I had was when I allocated 2048 MB memory to each of my servers and ran them at the same time on my MBA with only 4096 MB of memory.

I may have to invest in a home lab environment where I can play with Hyper-V and use more than two machines at the same time. Hopefully I will be able to update this site with some more information throughout this Windows phase.

↑To the top [ 9 195 1100 ] [ Permalink ]

The B**** manager from hell


Over on reddit user jon6 has been posting stories from one of his previous jobs as internal tech support under the title "The B**** manager from hell". As of this writing he is on part 19, and I recommend you to read all of them. Very well-written and interesting, as well as painful reading.

From part one:

We all knew it was to be a new world order with Angie's arrival; we would have thought her showing up a day early was to meet and greet the troops... it was very apparent to me that she was just a vicious troll marking her territory, showing everyone who was boss!

↑To the top [ 9 115 807 ] [ Permalink ]

Avatar - The Last Airbender


The last couple of months my girlfriend and I have been watching the Nickelodeon series The Last Airbender (TLA), and we have been thoroughly impressed by this cartoon.

I first met with TLA in 2008/2009, then on the european Nickelodeon channel. I had heard good things about the series, and decided to record the episodes. Unfortunately the episodes were not being shown in order and I quickly fell off the story.

In comes Netflix to the rescue! With all the episodes lined up, we started watching it with great anticipation.

The plot

The world is divided into four nations: water, earth, fire, and air. Within these different territories some of the people have special powers. This enables them to interact with 'their' element and use it in different ways.

We meet Sokka and Katara, brother and sister, in the Southern water tribe. They stumble upon a kid floating around in an ice berg with his sky bison. This kid, Aang, is the avatar. The sky bison is Appa.

At the same time a war is ongoing. The fire nation has attacked the other nations and for 100 years they have brought havoc and devestation to the world. 100 years is also the time period for which Aang has been frozen in the ice berg. Coincidence?

Aang is the avatar, meaning he has the ability to master all the four elements. His mission in life is to keep balance in the world, but having been without an avatar for 100 years, there is plenty of work to do.

The series

I was blown away by this series, and I find it very interesting, even for an adult. The characters are great, each having their own background and conflict within. There is lots of jokes, and overall a light-hearted tone to the series, even with the dark setting of the war between nations.

The series is able to teach about important things like forgiveness, perspective, and tolerance without it being pushy. It is all packed into exciting episodes with comedy and action.

One of the best aspects of the series is its continuity. It is rare to find cartoons aiming for the 7+ market bring such continuity as you will find in TLA. Of course you can see standalone episodes without being left as a question mark, but the overall story and background is a major part of the series. Knowing why Prince Zuko has that scar, why Katara has such a connection to her mother, and why Aang is afraid to firebend, is all something that bring the series to the next level.

Throughout the series we meet all kind of different personalities, in different settings. It is always a struggle for the travelling pack of kids, rarely does anything go as planned. This leads to internal bickering and situations, very much like real life.

The series is divided into three seasons, where each season (called a book in the series) focus on one element. The first book is water, second earth, and third fire. Aang is already an airbender so they skipped that one.

It is no wonder why Avatar - The Last Airbender has received so many awards, and it no surprise that they attempted making a movie out of it. Although I have not seen this movie, the ratings and reviews tell me it is not up to the level of the cartoon. Sad, because it deserves so much better.

I watched the series on Netflix (US) where all three seasons are available.

↑To the top [ 32 589 3381 ] [ Permalink ]

Customising your Bash prompt


I feel like this is something I do every leap year, customising my shell prompt. When I think about it, it is really something I should understand and be able to do quite easily, but it is not. It is always a mystery how the different variables appear. Staring at the command line is a daily occurence and it is very strange that we do not customise it more often. If you are working in an office, do you not adjust your chair to be comfortable? Of course you do, and of course you should customise your shell prompt.

And that is what we will do in this post. I will go through the two different options, and in the end we will have a customised prompt. I am using Bash for my shell.


Let us start with the two different options for customising your prompt. The simplest one is using the variable PROMPT_COMMAND. If you do an echo $PROMPT_COMMAND you will see what it currently holds. My guess is nothing. The PROMPT_COMMAND is executed just before Bash displays a prompt. So if you set your PROMPT_COMMAND to pwd like this: export PROMPT_COMMAND=pwd it will always print the working directory before showing you the prompt again.


~ rodvand$
~ rodvand$
~ rodvand$ export PROMPT\_COMMAND=pwd
~ rodvand$ uptime
19:21  up 62 days,  5:16, 3 users, load averages: 0.50 0.55 0.51
~ rodvand$

Now this may not seem very useful, but if you are working on an unknown system with many directories, it could be. And it is very easy to achieve, just a one-liner. If you want to keep this setting for your next session you will need to add it to your .bash_profile. And if you want to remove it from your session just use unset PROMPT_COMMAND. (For April Fool's day you can set COMMAND_PROMPT=cd to give your friend/colleague an hour of tinkering in the morning).


This is also a variable you set, but it is a bit different. It will not be run like the COMMAND_PROMPT but it will be assembled to a prompt. On a newly installed GNU/Linux system you will often find the prompt to look like this: user@hostname$. If you want to achieve it using PS1, this is how: PS1="\u@\h$. \u represents the user name, \h the hostname (short), and the @ is just an @. Using the list over at you can easily assemble a quite complex prompt.

Now, this is not the end of this prompt post. There is more to get out of this. Let us colour it a bit. If you looked at the previously linked list of prompt escape sequences you may have seen the \nnn and the \[ and \]. These allow you to extend your prompt even further.

Slow start, and we will just create a yellow prompt with the prompt user@host:directory$. The prompt is easy enough: [\u@\h:\w]$. To add some colour to this we add the following to the beginning: \[\033[33m\]. Adding this to your previous prompt will give you this PS1: PS1="\[\033[33m\][\u@\h:\w]$". This will give you a nice looking yellow prompt. Oh, what are you saying? Is everything yellow? Yes, because we did not end the colour sequence. It is a bit like html, you need to end the tag. So we add \[\033[0m\] to the PS1, and now it will only be your prompt being yellow. All the commands you type, and their result will be your normal colour. You can mix and match these tags and make your prompt light up like a christmas tree if you like (don't).


These two different ways of customising a prompt can be very useful. They can provide you with valuable information making your daily work more efficient. In certain cases you are logged onto system that have a specific purpose, and customising your prompt to keep you informed about this service/purpose can ease your workload.

↑To the top [ 28 654 3863 ] [ Permalink ]

Richard Stallman in Oslo


Yesterday I attended a talk by Richard Stallman organised by NUUG at the University College of Oslo and Akershus. It was interesting enough, but nothing mindblowing or new from Stallman. The talk was more an introduction to Free Software and what lies within that term (he listed the four freedoms from freedom 0 to freedom 3). He touched the common saying "Free as in free speech, not free beer", did his whole GNU+Linux thing, and bashed Linus Torvalds a bit.

What surprised me the most was the way he held his talk. I have read quite a few email exchanges between rms and rest of the world, and he comes off much nicer in real life. He made jokes throughout the talk, and seemed like he enjoyed himself. I guess that is a necessity when you fight such an uphill struggle as he and his compadres in the Free Software Movement does.

The most entertaining part of his talk came when he dressed into his St. iGNUcius costume and introduced us to the Church of Emacs. It was entertaining, and although I belong to the other religion it was very enjoyable.

In the end he took questions, and now he did fit more into the person I had imagined him to be. He was very quick to answer, and even interrupted people at times. When people asked silly questions, he did not shy away from saying so and repeateadly came into heated discussions with the person asking the question.

It was my first time seeing and listening to Stallman talk, and it did live up to whatever expectations I had. Not that I had very high expectations, he is a bit strange, and his talk did not include any visual aids. It was just him talking for almost two hours, only interrupted by his sip of Pepsi every now and then.

His reason for being in Norway is the GoOpen Arctic Forum held in Tromsø on March 5 where he will do another talk.

↑To the top [ 11 334 1868 ] [ Permalink ]

First post - the setup


This is an attempt at starting a blog - again. As a first post I may introduce this website, and how it has been built. It is very simple.

Over the years I have experimented with many types of blogging software. I have used CuteNews, Wordpress,, tumblr, and numerous other software which have not really done it for me. Why? I do not know. Maybe I am not the blogging type. The reason you are seeing this though is that I needed a less complicated place to put stuff I find online, tricks and tips I find when exploring the CLI, and other stuff in general. I also wanted to find a platform which did not need updating every so often. As you can see on the top and bottom navigation, it currently consists of Vim, Linux, Python, Perl, Bash and Links. Not very fancy, and each of the sections are really short as of now.

As long as these sections make any sense to me, and I get to use them for something, it is worth it for me. I have no ambition of making this great website with thousands of visitors, nor a full resource for people wanting to learn python, perl or linux.

So, how is this built, no one asks? Simple. Dropbox. Static HTML generated from Markdown. That is it. And all.

Using Dropbox for websites

This is properly documented many other places, but using the Public folder in Dropbox for your websites is very simple. Just put your HTML document in the folder and you are almost good to go. To find your link just get on the Dropbox website, select your HTML document and use copy public link to find your Dropbox address. Now, Dropbox does not do like Apache and recognises index files in your directory. This means you will always have to link directly to your HTML files, and not just to the directories.

There is no support for PHP, ASP, and all those server side technologies, so use HTML and client side technology if you need anything special done. As I am just writing this straight to the Dropbox folder the simplicity is a great benefit for me. Another positive is that Dropbox keeps a record of all your versions, so there is no need for additional backups or version control. Additionally, this way of doing it also ensures that I have access to my information at all times. As most of this is just general tips and tricks, stuff I usually forget after doing it, it is a positive that it is accessable those times I am without an internet connection.

As for my design I am using Markdown.css. I am not a very good designer, so using a simple but yet pleasing design is enough.


No system is perfect, mine far from it. My platform will never have dynamic content, and you will not find tags and tags archives from my posts. I have to go in and add each link to blog posts in the top section, the to the top link is not automatic.

The website's address is another thing which I cannot control. My domain name is and I am pointing to this site, but as soon as the site loads you will see my Dropbox URL. It is no big deal for me, I have no qualms revealing that this site is hosted using Dropbox, but it is hard to argue that this URL structure is pretty. Nowadays people prefer a clean looking URL like instead of the old

Nothing is really automatic, and while some struggle with this, I find to be pretty liberating. To generate the HTML I have a bash script run through my .markdown files and generate the corresponding HTML files. It is fun to tinker with, and easy to customise. Moving away from a WYSIWYG editor online feels extremely good, as these editors seem to give me more trouble than help. And it does help that I love using Vim.

↑To the top [ 21 676 3990 ] [ Permalink ]

Blog Cisco Vim Linux Python Perl Bash Latex Mac Puppet Windows Links

444 - Mon Nov 9 00:48:21 CET 2015