IPマスカレードの為のカーネル&モジュール再構築ここは、カーネル& PCMCIAモジュールを一気に再構築してしまいます。
■ カーネルパッケージ作成必要と思われるパッケージをインストールしておく
# apt-get install kernel-packageソースツリーの展開
# apt-get install bzip2
# apt-get install bin86
# apt-get install gcc
# apt-get install libncurses5-dev
# apt-get install kernel-source-2.2.19
# apt-get install pcmcia-source 3.1.22-0.2potato
# cd /usr/src/usr/src# tar -xvf kernel-source-2.2.19.tar
最近はbzip2形式らしいです。その場合は
# tar -Ixvf kernel-source-2.2.19.tar.bz2シンボリックリンクの張り直し
/usr/src# ln -s kernel-source-2.2.19 linuxカーネル構成を設定する
/usr/src# ln -s kernel-source-2.2.19 linux-2.2.19
/usr/src# cd /usr/src/linuxNetworking optionsを選択し設定する。
/usr/src/linux# make menuconfig
<M> Packet socketカーネル構成を保存して終了する。
[*] Kernel/User netlink socket
[*] Routing messages
<*> Netlink device emulation
[*] Network firewalls
[*] Socket Filtering
<M> Unix domain sockets
[*] TCP/IP networking
[*] IP: multicasting
[*] IP: advanced router
[ ] IP: policy routing
[ ] IP: equal cost multipath
[ ] IP: use TOS value as routing key
[ ] IP: verbose route monitoring
[ ] IP: large routing tables
[ ] IP: kernel-level configuration support
[*] IP: firewalling
[*] IP: firewall packet netlink device
[ ] IP: transparent proxy support
[*] IP: masquerading
--- Protocol-specific masquerading support will be built as modules.
[*] IP: ICMP masquerading
--- Protocol-specific masquerading support will be built as modules.
[*] IP: masquerading special modules support
<M> IP: ipautofw masq support (EXPERIMENTAL)
<M> IP: ipportfw masq support (EXPERIMENTAL)
<M> IP: ip fwmark masq-forwarding support (EXPERIMENTAL)
[*] IP: optimize as router not host
<M> IP: tunneling
<M> IP: GRE tunnels over IP
[ ] IP: broadcast GRE over IP
[ ] IP: multicast routing
[*] IP: aliasing support
[ ] IP: ARP daemon support (EXPERIMENTAL)
[*] IP: TCP syncookie support (not enabled per default)ディレクトリ内の余分なファイルを削除する。
# make-kpkg cleanパッケージ作成
# make-kpkg --revision 02010401 kernel_image
/usr/srcに kernel-image-2.2.19_02010401_i386.debというパッケージファイルができる。
■ PCMCIAモジュール関係パッケージ作成ソースツリーの展開
# cd /usr/srcモジュール関連のコンパイル
/usr/src# tar -zxvf pcmcia-cs.tar.gz
# cd /usr/src/linux# make-kpkg --revision 02010401 modules-imageパッケージ作成
# cd /usr/src/modules/pcmcia-cs/usr/src/modulesに以下のパッケージが作成される。
# debian/rules binary-modules
# debian/rules binary-cs
pcmcia-cs_3.1.22-0.2potato_i386.deb作成したパッケージをインストールします。
pcmcia-modules-2.2.19_3.1.22-0.2potato+02010401_i386.deb
# dpkg -i /usr/src/kernel-image-2.2.19_02010401_i386.deb# dpkg -i /usr/src/modules/pcmcia-cs_3.1.22-0.2potato_i386.deb
# dpkg -i /usr/src/modules/pcmcia-modules-2.2.19_3.1.22-0.2potato+02010401_i386.deb # reboot