Archive

Category Archives for "Life As A Network Engineer – Rakesh"

New hosting Space on AWS

My blog was at https://r2079.wordpress.com and its now moved to https://r2079.com. Why this change?

First and Foremost – Thrill and Challenge

Secondly – Customization and Cost

Don’t get me wrong, I dint migrate because I wanted to get into web development, its not the case and Am not even at intermediate Level there!

Why – This is a custom domain. This is hosted with Route53 Amazon, WordPress is build on AWS custom instance. The Reasons are very simple

  1. I Wanted to include short flash videos in my old blog, word press apparently dint allow it
  2. Secondly, I wanted to take frequent backups – was only possible with a huge yearly cost for customization
  3. Paying for 1 Route53 domain, opened a lot of DNS options, I cancelled my Dynsubscription which was costing 54 Euros per year, while AWS would get most of it witht 12 USD.
  4. Most Importantly, I don’t have to pay anything just to block Ads!

So, This is where it is, I will try to maintain the website now and see how this goes, Till now Infrastructure was maintained and patched by WordPress , from now probably i have to take care of it.

It Continue reading

Wireguard Server and QR Code scan in the mobile app – It’s that simple to set-up a VPN

Fancy a VPN build in under 10 minutes? , there are many vendors outside who offer mobile App and connectivity all through the world, most of the times ofcourse they under perform. Be it for beating Apps which impose Geographical restrictions etc.

What is wireguard ?

https://www.wireguard.com/ – you can read all about it

Why do you need it ?

Simple and easy to build your own VPN service plus Pay as you Go by turning off the cloud instance and Wire-guard has some cutting edge encryption at the software level, which makes it performs better even in cloud instances.

Do i need to Install anything?

All you need is to run a docker image.

https://hub.docker.com/r/linuxserver/wireguard – and you will have all install instructions

Ok i have installed whats Next?

Get your Mobile App, and scan the QR code generated by the system.

Next ?

Nothing, download the app and you are good to by scanning this and you are on your way to your own VPN

How do i verify my traffic stats ?

Log into docker and execute wg, all stats will be readily available

-Rakesh

BPF Compiler Collection – BCC in short

Network Tracing sometimes is really important, although most of the times tcpdump utility is quite handy there are other tools that can make life much easier.

while am no expert in eBPF and scripts, i do know how to use bcc-tools in some scenarios.

https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu—binary

Alright What is the scenario:

Let’s start with something small, you want to measure TCP connection latency.

Other interesting options, you can capture lifetime, stats and most importantly TCP-Retransmissions

Ebpf filters are safer and more powerful to implement, give this a consideration during any Linux troubleshooting scenarios.

-Rakesh

Tizona – Cli for Cloud Music

This is not a Network technology related post

https://tizonia.org/ – Opensource Project

In their own words ‘The most powerful cloud music player for the Linux terminal, with support for Spotify (Premium), Google Play Music (free and paid tiers), SoundCloud, YouTube, TuneIn radios, Plex servers and Chromecast devices.’

What this has to do with this Post:

I have just implemented in an old Raspberry Pi which I was about to throw away. Secondly, it’s a passive project from at least 4 years to play cloud music on Linux CLI.

Why this obsession?

Ever think about music play all day but a very very low volume, am that kind of person. I don’t really listen to it very particularly all the times, but some music lingering in low volumes [Am speaking about extremely low volumes] will always help.

Why not use your LAPTOP ?

The very point of spreading it accross the home and not having to deal with GUI interfaces. Its much better for me not to have control as well, I just skip the tracks and will never be able to listen to new tracks.

Secondly, I dont want to spend a lot of money on crazy hardware with Continue reading

Ostinato – Drone Mode – Traffic Generator

I have started this below article detailing a small subset of what Ostinato is capable of doing, in short, is a traffic generator with great options to modify and dictate the type of traffic that you want to generate and can do it at decent speeds

https://r2079.wordpress.com/2020/02/26/ostinato-packet-generator-test-your-broadcast-and-mitigation-strategies/

What is the Issue: The issue is that Ostinato in default mode is only supported in GUI mode, which is good for many cases but some times especially if you want to send some decent traffic to stress test your MPLS LSP a PC working from home scenario over VPN is not an ideal bet.

Explain more: Well, imagine you have a Cloud provider Instance, most of the instances are CLI based while Ostinato is GUI based.

So How to Proceed: After seeing what Tool is capable of we purchased the full suite which has Python Api support Plugin as well. So it operates something like this

How does it look:

so you have start the drone first, before doing anything else, i was stuck in this phase for more than 2 hours just because i was dumb not to read all the instructions

You can build the packet and save Continue reading

Telnyx api/sms saves my plants! Every single time.

When its a holiday, I do some house-hold farming, mostly into Hydroponics which is based on water and associated nutrients and does not require soil as a medium.

Let me show an example.

As you can see, Plant drinks up water, and the one which you are seeing is lemon plant from its seed stage, Monitoring water level is extremely important and for me there are many more in home so cant be keeping track of everything.

So sensor gets the data, Raspberry Pi talks to AWS IOT securely since Microcontrollers are still a pain to handle SSL and Rpi makes it easy and after processing MQTT message AWS IOT will process based on the Rules, in our case if the treshold is below 500 then plant is drying up.

Why Not Inbuilt SES/SMS with AWS ?

SES works great but I check my emails only once in two days and there is no way to alert based on the email, SMS I wanted to used multiple number pool (thinking to expand) and Cost with Telnyx is Really Amazing to do any Communication services

I have tried other vendors and results are not great either my carrier has some integration problems Continue reading

Ostinato – Packet Generator – Test your broadcast and mitigation strategies

I used ostinato long before when it was in early stages probably, at that point I never had any real need to use a packet generator as the place I was working was already equipped with IXIA and Spirant best in Class Packet generators.

https://ostinato.org/ – is the link

Whats the use case – Well I wanted to test LSP loadbalancing and also specific scenario of BUM traffic and how well it can be contained lets say in Switching level QFX and also VPLS level

Its doing a good job, though it started as open source, author now sells it with some minimal fee to keep up with the development costs.

You could also use scapy and i wrote a small program to do this , problem is scapy sorts of waits for some of the responses and i have not yet figured out what needs to be solved there

Testing Ostinato on QFX and its really good so far. Storm control got in and stopped transmitting any packets through the interface.

At the end, this is a nice to have tool for any sort of packet crafting and limited scale testing for proof of concept scenarios.

-Rakesh

Lora – Test and results – awesome

What is LORA – Best reference – https://www.thethingsnetwork.org

I will anyways attempt to define this as a newbie who just got into this technology

with the help of a specific Receiver and Transmitter and using Radio waves you can send small bits of information to long ranges without the need of repeaters or wireless IP networking gear. “

Why is this useful – I have many use cases simple one being measuring soil moisture for plants and measuring water level in an overhead tank.

I currently have a very expensive setup of a Raspberry Pi zero wireless, a Repeater to repeat my Base Ip Network and a solar panel to power the power-hungry sensor as Raspberry pi does not know how to go into Deepsleep and wakeup.

Lora Makes it simple and even in reasonable living space, wireless routers do not perform well to cover the range up till the back yard garden.

What do you need – Listed in the below article and its nicely written

Most of the Sample Code – https://randomnerdtutorials.com/ttgo-lora32-sx1276-arduino-ide/

I have tested its range till 300m without any issues at all, that’s like 4 times what my wireless router can do!

Continue reading

Dyndns and Openvpn – Remote Management

I have visited my home and was doing some hobby IT setup with Raspberry Pi’s, the problem is that i had problems many times accessing my home PC is another Remote Location due to many reasons, lets say crappy ISP. I contacted my ISP and they said I need to take a static IP and also pay for opening up two non standard ports. Its like you pay to get tortured and then additional headache of Port forwarding.

To add more to the pain, the IP that i get from my upstream provider is a Private IP, wow I havent seen that for a while. Anyways, to get around this I was thinking about using OPENVPN as a solution along with Dyndns.

Now, setup is very simple

Clint-pc (Location 1) ———-AWS(OPENVPN)————Client-pc (Location 2)

Why AWS -> Accessible and Cost

Problem is changing IP, I dont have any business requirement or criticality to buy a Elastic IP , but whole point will be lost if my clients wont know what to access, worse I will never have access to location-2 if am in location-1 to change IP Addresses

I have mapped OPENVPN with dyndns script.

https://help.dyn.com/ddclient/

This really solved Continue reading

Pomodoro Timer with Esp8266 ,micropython and slack – a small weekend project

 

Hi All,

Pomodoro technique is really effective, more than the technique it’s more or less like a good stress buster to me.

https://en.wikipedia.org/wiki/Pomodoro_Technique

There are few problems with the timer management

1.  It’s impractical for me to manually add 25-minute timer every time

2. I can do a small script but again my computer should always be on

3. Use some app or use a timer with sound (both of them are really disturbing for myself and also colleagues around me)

What did I use

  1. With anything involving DIY/IoT, there are two important aspects – It should be small and portable and secondly, cost should below.

Components Used :

  1. ESP8266
  2. 0.96Inch 128×64 OLED display (Pictures below)
  3. Micropython ( I could have gone with C++ but honestly I don’t know the language, hence I had to go through a lot of pain to make it work in microphone)
  4. Slack for daytime notifications about timer stages

Challenges :

  1. How do I make sure I don’t look at the clock every 25 minutes? Sound is not an option, so I used a slack webhook to notify me
  2. Code was big and hence there were memory allocation issues in Continue reading

Grafana and Influx – Infrastructure Engineers Language

If you want to understand what Infra engineer speaks and use a tool provided by them you need to have some exposure to the tool itself, you don’t have to be an expert.

 

Monitoring systems that I see nowadays are mostly centric around Prometheus while the Database used for storing any time-series events is InfluxDB. How do you actually map beautifully, its via Grafana

Grafana – https://grafana.com/

Influxdb – https://www.influxdata.com/

Prometheus – https://prometheus.io/

Now the problem here is that many tools are programmed on a daily basis, from a Network Engineer point of view I understood a few things. 

Not everything you need to know the end to end like an Expert for that tool and some choices is purely based on Cost than anything else. 

How would you really understand this? I set up a BME680 sensor in my home and will precisely use Grafana and Influx to map the recordings

Tools Used 

https://learn.adafruit.com/adafruit-bme680-humidity-temperature-barometic-pressure-voc-gas

Raspberry Pi 3

Docker Images – Grafana and Influx

Sample Influx Script – https://github.com/yukthr/auts/blob/master/random_programs/influx-test.py

And finally Beautiful Grafana

All of this is open source and are not hard after the invent of Docker. Give Continue reading

Alexa , AWS Lambda & AWS IOT MQTT and you can interact with anything

I hear a lot on IOT but don’t have a clue on underlying protocols. My interest is only to understand how it might help a business or more than that my personal interests. So continuing the server power on/off series I wanted to do it with Amazon echo voice command. Now, this is not a smart power switch where you can power-on with a command on Echo but you actually have to send a message to IDRAC, we already covered this in a previous post.

Well, the main goal isn’t to power-on a server that can be done manually as it sits beside me, the main goal is to extend this to any business / personal ideas which might get the benefit.

Summary – Develop a small interactive model to understand Alexa voice service / AWS lambda and MQTT so that we can get a feel of what can be achieved with this.

I will not go much into any tech explanations or bore you with English, I will put here two screenshots and code to git, hopefully, you should be able to give it a try.

 

Its illustrated in 6 steps

  1. Voice command to echo (I have made Continue reading

Python Decorators – From a Network Engineers Perspective

As going through learning some basic programming, I encountered Decorators. I should be very honest if any of you are trying to figure out or learn what decorators in python do from my blog post you are dangerously in trouble.

So what this post about if not learning, well its mostly on what the functionality is so that you can learn the concept from better programming resources.

 

Let’s examine the below code

 

The output will be something like below

 

What’s in this code:

The first thing you have to realize is that some representation with ‘@’ symbol. If you have noticed get_reinfo and get_modelinfo functions, they have one thing in common which is to connect to the device and get output before they parse the required fields, that what a Decorator is helping us to do here, we extend that wrapping functionality around new functions without having to write everything or globalize everything.

At least that is what I understood.  So, next time when you are writing some code try to think if you can incorporate decorators into them.

-Rakesh

 

Emulating Juniper Devices – Various options

Hi,

I have got a lot of requests for writing up a blog post on various Methods of emulating Juniper devices for practice.

Note : For 2/3 methods to work, you need to have official Junos software (vmx-vcp and vmx-vfp)

Method 1 – Gns3

Most popular and Familiar Method – Install via gns3

After installing Gns3, download the

Vmx-vfp Appliance – https://docs.gns3.com/appliances/juniper-vmx-vfp.html

Vmx-vcp Appliance – https://docs.gns3.com/appliances/juniper-vmx-vcp.html

Documentation is straight forward, all you need to do is double click on the appliance and upload the image when requested, as easy as it can get.

 

Method2 – Vagrant

Use Juniper uploaded Images via vagrant.

Most of Juniper Vqfx / JNCIE-DC practice came up from a vagrant, You don’t need to have any official images or access to Juniper software downloads. The downside is that it only supports VQFX and generic SRX, but for most of the Routing protocol and MPLS learning this should be good.

https://app.vagrantup.com/boxes/search?utf8=%E2%9C%93&sort=downloads&provider=&q=juniper

https://app.vagrantup.com/juniper/boxes/vqfx10k-re

https://app.vagrantup.com/juniper/boxes/vqfx10k-pfe

Again, following Github link, will auto setup the topology without you worrying about much details to vagrant.

https://github.com/Juniper/vqfx10k-vagrant -> Go into a specific folder and say vagrant up, that should take Continue reading

Docker and Netdata – Awesome for Monitoring our home servers !

I don’t belong to any DevOps space but I keep hearing things like Docker / kubernetes and what not. I Quickly wanted to see what these are capable of and if I can use them to my advantage so that later I can see the use case for networking.

Docker so far seems to be far more capable and am enjoying it. Thanks to one of my friends who suggested this wonderful Repo, monitoring my server has been more granular.

I will have a detailed post on Juniper MX image via docker but for now, I have used it for something out of networking space to serve a small purpose.

https://github.com/netdata/netdata

This what Netdata UI looks like while monitoring my server, this is really wonderful as for the long time  I was trying to implement many Monitoring systems and most of them required some dedicated hardware or at least a Vmware spin-off instance, which is fine for me I suppose but I wanted something small and yet effective.

Netdata operates on port 19999 of localhost and should be reachable via any web-browser.

I made a small cronjob which starts this instance on every reboot.

Installation is pretty straight forward, Continue reading

My Ignorance for a Year and Dell IDRAC

Hi,

I have a Dell R810 and it makes a lot of noise. So, I have put it somewhere remote in the home where it’s completely inhabitable for human beings. Now, the problem was always to go there and manually power-up the system.  This has been the scenario for years. So, technically if am away from my home I need to take help from my wife. All this is going well and I was always wondered should it not have a better way to do things.

Was talking to my friend and he had some paid solution for the same thing, he doesn’t even remember and that’s for his cisco gear, now for Cisco gear as long you supply power they will be powered (if the Power button is always on), for servers however just like our Personal CPU’s and Laptops you have to manually press the power button.

Then yesterday all of a sudden I took this somewhat seriously and explored options, then I understood it was sitting right inside the server, Dell has something called Integrated DRAC system which helps you do this thing, all you need to have is a proper Lan connection, the message was Continue reading

Multithreading – Whats in it ?

Hi,

I never took threading seriously, partly because I was barely getting started with programming let alone running and improving a Programs performance. I have all the time in the universe to wait for the program to run instead of making it run much faster ?

Problem statement: Has 3 sites to ping, make 3 parallel pings (like opening 3 terminal and issuing a parallel ping statement) instead of one by one approach and has to be done with python

Threading Module comes to Rescue

https://github.com/yukthr/auts/blob/master/random_programs/threading_program.py

 

Basically, in the below output if you see two blocks, one block gets executed sequentially one ping after the other while the other one includes threading and everything is taken parallel and hence we see the output differences as well. I think am yet to figure on calculating time aspect of the threading but it is definitely faster.

Again not going much into GIL or (IO / CPU threading differences), all I can say is we can use this to enhance some day to day activities.

 

 

This may sound a little strange, macosx was not giving me any results for threading while any Linux / Unix (raspberry pi in this Continue reading

Listing TOP 5 Processes – Top command

Continuing some exploration of Pandas, I realized in networking we often has to deal with Toptalkers, I dont have any Networking Realted Top Talker IP Data as such but wanted to see if this can checked on my Laptop’s current Processes comsuming CPU and Top processes which are repeated often.

Without dragging the topic

-> Took the text file it was delimited with space (TOP Command will generally Delimit)

-> Converted to Pandas Read FWF and then converted the file to CSV

-> Used CSV to read into specific %CPU coloumn and implemented SORT function in descending order.

-> Finally Took Counter from Collections Module and implemented it on the list.

output looksl something like this

Pandas are effective and easy, I will continue to explore some functions so as to build some scripts in day to day activities.

 

-Rakesh