2007年6月26日 星期二

FC6 裝 atheros 5211 driver

Installing Atheros Cards (madwifi-ng drivers)

 

 

NOTE: There are issues with the new 2.6.19 kernel, this build only works with the 2.6.18 kernel (see troubleshooting)

 

 

Download madwifi-0.9.2.1.tar.gz from http://madwifi.org/ to /root

Download madwifi-ng-r1886.patch from http://patches.aircrack-ng.org/madwifi-ng-r1886.patch  to /root

tar zxvf madwifi-0.9.21.tar.gz

cd madwifi-0.9.2.1

ln -s /usr/src/kernels/2.6.18-1.2849.fc6-i686/include/config/i2o/config.h   /usr/src/kernels/2.6.18-1.2849.fc6-i686/include/linux/config.h 

NOTE: the above 'ln -s' command is all entered on the same line!

export KERNELPATH=/usr/src/kernels/2.6.18-2849.fc6-i686

NOTE: You may have to replace the kernel version listed above (2.6.18-1.2849.fc6-i686) to your particular version if you are running a different kernel version.

patch -Np1 -i ../madwifi-ng-r1886.patch

make

make install

If prompted:

 

If you are installing new MadWifi modules, you should consider removing those

already installed, or else you may experience problems during operation.

Remove old modules?

[l]ist, [r]emove, [i]gnore or e[x]it (l,r,i,[x]) ?

choose 'r' to remove

modprobe ath_pci

Installation is now complete.

 

iwconfig should now confirm the card is installed: wifi0 and ath0 (See madwifi-ng commands)

 

Providing kismet is installed, and configured correctly (See: Kismet Installation guide)

 

Kismet should start by typing: kismet

 

NOTE: ensure kismet.conf is configured correctly 'source=madwifi_b,wifi0,madwifi')

 

 

To set the card into monitor mode use either:

 

airmon-ng start ath0 [channel] from the aircrack-ng suite

 

or

 

ifconfig ath0 down


wlanconfig ath0 destroy

 

wlanconfig ath0 create wlandev wifi0 wlanmode monitor from the madwifi commands

[@more@]

如何安裝 SEND 0.2 on Fedora6

SEND project : http://www.docomolabs-usa.com/lab_opensource.html

DoCoMo's SEND is implemented completely in user space, so it is portable and lends itself to experimentation. It currently runs on Linux (tested on 2.6 kernels) and FreeBSD (tested on 5.4).

[@more@]

 We have tested SEND on a number of 2.6.x kernels, on a number of
major distributions: Fedora Core 2 – 4, Ubuntu 5.10, and SUSE 10.0.
It should work on any distribution running a correctly configured
2.6.x kernel.

Your kernel must have the following enabled:
• CONFIG_NETFILTER
• CONFIG_IPV6
• CONFIG_IP6_NF_QUEUE
• CONFIG_IP6_NF_IPTABLES
• CONFIG_IP6_NF_FILTER
• CONFIG_PROC_FS

還好 Fedora 6 都有支援不需重編 kernel

Additionally, you need to ensure that the netfilter iptables user
space utilities are installed (check for the ip6tables command), and
that you have the netfilter libipq development library and headers
installed. Check your distribution's package repository, or download
the source from http://www.netfilter.org/.

SEND on Linux uses netfilter's IP queuing mechanism to capture and
reinject packets. Before sendd runs, you need to ensure that the
appropriate netfilter rules are in place. After installation, you
will find the scripts “sendd” and “snd_upd_fw” in /etc/init.d. You
should use /etc/init.d/sendd to start sendd by default. If you want
to run sendd directly from the command line, add the necessary rules
with /etc/init.d/snd_upd_fw add. When done, you can remove the rules
with /etc/init.d/snd_upd_fw del.

/etc/init.d/snd_upd_fw add

用來設定 ip6tables 的規則,讓 Neighbor Discovery 的封包先進到 Queue 裡面

1. 安裝相關的套件
2. 編輯 Makefile.config
    make
    make install
3. 設定 SEND

裝完後有三個執行檔

senddThe SEND daemon
cgatoolTool for configuring CGAs
ipexttoolTool for configuring PKIX IP certificate extensions

1. 安裝相關的套件

‧ libcrypto 0.9.7 or greater, library and development headers
‧ GNU make
‧ GCC (tested with 3.3.2 – 4.0.0)
‧ lex
‧ yacc
‧ optional: libreadline, ncurses libraries and development headers.

# yum install iptables-devel ip6tables-devel readline readline-devel ncurses ncurses-devel

2. 編輯 Makefile.config

OS=linux
prefix=/usr/local/send-0.2
DEBUG_POLICY= DEBUG #會把錯誤訊息顯示出來,不然要到 /var/log/messages 看

make 完 沒有錯的話就成功了
再來 make install 會因為 find_ip6tables.sh 無法執行而失敗

# make
# chmod +x sendd/os/find_ip6tables.sh
# make install

3. 設定 SEND

   3.1. Generate CGA parameters and a CGA

   3.2. Configure sendd. 

# ../sbin/cgatool --gen -R 1024 -k mykey.pem -p fe80:: -o myder1 -s 1
# ../sbin/cgatool -g -k mykey.pem -o myder2 -p fe80:: -s 1

params.conf

# Some (somewhat nonsensical) examples

named default {
        snd_cga_params /usr/local/send-0.2/etc/myder;
        snd_cga_priv /usr/local/send-0.2/etc/mykey.pem;
        snd_cga_sec 1;
}

address fe80::207e:78a7:edca:c81e {
        use default;
        interface eth1;
}

sendd.conf

#
# Non-optional
#

# The path of the file containing this host's CGA parameters
# configuration file
# <no default>
snd_cga_params=/usr/local/send-0.2/etc/params.conf

#
# Optional
#
snd_debugs=sendd:cert,sendd:proto

 

# modprobe ip6_queue
# ip6tables -F
# /etc/init.d/snd_upd_fw add
# ../sbin/sendd -c sendd.conf -i eth1 -f

RPM 相關指令

RPM 相關的指令常常忘記

記錄一下常用的指令

[@more@]

RPM

rpm -ivh XXX.rpm安裝 XXX 套件
rpm -Uvh XXX.rpm對已安裝過的套件升級
rpm -qa | grep XXX

查詢所有已安裝的套件,找出 XXX

rpm -q[i,l,d,c] net-snmp-5.3.1-12.fc6列出已安裝的套件, 檔案放的位置(i:詳細資訊, l:所有檔案, d:說明檔, c:設定檔)
rpm -qp[l,d,c] net-snmp-5.3.1-12.fc6.i386.rpm列出未安裝的套件, 其它與上相同

SRPM

rpm -ivh XXX.src.rpm安裝 XXX 的原始碼套件
rpmbuild -bb XXX.spec編譯且打包, 放在 /usr/src/redhat/RPMS

下面偷鳥哥大大的文 (不好意思)

/usr/src/redhat/SPEC放套件的設定檔,套件的資訊參數、設定項目等等都放置在這裡;
/usr/src/redhat/SOURCE放套件的原始檔(*.tar.gz的檔案)以及 config 這個設定檔;
/usr/src/redhat/BUILD編譯的過程中,放暫存的資料
/usr/src/redhat/RPMS編譯之後,將打包完成的檔案放置在這個目錄當中。

slackware 預設的 kernel

重編 kernel 選東西是非常累人的

如果只是要在 kernel 加一些東西的話

可以從 slackware 原本預設的 kernel 裡面加,這樣就不會少東少西的

那預設 kernel 的 .config 檔在哪咧

就在 slackware 光碟裡面 /mnt/cdrom/kernels/bare.i/config

把他拷到 /usr/src/linux/.config 就可以用預設的選項來改了

[@more@]

slackware 忘記密碼

忘記密碼,在 slackware 的 LILO single mode 沒用

豪哥說明

如何解呢,請看以下說明

[@more@]

開機後在 LILO 輸入 

linux init=/bin/sh

出現提示符號後輸入 (注意「,」前後不能有空格)

mount -o rw,remount /

然後就可以改密碼了

passwd root
sync; sync; sync;

Mail server重複寄信

最近一直再找Mail server重複寄信的問題

原來是Openwebmail 的自動回覆功能有問題

如果啟動 Openwebmail 自動回覆的話會在家目錄下的 .forward

增加一段

"/apache/cgi-bin/openwebmail/vacation.pl -t60s -a user@mailserver user"
user

然後有人寄的群組有包含這個帳號的話就會被退信

Undelivered Mail Returned to Sender
<user@mailserver> : Command died with status 1: "/apache/cgi-bin/openwebmail/vacation.pl -t60s -a user@mailserver user"

mail server 以為寄失敗過不久又對整個群組重寄 XD...結果就一堆信寄不完

看來是我們 openwebmail 有問題, 要來重裝了...