Artykuł ten opisuje sposób instalacji kernela 2.4.27, iproute2 + htb i iptables z IMQ, IPP2P, Patch-O-Matic-NG.
Przyda nam sie to w dzieleniu łącza gdzie będziemy mogli ograniczyć upload który bez współpracy imq nie było by możliwe.
Zostanie tu opisany krok po kroku proces instalacji całego oprogramowania wraz z patchami.
Ściagamy to wszystko i kopiujemy do katalogu /usr/src, dla ułatwienia wystarczy utworzyć plik imq_source.sh nadać mu prawa wykonalne 'chmod +x imq_source.sh' i wkleić poniższe linijki i zapisać.
Gry urochomimy ten skrypt wszystkie potrzebne programy i patche zostaną automatycznie pobrane i zapisane w /usr/src.
Dla każdej łaty otrzymujesz taki komunikat (przykład dla łaty CONNMARK):
Welcome to Patch-o-matic (1.17)!
Kernel: 2.4.27, /usr/src/linux
Iptables: 1.2.11, /usr/src/iptables
Each patch is a new feature: many have minimal impact, some do not.
Almost every one has bugs, so don't apply what you don't need!
-------------------------------------------------------
Already applied:
Testing CONNMARK... not applied
The CONNMARK patch:
Author: Henrik Nordstrom
Status: working
This patch adds per connection marks, and a target (CONNMARK)
respective a match (connmark) for using these.
Usage:
connmark
This module matches the netfilter mark field associated
with a connection (which can be set using the CONNMARK
target below).
--mark value[/mask]
Matches packets in connections with the given
unsigned mark value (if a mask is specified, this
is logically ANDed with the mark before the comparison).
CONNMARK
This is used to set the netfilter mark value associated
with the connection
--set-mark mark
Set connection mark
--save-mark
Set connection mark to the same as the one on the
packet
--restore-mark
Set the netfilter packet mark value to the one
associated with the connection. This is only valid
in the mangle table.
-----------------------------------------------------------------
Do you want to apply this patch [N/y/t/f/a/r/b/w/q/?]
Wciskasz 'y' a potem 'Enter' i łata zostaje zainstalowana. Jeśli
chciałbyś sobie doinstalować inne łaty na przykład z zakresu 'extra' to
piszesz:
# IPTABLES_DIR=/usr/src/iptables KERNEL_DIR=/usr/src/linux ./runme extra
Przechodzisz do katalogu /usr/src/iptables
# cd /usr/src/iptables
Przechodzisz do katalogu /usr/src/linux
# cd /usr/src/linux
Konfigurujesz wybrane opcje jądra:
# make menuconfig
Pamiętaj, żeby IMQ działało to musisz włączyć następujące opcje:
# Code maturity level options --->Prompt for development and/or incomplete code/drivers
# Networking options ---> Network packet filtering (replaces ipchains)
# Networking options ---> IP: Netfilter Configuration ---> IP tables support (required for filtering/masq/NAT)
# Networking options ---> IP: Netfilter Configuration ---> Packet mangling
# Networking options ---> IP: Netfilter Configuration ---> IMQ target support
# Network device support ---> IMQ (intermediate queueing device) support
Kompilujesz jądro
# make dep
# make clean
# make bzImage
# make modules
# make modules_install
Kopiujesz swoje nowe jądro i System.map do katalogu z jądrami np. do /boot
# cp /usr/src/linux-2.4.27/arch/i386/boot/bzImage /boot/imq-2.4.27-imq
# cp /usr/src/linux-2.4.27/System.map /boot/System.map-2.4.27-imq
# cp /usr/src/linux-2.4.27/.config /boot/config-2.4.27-imq
W /etc/lilo.conf dopisujesz swoje nowe jądro na przykład tak:
image = /boot/imq-2.4.27-imq
root = /dev/hda1
label = Linux-2.4.27-imq
read-only
Uruchamiasz lilo i restartujesz system.
# lilo -v
# shutdown -r now
No to dotarliśmy już do konca tego artykułu mam nadzieję że udało wam skompilowac poprawnie kernela z z imq, i wszystko chodzi jak powinno, pozniżej zamieszczone są linki do stron z wszelką pomocą i tematami ktore poruszone zostały w tym artykule jak i gotowe skryptami do cięcia transferów w sieci.
W najbliższym czasie jak sie uproam z kilkama własnymi sprawami i znajde czas dołącze do tego artykuły częśc odnośnie nałożenia patcha grsecurity w celu zabezpieczenia serwera
Na wszelkie konstruktywne sugestie i uwagi oczekuję pod adresem krycha@linux.pl .
Nieco informacji na tematy poruszany w tym dokumencie znajdziesz
na: