nat01.txt Claudio Tantignone 10 Sept 2000 NAT (Network Address Translation) for Minix (32 bit) ===================== Introduction ------------ This is my first implementation of NAT for Minix. You can check that this ONLY works in Minix 2.0.2 32 bits. Before any work, you must compile your kernel with networking to be sure that you have no problems. I can not help you if your default system have problems or if you do not know how to recompile the kernel. It is a simple task, but it is outside the scope of this code. I supplied a lot of configuration information and examples. I tested the example using plip and ppp and it works fine. The other examples are derivations of the original. I do not tested them and are supplied as examples that you need to adapt to your specific configuration. Disclaimer ---------- This software is offered "as is" in the hope that it will be useful. The author is not responsible for any damage to your system, your person, or anything caused by use and misuse of this software. Instalation ----------- NAT is simple. If you have experience configuring routing under TCPIP you will have no problems. If you never configure a small network with routers I suggest you do not try these configurations until you read in depth some documentation. Here are no wizards and it is very easy to be confused. The basic document you need to understand is RFC1631. For the previous reasons the makefile I supplied does not replace any code that left your system down. You must copy by hand the files and recompile the kernel. You first must save the following files, so you can return the system to a known state if you have problems: /usr/src/inet/Makefile /usr/src/inet/inet.c /usr/src/inet/generic/ip_ioctl.c /usr/src/inet/generic/ip_read.c After you renamed or copy to a safe place the files, copy NAT files I supplied like: Makefile.inet --> /usr/src/inet/Makefile inet.c --> /usr/src/inet/inet.c ip_read.c --> /usr/src/inet/generic/ip_read.c ip_ioctl.c --> /usr/src/inet/generic/ip_ioctl.c ip_nat.c --> /usr/src/inet/generic/ip_nat.c ip_nat.h --> /usr/src/inet/generic/ip_nat.h I do not supply an automatic way to replace the files to avoid missing important files. You must be carefull saving your original files. You are the only responsable of your machine. After the copy, recompile all the kernel image, and you need to reboot it before any other configuration. ip_nat.c implement the nat code, you can edit and modify the defaults you have if you need to increment the nat table. The define you need to change is NAT_NR. The makefile compiles the command natcfg and installs it. Also it install the man page. You install the command typing # make install natcfg access the nat code via ioctl's so if natcfg does not work, it is possible that you do not compiled your kernel, or do not reboot with the new image. natcfg -s shows you the disable state if the code is compiled but it is not configured. I suggest first read all the documentation, print the commands man page and draw your configuration. Define the needed routes and define also which interface will be the public for NAT. There are a lot of commands to execute, so create scripts. May be possible that you need to reboot several times, and it is very easy to confuse the order of the commands. Once the confguration works, try to document it for future reference. It is the best way to have NAT working.