- Install the needed tools:
sudo apt-get install build-essential linux-headers-$(uname -r) make vim
- Install docker
$ curl -sSL https://get.docker.com | sh
- Add your user to docker group
$ sudo usermod -aG docker $(whoami)
- Start a simple udp server on port 5000
DOCKER_LOCAL_IP=172.17.0.2
$ nc -u $DOCKER_LOCAL_IP -l 5000
- Start container
$ docker run --name test --rm -it alpine /bin/sh
- Listen over the UDP port 5000 for new frames (-p since alpine has the linux version of netcat)
$ nc -u -l -p 5000
In order to test, open a pane/terminal with each of the following:
- syslog
$ tail -f /var/log/syslog
- UDP client
$ while true ; do echo "xxxxxx"; sleep 1; done | nc -u 172.17.0.2 5000
- Compile and test module
$ cd 03_log_on_udp/
$ make
$ sudo insmod chksum.ko
$ sudo rmmod chksum
- verify the results in wireshark