ネツクク入れてみた

入れてみただけで、何もしていないに等しいんだけど。何ができるかもよくわかんない。
まず必要な環境を整備。

requires :

kernel module
# dpkg -i kernel-source-2.6.10-iop1_ba3_all.deb
# cd /usr/src/
# tar jxvf kernel-source-2.6.10-iop1.tar.bz2
# cd kernel-source-2.6.10-iop1
# cp ../kernel-headers-2.6.10-iop1/.config ./
# make oldconfig
# apt-get install ncurses-dev
# make menuconfig

#
# Networking options
#
o CONFIG_PACKET=y
o CONFIG_UNIX=y
o CONFIG_INET=y
o CONFIG_IP_MULTICAST=y
o CONFIG_IP_ADVANCED_ROUTER=y
o CONFIG_IP_MULTIPLE_TABLES=y
o CONFIG_IP_ROUTE_MULTIPATH=y
o CONFIG_NET_IPIP=y
o CONFIG_NETFILTER=y

#
# IP: Netfilter Configuration
#
o CONFIG_IP_NF_CONNTRACK=y
o CONFIG_IP_NF_FTP=y
o CONFIG_IP_NF_IPTABLES=y
o CONFIG_IP_NF_FILTER=y
? CONFIG_IP_NF_TARGET_REJECT=y
o CONFIG_IP_NF_NAT=y
o CONFIG_IP_NF_NAT_NEEDED=y
o CONFIG_IP_NF_TARGET_MASQUERADE=y
o CONFIG_IP_NF_NAT_FTP=y

# apt-get install gcc-3.4
# vi /etc/kernel-pkg.conf
maintainer := kinneko
email := kinneko@gmail.com
# cd /usr/src
# ln -s /usr/src/kernel-source-2.6.10-iop1 /usr/src/linux
# cd /usr/src/linux
# make-kpkg clean
# make-kpkg --revision netsukuku1 --zimage kernel_image
# dpkg -i kernel-image-2.6.10-iop1_netsukuku1_arm.deb

-rw-r--r-- 1 root root 1688360 Mar 8 11:47 vmlinuz-2.6.10-iop1
-rw-r--r-- 1 root root 1626632 Feb 22 15:19 zImage
-rwxr-xr-x 1 root root 1635288 Dec 13 10:01 zImage.orig

# cp /boot/zImage /boot/zImage.ba3
# cp /boot/vmlinuz-2.6.10-iop1 /boot/zImage
# shutdown -r now

SCons
# apt-cache search scons
scons - A replacement for Make
install: scons 0.96.1-1

Python2.4
# dpkg -l | grep python2.4
ii python2.4 2.4.1-2 An interactive high-level object-oriented la
ii python2.4-cher 2.1.0-0.1 Python web development framework
ii python2.4-dev 2.4.1-2 Header files and a static library for Python
ii python2.4-elem 1.2.6-3 Light-weight toolkit for XML processing
ii python2.4-setu 0.6a8-1 Python Distutils Enhancements

libgmp
# apt-cache search libgmp
libgmp-ocaml - O'Caml bindings for the GNU multiprecision arithmetic library
libgmp-ocaml-dev - O'Caml bindings for the GNU multiprecision arithmetic library
libgmp3 - Multiprecision arithmetic library
libgmp3-dev - Multiprecision arithmetic library developers tools
libgmp3-doc - Multiprecision arithmetic library documentation and examples
install: libgmp3 4.1.4-6, libgmp3-dev 4.1.4-6

OpenSSL
# dpkg -l | grep openssl
ii openssl 0.9.7e-3sarge1 Secure Socket Layer (SSL) binary and related
ii ssl-cert 1.0-11 Simple debconf wrapper for openssl

んで、コンパイル

# cd /home/
# mkdir netsukuku
# cd netsukuku/
# wget http://netsukuku.freaknet.org/netsukuku-0.0.6b.tar.bz2
# tar jxvf netsukuku-0.0.6b.tar.bz2
# cd netsukuku-0.0.6b
# ls
AUTHORS INSTALL NEWS config.guess configure.ac install-sh
COPYING Makefile.am README config.sub depcomp missing
ChangeLog Makefile.in aclocal.m4 configure doc src

# scons
scons: *** No SConstruct file found.
File "/usr/lib/scons/SCons/Script/__init__.py", line 870, in _main
ダメじゃん。# scons installまで行けない。
# ./configure && make && make install

動かして見る。

$ man netsukuku_d

269-udp, 269-tcp, 271-udp, 277-udp, 277-tcp をリッスンするらしい。

$ man andna

/etc/netsukuku/andna_hostnamesにホスト名を書くのかな。

/etc/netsukuku/andna_hostnames, ip_masquerade.sh, netsukuku.conf

kinnnekos_glantank

# netsukuku_d -D

Dなのにnodaemonなのかね。

+ Network interface "eth0" detected
* Cannot load the lcl_cache from /usr/share/netsukuku/lcl_cache: No such file or directory
* Cannot load the andna_cache from /usr/share/netsukuku/andna_cache: No such file or directory
* Cannot load the counter_c from /usr/share/netsukuku/counter_cache: No such file or directory
* Cannot load the rh_cache from /usr/share/netsukuku/rh_cache: No such file or directory
+ Generating a new keyring for the future ANDNA requests.
The keyring will be saved in the lcl file
+ Modifying /etc/resolv.conf

あれ、ここで止まったな。
eth0を完全にのっとられたかな。セッション切れたし。
外と通信している気配はないな。
 
シリアルから入ってみる。
動いているな。

4436 pts/0 S+ 0:07 netsukuku_d -D
4437 pts/0 S+ 0:00 netsukuku_d -D
4438 pts/0 S+ 0:00 netsukuku_d -D
4439 pts/0 S+ 0:00 netsukuku_d -D
4440 pts/0 S+ 0:00 netsukuku_d -D
4441 pts/0 S+ 0:00 netsukuku_d -D
4442 pts/0 S+ 0:00 netsukuku_d -D
4443 pts/0 S+ 0:00 netsukuku_d -D
4445 pts/0 S+ 0:00 netsukuku_d -D

# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:B0:77:40:E9
inet addr:185.45.93.40 Bcast:185.45.255.255 Mask:255.255.0.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4205 errors:0 dropped:0 overruns:0 frame:0
TX packets:4872 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1345728 (1.2 MiB) TX bytes:422411 (412.5 KiB)
Memory:80000000-80020000

アドレスも拾っているようだ。

# cat /etc/resolv.conf
nameserver 127.0.0.1
#nameserver xxx.xxx.xxx.xxx

こっちも書き換えられている。

# killall netsukuku_d

# netsukuku_d -d
+ Network interface "eth0" detected
# Andna Local Cache loaded
# Malformed or empty andna_cache file. Aborting load_andna_cache().
# Malformed or empty counter_c file. Aborting load_counter_c().
# Malformed or empty rh_cache file. Aborting load_rh_cache().
# Hostnames file loaded
+ Generating a new keyring for the future ANDNA requests.
The keyring will be saved in the lcl file
# Andns init: DNS query inet-related will be forwarded to: 202.122.48.103, 202.
+ Modifying /etc/resolv.conf
* Malformed map file. Aborting load_map().
* Malformed ext_map file. Aborting load_extmap().
+ Setting the 10.0.0.255 ip to all the interfaces
# Activating ip_forward and disabling rp_filter
+ Forking to background

マップ情報の取得に失敗している。NAT配下からの接続は無理なのかな。

# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:8000 *:* LISTEN
tcp 0 0 *:daap *:* LISTEN
tcp 0 0 *:269 *:* LISTEN
tcp 0 0 *:webcache *:* LISTEN
tcp 0 0 *:www *:* LISTEN
tcp 0 0 *:277 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:5335 *:* LISTEN
tcp 0 0 *:telnet *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 0 *:4444 *:* LISTEN
udp 0 0 *:269 *:*
udp 0 0 *:271 *:*
udp 0 0 *:277 *:*
udp 0 0 *:domain *:*
udp 0 0 *:bootpc *:*
udp 0 0 *:5353 *:*
udp 0 0 *:5353 *:*
udp 0 0 *:1900 *:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 1788 /var/run/apache2/cgik

指定ポートでは、ちゃんとlistenしている。

# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:B0:77:40:E9
inet addr:143.192.202.23 Bcast:143.192.255.255 Mask:255.255.0.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4246 errors:0 dropped:0 overruns:0 frame:0
TX packets:6674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1349830 (1.2 MiB) TX bytes:537739 (525.1 KiB)
Memory:80000000-80020000

アドレスは都度変更らしい。

# apt-get update
Err http://ftp.debian.org sarge/main Packages
Could not resolve 'ftp.debian.org'

インターネット空間の名前解決はできない。

# ping 143.192.202.23
PING 143.192.202.23 (143.192.202.23) 56(84) bytes of data.
64 bytes from 143.192.202.23: icmp_seq=1 ttl=64 time=0.430 ms

"-I"で起動してみる。

# killall netsukuku_d

-I share your internet connection

# netsukuku_d -I

  1. Share_internet=1. Assuming restricted=1
  2. Share_internet=1. Assuming inet_connection=1
  3. Network interface "eth0" detected
  4. Network interface "tunl0" detected
  5. Generating a new keyring for the future ANDNA requests.

The keyring will be saved in the lcl file

  1. Modifying /etc/resolv.conf
  2. Configuring the "tunl0" tunnel device
  3. Executing "/etc/netsukuku/ip_masquerade.sh start"
  4. The retrieval of the default gw from the kernel failed.

! The default gw isn't set in the kernel and you didn't specified it in netsuku!
# killall netsukuku_d
netsukuku_d: no process killed

上がれなかった模様。gwのアドレスが取れなかったのか、gwがマルチキャスト透過でないとダメなのか?
IPv4のネットワーク情報が潰れているからかな。

# /etc/init.d/networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...ifup: interface lo already configured
Dhcpcd is already running.
done.

# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:B0:77:40:E9
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:4290 errors:0 dropped:0 overruns:0 frame:0
TX packets:8432 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1355120 (1.2 MiB) TX bytes:650251 (635.0 KiB)
Memory:80000000-80020000

# /etc/init.d/networking restart
Setting up IP spoofing protection: rp_filter.
Reconfiguring network interfaces...**** /sbin/dhcpcd-bin: not running
ifup: interface lo already configured
e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex
dhcpcd.exe: interface eth0 has been configured with new IP=192.168.123.25
done.

# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:A0:B0:77:40:E9
inet addr:192.168.123.25 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4295 errors:0 dropped:0 overruns:0 frame:0
TX packets:8437 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1356050 (1.2 MiB) TX bytes:651631 (636.3 KiB)
Memory:80000000-80020000

# netsukuku_d -I

  1. Share_internet=1. Assuming restricted=1
  2. Share_internet=1. Assuming inet_connection=1
  3. Network interface "eth0" detected
  4. Network interface "tunl0" detected
  5. Generating a new keyring for the future ANDNA requests.

The keyring will be saved in the lcl file

  1. Modifying /etc/resolv.conf
  2. Configuring the "tunl0" tunnel device
  3. Executing "/etc/netsukuku/ip_masquerade.sh start"
  4. Using "192.168.0.254 dev eth0" as your first Internet gateway.
  5. Deleting the "eth0" interface from the device list since it is part of the pr.

! The deleted interface cannot be used by NetsukukuD because it is part
of your primary Internet gw route. You have to specify another
interface with the -i option or you won't be able share your Internet connecn

共存する場合は、デフォルトgwにつながっているI/Fはダメなのかな?
tunlが上がったのを確認しておく。

# ifconfig tunl0
tunl0 Link encap:IPIP Tunnel HWaddr
inet addr:10.233.68.83 Mask:255.0.0.0
UP RUNNING NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

ネットワークの動きはなんとなくわかったけど、サービスとかはどうなるんだろう。従来のものがそのまま使えるのかな。相手の名前がわからないと名前解決もできないんだけど、これはそんなもんなんだろうか。