Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 1 | |
| 2 | Installing IPFilter into OpenBSD 3.5 Kernel |
| 3 | =========================================== |
| 4 | The installation of IPFilter should be as easy as following the steps |
| 5 | below. In cases where "i386" is mentioned, if you are working on a |
| 6 | different platform, substitute that name there and it should work equally |
| 7 | as well. The patches include enabling IPFilter for IPv4 filtering, IPv6 |
| 8 | filtering and bridge filtering. |
| 9 | |
| 10 | The commands given below are intended as guides rather than exact matches |
| 11 | on what needs to be typed. In many cases, paths to files or directories |
| 12 | may bear little resemblence to what is presented below. |
| 13 | |
| 14 | You may encounter difficulties with step 7 if you have made changes to the |
| 15 | rc files which cause "patch" to not be able to work out how to apply the |
| 16 | changes correctly. |
| 17 | |
| 18 | If the below steps are followed with no problems then it should be safe to |
| 19 | perform step 8 and reboot with the new kernel. Of course if you are not |
| 20 | using GENERIC then substitute GENERIC for your kernel name. If your kernel |
| 21 | config file includes the "GENERIC" one then you will not need to add explicit |
| 22 | options for IPFilter. |
| 23 | |
| 24 | 1. Extract your source tree into /usr/src, creating /usr/src/sys. |
| 25 | |
| 26 | cd /usr/src |
| 27 | gunzip -c sys.tar.gz | tar xpf - |
| 28 | |
Martti Kuparinen | 4a04f46 | 2007-10-25 09:29:36 +0000 | [diff] [blame] | 29 | 2. Unpack IPFilter and apply the patches to the kernel source |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 30 | |
| 31 | cd ~ |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 32 | gunzip -c ip_fil4next.tar.gz | tar xpf - |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 33 | cd /usr/src |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 34 | patch < ~/ip_fil4.1.14/OpenBSD-3/3.5-sys-diffs |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 35 | |
| 36 | 3. Add IPFilter to the source code tree: |
| 37 | |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 38 | cd ~/ip_fil4next |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 39 | BSD/kupgrade |
| 40 | |
| 41 | If you want to build a new release with IPFilter, stop here and goto |
| 42 | the section below titled "Building a Release". |
| 43 | |
| 44 | 4. Build a new OpenBSD kernel |
| 45 | |
| 46 | /bin/rm -rf /sys/arch/i386/compile/GENERIC |
| 47 | cd /sys/arch/i386/conf |
| 48 | config GENERIC |
| 49 | cd ../compile/GENERIC |
| 50 | make depend && make |
| 51 | cp bsd /bsd |
| 52 | |
| 53 | 5. Build and install IPFilter |
| 54 | |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 55 | cd ip_fil4next |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 56 | make openbsd |
| 57 | make install-bsd |
| 58 | OpenBSD-3/makedevs-3.5 |
| 59 | |
| 60 | 6. Patch rc scripts in /etc |
| 61 | |
| 62 | cd /etc |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 63 | patch < ~/ip_fil4.1.14/OpenBSD-3/3.5-rc-diffs |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 64 | |
| 65 | 7. Reboot |
| 66 | |
| 67 | |
| 68 | IPFilter device files |
| 69 | ===================== |
| 70 | Patches to include making IPFilter devices can be found in the file |
| 71 | 3.5-MAKEDEV-diffs. These diffs are generally only of interested if |
| 72 | you are going to be building a distribution for others and want the |
| 73 | correct MAKEDEV scripts to be built. You may also wish to use this |
| 74 | to patch /dev/MAKEDEV on your machine to be correct. Pre-fab'd MAKEDEV |
| 75 | scripts (or individual patches) for each architecture are not provided. |
| 76 | You will need to have extracted "./etc" from src.tar.gz to use these |
| 77 | patches. |
| 78 | |
| 79 | Building a Release |
| 80 | ================== |
| 81 | cd /usr/src |
Darren Reed | 6b03a34 | 2007-08-21 15:22:35 +0000 | [diff] [blame] | 82 | patch < ~/ip_fil4.1.14/OpenBSD-3/3.5-rc-diffs |
| 83 | patch < ~/ip_fil4.1.14/OpenBSD-3/3.5-MAKEDEV-diffs |
| 84 | cd ~/ip_fil4next |
Darren Reed | 83f3fb1 | 2006-06-15 17:43:57 +0000 | [diff] [blame] | 85 | ./OpenBSD-3/fixdist-3.5 |
| 86 | |