• Stars
    star
    278
  • Rank 144,120 (Top 3 %)
  • Language
    Dockerfile
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multi-arch multitool for container network troubleshooting.

Praqma/Network-Multitool is now wbitt/Network-Multitool

05 Jan 2022 - Important note about name/org change:

Few years ago, I created this tool with Henrik HΓΈegh, as praqma/network-multitool. Praqma was bought by another company, and now the "Praqma" brand is being dismantled. This means the network-multitool's git and docker repositories must go. Since, I was the one maintaining the docker image for all these years, it was decided by the current representatives of the company to hand it over to me so I can continue maintaining it. So, apart from a small change in the repository name/url, nothing has changed.

The existing/old/previous container image praqma/network-multitool will continue to work and will remain available for "some time" - may be for a couple of months - not sure though.

  • Kamran Azeem

Some important URLs:

Or:

docker pull wbitt/network-multitool

Network-Multitool

A (multi-arch) multitool for container/network testing and troubleshooting. The main docker image is based on Alpine Linux. There is a Fedora variant to be used in environments which require the image to be based only on RedHat Linux, or any of it's derivatives.

The container image contains lots of tools, as well as a nginx web server, which listens on port 80 and 443 by default. The web server helps to run this container-image in a straight-forward way, so you can simply exec into the container and use various tools.

Supported platforms:

  • linux/386
  • linux/amd64
  • linux/arm/v7
  • linux/arm64

Downloadable from Docker Hub:

Variants / image tags:

  • latest, minimal, alpine-minimal ( The main/default 'minimal' image - Alpine based )
  • extra, alpine-extra (Alpine based image - with extra tools )
  • openshift , openshift-minimal (openshift compatible - minimal) - Ports: 1180, 11443
  • openshift-extra (openshift compatible with extra tools) - Ports: 1180, 11443
  • fedora, fedora-minimal ( 'Minimal' Fedora based image )

Important notes about openshift variant:

Openshift is very strict about how a container image should run. So, the openshift variant of the multitool has the following limitations / changes:

  • Runs as non-root ; which means some tools (e.g. traceroute, tcptraceroute, etc, will not work)
  • Listens on ports 1180 and 11443 - not 80 and 443
  • Some executable files are manually set as setuid, so those tools remain usable. Tools set with setuid are:
    • apk
    • arping
    • busybox
    • mii-tool
    • tcpdump
    • tcptraceroute
    • traceroute
    • tshark

Remember, this multitool is purely a troubleshooting tool, and should be used as such. It is not designed to abuse openshift (or any system's) security, nor should it be used to do so.

Tools included in "latest, minimal, alpine-minimal , openshift, openshift-minimal":

  • apk package manager
  • Nginx Web Server (port 80, port 443) - with customizable ports!
  • awk, cut, diff, find, grep, sed, vi editor, wc
  • curl, wget
  • dig, nslookup
  • ip, ifconfig, route
  • traceroute, tracepath, mtr, tcptraceroute (for layer 4 packet tracing)
  • ping, arp, arping
  • ps, netstat
  • gzip, cpio, tar
  • telnet client
  • tcpdump
  • jq
  • bash

Size: 16 MB compressed, 38 MB uncompressed

Tools included in "extra, alpine-extra, openshift-extra":

All tools from "minimal", plus:

  • iperf3
  • ethtool, mii-tool, route
  • nmap
  • ss
  • tshark
  • ssh client, lftp client, rsync, scp
  • netcat (nc), socat
  • ApacheBench (ab)
  • mysql & postgresql client
  • git

Size: 64 MB compressed, 220 MB uncompressed

Tools included in "fedora, fedora-minimal":

  • YUM package manager
  • Nginx Web Server (port 80, port 443) - customizable ports!
  • wget, curl
  • dig, nslookup
  • ip, ifconfig, route, traceroute, tracepath, mtr
  • ping, arp, arping
  • ps, netstat
  • gzip, cpio, tar
  • telnet client
  • awk, cut, diff, find, grep, sed, vi editor, wc
  • jq
  • /bin/sh shell interpreter - not /bin/bash

Size: 72 MB uncompressed

Note: The SSL certificates are generated for "localhost", are self signed, and placed in /certs/ directory. During your testing, ignore the certificate warning/error. While using curl, you can use -k to ignore SSL certificate warnings/errors.


How to use this image?

How to use this image in normal container/pod network ?

Docker:

$ docker run  -d praqma/network-multitool

Then:

$ docker exec -it container-name /bin/bash

Kubernetes:

Create single pod - without a deployment:

$ kubectl run multitool --image=praqma/network-multitool

Create a deployment:

$ kubectl create deployment multitool --image=praqma/network-multitool

Then:

$ kubectl exec -it pod-name /bin/bash

Note: You can pass additional parameter --namespace=<your-desired-namespace> to the above kubectl commands.

Openshift:

$ oc new-project test-project-1

$Β oc new-app praqma/network-multitool:openshift --name multitool-openshift

$Β oc status

$Β oc get pods

$Β oc logs pod-name

$Β oc exec -it pod-name /bin/sh

$Β oc port-forward pod-name  1180:1180 11443:11443

How to use this image on host network ?

Sometimes you want to do testing using the host network. This can be achieved by running the multitool using host networking.

Docker:

$ docker run --network host -d praqma/network-multitool

Note: If port 80 and/or 443 are already busy on the host, then use pass the extra arguments to multitool, so it can listen on a different port, as shown below:

$ docker run --network host -e HTTP_PORT=1180 -e HTTPS_PORT=11443 -d praqma/network-multitool

Kubernetes:

For Kubernetes, there is YAML/manifest file multitool-daemonset.yaml in the kubernetes directory, that will run an instance of the multitool on all hosts in the cluster using host networking.

$ kubectl apply -f kubernetes/multitool-daemonset.yaml

Notes:

  • You can pass additional parameter --namespace=<your-desired-namespace> to the above kubectl command.
  • Due to a possibility of something (some service) already listening on port 80 and 443 on the worker nodes, the daemonset is configured to run multitool on port 1180 and 11443. You can change this in the YAML file if you want.

Configurable HTTP and HTTPS ports:

There are times when one may want to join this (multitool) container to another container's IP namespace for troubleshooting, or on the host network. This is true for both Docker and Kubernetes platforms. During that time if the container in question is a web server (nginx, apache, etc), or a reverse-proxy (traefik, nginx, haproxy, etc), then network-multitool cannot join it in the same IP namespace on Docker, and similarly it cannot join the same pod on Kubernetes. This happens because network multitool also runs a web server on port 80 (and 443), and this results in port conflict on the same IP address. To help in this sort of troubleshooting, there are two environment variables HTTP_PORT and HTTPS_PORT , which you can use to provide the values of your choice instead of 80 and 443. When the container starts, it uses the values provided by you/user to listen for incoming connections. Below is an example:

$ docker run -e HTTP_PORT=1180 -e HTTPS_PORT=11443 \
    -p 1180:1180 -p 11443:11443 -d local/network-multitool
4636efd4660c2436b3089ab1a979e5ce3ae23055f9ca5dc9ffbab508f28dfa2a


$ docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                                             NAMES
4636efd4660c        local/network-multitool   "/docker-entrypoint.…"   4 seconds ago       Up 3 seconds        80/tcp, 0.0.0.0:1180->1180/tcp, 443/tcp, 0.0.0.0:11443->11443/tcp   recursing_nobel
6e8b6ed8bfa6        nginx                     "nginx -g 'daemon of…"   56 minutes ago      Up 56 minutes       80/tcp                                                            nginx


$ curl http://localhost:1180
Praqma Network MultiTool (with NGINX) - 4636efd4660c - 172.17.0.3/16 - HTTP: 1180 , HTTPS: 11443


$ curl -k https://localhost:11443
Praqma Network MultiTool (with NGINX) - 4636efd4660c - 172.17.0.3/16 - HTTP: 1180 , HTTPS: 11443

If these environment variables are absent/not-provided, the container will listen on normal/default ports 80 and 443.


FAQs

Why this multitool runs a web-server?

Well, normally, if a container does not run a daemon/service, then running it (the container) involves using creative ways / hacks to keep it alive. If you don't want to suddenly start browsing the internet for "those creative ways", then it is best to run a small web server in the container - as the default process.

This helps you when you are using Docker. You simply execute:

$ docker run  -d praqma/network-multitool

This also helps when you are using kubernetes. You simply execute:

$ kubectl run multitool --image=praqma/network-multitool

The multitool container starts as web server - so it remains UP. Then, you simply connect to it using:

$ docker exec -it some-silly-container-name /bin/sh 

Or, on Kubernetes:

$ kubectl exec -it multitool-3822887632-pwlr1  -- /bin/sh

This is why it is good to have a web-server in this tool. Hope this answers the question! Besides, I believe that having a web server in a multitool is like having yet another tool! Personally, I think this is cool! Henrik thinks the same!

I can't find a tool I need for my use-case?

We have tried to put in all the most commonly used tools, while keeping it small and practical. We can't have all the tools under the sun, otherwise it will end up as something like this.

However, if you have a special need, for a special tool, for your special use-case, then I would recommend to simply build your own docker image using this one as base image, and expanding it with the tools you need.

Why not use LetsEncrypt for SSL certificates instead of generating your own?

There is absolutely no need to use LetsEncrypt. This is a testing tool, and validity of SSL certificates does not matter.

Why use a daemonset when troubleshooting host networking on Kubernetes?

One could argue that it is possible to simply install the tools on the hosts and get over with it. However, we should keep the infrastructure immutable and not install anything on the hosts. Ideally we should never ssh to our cluster worker nodes. Some of the reasons are:

  • It is generally cumbersome to install the tools since they might be needed on several hosts.
  • New packages may conflict with existing packages, and may break some functionality of the host.
  • Removing the tools and dependencies after use could be difficult, as it may break some functionality of the host.
  • By using a daemonset, it makes it easier to integrate with other resources. e.g. Use volumes for packet capture files, etc.
  • Using the daemonset provides a 'cloud native' approach to provision debugging/testing tools.
  • You can exec into the daemonset, without needing to SSH into the node.

How to contribute to this project?

Contributions are welcome for packages/tools considered "absolutely necessary", of "core" nature, are "minimal" in size, and "have large number of use-cases". Remember, the goal is not to create yet another Linux distribution! :)

More Repositories

1

helmsman

Helm Charts as Code
Go
1,359
star
2

LearnKubernetes

Notes and resources collected together to help learn Kubernetes. This will eventually become a tutorial and later a blog post for praqma website (hopefully!)
Shell
510
star
3

JenkinsAsCodeReference

This repository is intended for the reference Jenkins configuration as code as well as JobDSL library
Groovy
142
star
4

git-metrics

Util script(s) to scrape data from git repositories to help teams improve.
Python
104
star
5

git-merge-driver

Example of how to configure a custom git merge driver
Shell
96
star
6

learn-traefik

This repository contains examples on using traefik reverse proxy.
87
star
7

praqma-jenkins-casc

Repository for our casc demo setup
Dockerfile
70
star
8

kubernetes-ebook

Kubernetes ebook by Kamran Azeem from Praqma
39
star
9

jira

Atlassian Software in Kubernetes (ASK) - Jira. This repository is no longer being maintained. Please see main README file.
Dockerfile
38
star
10

alpine-sshd

No frills, simple alpine based SSHD server
Dockerfile
29
star
11

AndroidAospInDocker

This is repository with a setup helps to build custom Android aosp images inside docker containers.
Shell
28
star
12

gradle-plugin-bootstrap

All you need to create a custom Gradle plugin
Groovy
27
star
13

smallstep-ca-demo

Demo showing how to provide a behind the firewall Certificate Authority for development environments.
Shell
26
star
14

windows-jenkins-slaves-with-packer

Provision and start Windows Jenkins build slaves using Packer and Terraform.
HCL
24
star
15

git-hooks

Ruby
21
star
16

confluence

Atlassian Software in Kubernetes (ASK) - Confluence. This repository is no longer being maintained. Please see main README file.
Dockerfile
20
star
17

Praqmatic-Automated-Changelog

A repository for PAC (Praqmatic Automated Changelog)
Ruby
20
star
18

DAME

DAME is the Dockerized Arcade Machine Emulator, allowing you to play old games on your laptop!
Shell
17
star
19

2git

A Groovy DSL to migrate from ClearCase to Git
Groovy
16
star
20

code-utils

Continuous Delivery utilities - small scripts and concepts used by in continuous delivery setups.
Groovy
15
star
21

bitbucket

Atlassian Software in Kubernetes (ASK) - Bitbucket. This repository is no longer being maintained. Please see main README file.
Dockerfile
14
star
22

memory-map-plugin

A repository for the memory-map-plugin
Java
13
star
23

staci

Containerizing the Atlassian tools stack. Jira, Confluence, Bamboo and a MySQL database.
Shell
12
star
24

ask

Helm and Helmsman charts for ASK. This repository is no longer being maintained. Please see main README file.
Shell
11
star
25

job-dsl-collection

Job DSL collection library
Groovy
9
star
26

artifactory-retention

Clone & Own solution for Artifactory Retention Policies
Groovy
8
star
27

pretested-integration-plugin

A generic pretest commit plugin for Jenkins CI
Java
7
star
28

atlassian-metrics

Groovy
6
star
29

traefik-bitbucker-docker-demo

A demo of a dockerized Bitbucket instance proxied with Traefik and automated SSL cert management.
Shell
6
star
30

deploy2docker

A tool-set to deploy docker-compose apps to a plain docker-compose server
Shell
6
star
31

questionnaire-engine

Containerized web application to create and analyze surveys
JavaScript
6
star
32

reveals

HTML
5
star
33

jobdsl-helpers

Collection of classes to simplify JobDSL snippets
Groovy
4
star
34

GodotDevOps

A summer project exploring contemporary software development and DevOps in a game dev setting
GDScript
4
star
35

jcasc-core

docker images to be used for jcasc powered jenkins
Dockerfile
4
star
36

praqmajutils

Praqma Java Utils
Java
4
star
37

native

Examples of Native Builds
4
star
38

rook-ask-demo

A demo for Code-Conf 2019 showing Rook and ASK
Shell
4
star
39

k8s-cloud-loadbalancer

The Load Balancer is now a separate repository instead of being a sub directory inside praqma/LearnKubernetes
Shell
4
star
40

jcasc-conf

Example wrapper for running Jenkins with prebuilt docker images with JCasC
Shell
3
star
41

sdelements-plugin

Jenkins plugin for SD Elements risk assessment tool by Security Compass
Java
3
star
42

VersionedBinaryArtifacts

A gradle plugin to allow a build be defined in a properties file
Groovy
3
star
43

tracey

Initial repo for the Tracey implementation
Groovy
3
star
44

git-artifact

Shell
3
star
45

vaultReference

This is a reference project on how to easily and fast get Vault up and run in a production ready setup.
Shell
3
star
46

gradle-docker-plugin

Groovy
3
star
47

jenkins4casc

Dockerfile repository for a Jenkins preconfigured with Jenkins Configuration as Code plugin
Dockerfile
3
star
48

AWSProvisionWithAnsible

Configure Docker devicemapper storage for AWS RHEL 7 instance using Ansible
Python
3
star
49

shared-pipeline

Repository with shared global pipeline libs. Usable within sandboxed objects
Groovy
2
star
50

drmemory-plugin

Java
2
star
51

logging-plugin

Java
2
star
52

PrometheusGrafana

This is a repository for the demo at the christmas workshop. People have asked for it as a repository. :)
Shell
2
star
53

packer-made-win-slave

Templates and tools to build Windows-based using packer
PowerShell
2
star
54

CodeCamp

Java
2
star
55

ngingo

A tiny web server that makes a point
Go
2
star
56

helmsman-demo

2
star
57

onboarding-as-code

Automating the onboarding process
Python
2
star
58

commit-message-parser

Collection of parsers to extract issues from commit messages
Java
2
star
59

AbstractVcsApi

Java
2
star
60

OctoCopDD

OctoCop (Traffic) Director for Docker
Shell
2
star
61

native-example-scons

C++
2
star
62

concourse-git-phlow

concourse wrapper for git-phlow
Go
2
star
63

metricviz

Code metrics visualization POC
Java
2
star
64

toggleR

A simple R package to read data from toggl
R
2
star
65

dcn-2018-introduction-to-k8s

Kamran's presentation / workshop on Day Of CloudNative 2018.
Shell
2
star
66

k8s-probes-demo

A small Docker image, and related files to demonstrate how kubernetes probes work
Shell
1
star
67

memory-map-examples

Repository to hold example projects for our memory map plugin
1
star
68

ansible4win-poc

Showcase for Ansible configuration and management of Windows nodes as build and test agents
Ruby
1
star
69

CI-with-HAProxy

Shell
1
star
70

MonKit-Plugin

Java
1
star
71

terraform-google-gke

Terraform modules for creating kubernetes clusters in Google cloud (GKE)
HCL
1
star
72

helm-echoserver

A simple Go echoserver built with Echo framework.
Go
1
star
73

drmemory-api

Java
1
star
74

simple-website

A very simple HTML website which is often needed during git/docker/kubernetes labs/demos
HTML
1
star
75

topdesk-linker

Java
1
star
76

native-example-bazel

C++
1
star
77

makeable-deployment-poc

POC for makeable
Shell
1
star
78

toggl-metric

R library to fetch toggl data and generic methods to handle it.
R
1
star
79

selenoid

This is a simple Selenoid example. Selenoid is basically selenium grid as containers. See https://aerokube.com/selenoid/.
Shell
1
star
80

jekyll

Docker built Jekyll image for building Praqma's website.
Shell
1
star
81

Matrix-Reloaded-Plugin

A Jenkins plugin to rebuild matrix builds
Java
1
star
82

First

Java
1
star
83

luci-gradle

Gradle plugin for Luci
Groovy
1
star
84

docker-gh-pages

Dockerfile for creating a docker container for building jekyll enabled Github pages.
Ruby
1
star
85

rqm-plugin

Java
1
star
86

tracey-rabbitmq-neo4j-bridge

Java
1
star
87

Docker-Birthday-3-Oslo

Repo to contain some helpful stuff related to Docker Birthday event - 2016
HTML
1
star
88

vcs-bridge-plugin

Java
1
star
89

dgoss-docker-image

Shell
1
star
90

MonKit

Java
1
star
91

ccanalyzer

Java
1
star
92

docker-linkchecker

Shell
1
star
93

praqma.github.io

The home of http://code.praqma.com. It's repo that will host documentation for all our development
CSS
1
star
94

file-pattern-scanner

Simple script that scans flat/plain text files for patterns predefined in rules
Groovy
1
star
95

yocto-build-container

Ubuntu-based Docker base image for building Yocto images
Dockerfile
1
star
96

makeable-deployment-poc-code

PHP code for makable repository
PHP
1
star
97

terraform-jenkins-artifactory

A terraform/packer setup to create a simple CI system
HCL
1
star
98

PlusBump

This project was previously known as by its temp name "Wincrementor". Content will be updated soon to match the new name.
Ruby
1
star
99

tracey-protocol-eiffel

Ericsson Eiffel protocol implementation for the Tracey framework
Java
1
star
100

concourse-lab

1
star