
Maldives
Life is like a toilet paper, sometimes it's useful...but sometimes it's full of shit!
OpenWRT本身預設使用dnsmasq作為dns proxy, 其實dnsmasq除了可以將query request轉送給真正的dns server之外, 它也可以讀取/etc/hosts或指定的檔案中的設定, 並將結果回覆給client, 所以dnsmasq非常適合最為一個小型區域網路中的dns server, 而且不管是正向或反向查詢都可正常運作, 做法如下, 請編輯/etc/init.d/S50dnsmasq, 輸入以下內容,
#!/bin/sh
dnsmasq --domain=$(nvram get dhcp_domain)
上面的敘述中, 我們從nvram變數dhcp_domain讀取domain的名稱, 這麼做的目的是為了可以查詢如server1.alphalab.org之類的名稱(假設我們的domain叫做alphalab.org), 所以我們必須把domain的名稱寫到nvram中,
root@wrt54gs:~# nvram set dhcp_domain=alphalab.org
root@wrt54gs:~# nvram commit
接著我們可以開始加入電腦名稱到/etc/hosts中,
127.0.0.1 localhost wrt54gs.alphalab.org wrt54gs
192.168.200.248 x255.alphalab.org x255
192.168.200.150 x230.alphalab.org x230
Openwrt預設安裝的dhcp server是dnsmasq, dnsmasq基本上是一個小型的domain name server但也同時提供dhcp server的功能, 又小又好用, 功能也不少, 實在沒什麼好挑剔的, 不過剛好我的環境中需架設PXE Server, 需要dhcp server, 偏偏dnsmasq不提供指向tftp server的功能, 可是同一lan中同時有兩個dhcp server會很麻煩, 分開兩個lan也是麻煩, 所以一直很想使用功能較完整的dhcp server來取代dnsmasq的dhcp功能, 首先下載我們需要的dhcp server, 可以在這裡http://openwrt.alphacore.net/ 找到,
root@wrt54gs:~# wget \
http://openwrt.alphacore.net/dhcpd_3.0.1_mipsel.ipk
接下來進行安裝,
root@wrt54gs:~# ipkg install dhcpd_3.0.1_mipsel.ipk
安裝好後, 還需要撰寫/etc/dhcpd.conf, 內容大致如下,
#/etc/dhcpd.conf
default-lease-time 7776000;
max-lease-time 7776000;
ddns-update-style none;
server-name drbl;
option routers 192.168.200.254;
option domain-name "alphalab.org";
option domain-name-servers 192.168.200.254;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.200.255;
filename = "pxelinux.0";
subnet 192.168.200.0 netmask 255.255.255.0 {
range 192.168.200.240 192.168.200.249;
host p5020 {
hardware ethernet 00:0B:5D:24:20:63;
fixed-address 192.168.200.100;
}
}
因為dhcpd執行的時候需要dhcpd.leases檔案存在, 所以我們先產生一個空的給他,
root@wrt54gs:~# echo "" > /etc/dhcpd.leases
接下來撰寫啟動腳本, 我們將dhcpd的啟動放在dnsmasq之後, 請建立一個檔案/etc/init.d/S51dhcpd, 內容如下,
#!/bin/sh
/usr/sbin/dhcpd -lf /etc/dhcpd.leases br0
為了不與dnsmasq的dhcp server衝突, 我們必須關閉dnsmasq的dhcp功能, 請修改/etc/init.d/S50dnsmasq如下,
#!/bin/sh
/usr/sbin/dnsmasq
VMware最近推出了一個免費的VMware Player, 讓你可以免費執行VMware Workstation, GSX, ESX等軟體建立出來的虛擬機器, 但是如果你沒有這些需付費的軟體該怎麼辦? 別擔心, 這篇文章交你怎麼使用免費的QEMU來製作可讓VMware Player執行的VM喔, 真是夭壽好用咧!
以下是我編譯mapfs.ko的步驟:
至於如何載入就比較傷腦筋了, 因為有幾個相關了kernel symbols需要設定, 找了半天卻找不到相關文件解釋如何設定, 網路上又好像沒什麼人在用這東西, 不過還好, 最後還是在它的mailing list中看到一篇文章有提到載入的方式, 我只有改了一下路徑
MapFS implements a Linux filesystem which utilizes copy-on-write functionality and existing Linux filesystems to allow component filesystems (or portions thereof) to be combined into a single virtual filesystem that appears to be fully writable. It is written in C, uses the standard Linux kernel VFS and loadable module interfaces for defining new filesystem types to the kernel, and supports (at least) kernel versions 2.4.7 to 2.6.13.
This project builds a stackable unification file system, which can appear to merge the contents of several directories (branches), while keeping their physical content separate. Unionfs is useful for unified source tree management, merged contents of split CD-ROM, merged separate software package directories, data grids, and more. Unionfs allows any mix of read-only and read-write branches, as well as insertion and deletion of branches anywhere in the fan-out. To maintain unix semantics, Unionfs handles elimination of duplicates, partial-error conditions, and more. Unionfs is part of the larger FiST project.
掛網掛到精神不濟時, 突然幾句話閃過眼角...