/Writing-Netfilter-Modules-Tutorial

This is the code for the tutorial/book named Writing Netfilter Modules

Primary LanguageC

This repository refers to the code described in the book Writing Netfilter Modules
by Jan Engelhardt and Nicolas Bouliane.
It also refers to corrections made to the book.

* IMPORTANT
* The corrections to the book are not finished.
* 
* Sounds obvious, but don't forget to load the ip_tables module before loading
* the xt_ipaddr module.
*
* Copy the shared library (libxt_ipaddr.so) into the iptables shared libraries 
* directory. 
* e.g.
* 	cp libxt_ipaddr.so /var/lib/iptables/
*
* You can test it with:
* 	iptables -m ipaddr -h
* 	iptables -A INPUT -m ipaddr --ipsrc 127.0.0.1;
* You can then ping yourself and verify that it works checking the kernel messages
* (eg using dmesg).
* 
* ------------------------------------------------------------------------
* 				A few notes
* ------------------------------------------------------------------------
* To install the module you can use: 
*       insmod xt_tables.ko 
* 
* To remove the module you can use: 
*       rmmod xt_tables.ko 
* 
* Please note that there shouldn't be any rules in the iptable before 
* attempting to remove the module because, otherwise, the kernel won't 
* allow you to remove it because it will be in use.
*