歡迎大家多多使用。
Archive for the 'FreeBSD' Category
據廖大消息,hinet 開放用戶使用 ipv6 tunnel broker,這裡把我在 bsd 上設定的步驟寫下:
- 首先確定有把 tun/gif 編入 kernel,或是用kldload 載入 if_tun.ko/if_gif.ko
- 安裝port: net/gateway6
- 修改 /usr/local/etc/gw6c.conf
- 修改 /etc/rc.conf
- 執行 gateway6
# 撥接用戶的 userid 是 HN 號碼(八位數字,不用加上@hinet.net),密碼是撥接密碼;固接用戶留空
userid=
passwd=
# 撥接用戶使用的 Server IP 是 203.74.21.88,固接用戶使用的是 203.74.21.89
server=203.74.21.89
# 撥接用戶使用的 auth method 是 any,固接用戶使用的是 anonymous
auth_method=anonymous
host_type=host
prefixlen=64
if_prefix=bge0
gw6_dir=/usr/local
auto_retry_connect=yes
retry_delay=30
keepalive=yes
keepalive_interval=30
tunnel_mode=v6anyv4
# 如果有使用到其他的tun/gif,記得不要衝突。
if_tunnel_v6v4=gif0
if_tunnel_v6udpv4=tun0
if_tunnel_v4v6=gif0
client_v4=auto
client_v6=auto
template=freebsd
proxy_client=no
broker_list=tsp-broker-list.txt
last_server=tsp-last-server.txt
always_use_same_server=no
log_filename=gw6c.log
log_rotation=yes
log_rotation_size=32
syslog_facility=USER
gateway6_enable="YES"
# /usr/local/etc/rc.d/gateway6 start
因為不能使用 router mode,所以如果你有很多台電腦要上 ipv6 的話,只能每台電腦都裝 gateway6 的 client 或用 ipv6 的 nat…
這個版本解決了安全性的問題,有使用的人要去更新啊。
接下來還有 rrdtools 跟 samba 的問題希望儘快解決……
這次跑去日本東京參加AsiaBSDCon,見到了許多大長輩。
自己果然還要多加油才行,對Open Source這邊而言,還沒能脫離使用者的階段。
除此之外,也聽到了許多很酷的點子跟想法。

還有十分榮幸聽到Marshall Kirk McKusick的演講,他的發音跟速度真的無懈可擊,內容更是精彩。有機會的話一定要去現場聽聽。
主辦的日本先生們人也很好,雖然我們日文不是很好,於是他們就用英文跟我們聊天XD 說實在,我也覺得他英文可能比我還好哩(汗)
另外也認識了前輩 delphij,跟他聊了關於 openldap 進 base 的問題,也了解了裡面問題重重啊XD

總之這次真的很開心能參加AsiaBSDCon,真的很感謝各位講者與主辦單位的辛勞。Thank you, all speakers and staffs. ありがとうございました!
1. Install tftp-hpa (/usr/ports/ftp/tftp-hpa)
Install samba3, perl, python
2. Set pxeboot environment
Ref: http://jnlin.org/2006/10/29/141/
3. Change tftpd server to tftp-hpa
/usr/local/libexec/in.tftpd in.tftpd -v -m /tftpboot/rules -s /tftpboot
4. Write rules
(Warning! If you apply my rule, all filenames in tftproot must be lowercase)
# cat > /tftpboot/rules
ri ^[a-z]: # Remove “drive letters”
rg \\ / # Convert backslashes to slashes
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
rg A a
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) \1
5. extract I386 files from Windows XP installation CD
(Ref: http://oss.netfarm.it/guides/ris-linux.php)
- Copy i386 directory from the installation media to a subdir called winxp
in the ris working directory
- Extract the pxe loader:
cabextract
- Modify the name of the loader from NTLDR to XPLDR:
sed -i -e ’s/NTLDR/XPLDR/gi’ startrom.n12
- Move the modified pxe loader to tftpd root, and call it winxp.0
- Extract the setuploader, using cabextract:
cabextract
- Modify the name of the response file from winnt.sif to winxp.sif
sed -i -e ’s/winnt\.sif/winxp\.sif/gi’ setupldr.exe
- Modify the name of ntdetect from ntdetect.com to ntdetect.wxp
sed -i -e ’s/ntdetect\.com/ntdetect\.wxp/gi’ setupldr.exe
- Move the modified setuploader to tftpd root, and call it xpldr
- Copy
and call it ntdetect.wxp
6. Create winxp.sif
(Ref: http://oss.netfarm.it/guides/ris-linux.php)
==
[data]
floppyless = “1″
msdosinitiated = “1″
; Needed for second stage
OriSrc = “\\YOUR_SERVER_NAME\YOUR_SHARE_NAME\winxp\i386″
OriTyp = “4″
LocalSourceOnCD = 1
DisableAdminAccountOnDomainJoin = 1
[SetupData]
OsLoadOptions = “/fastdetect”
; Needed for first stage
SetupSourceDevice = “\Device\LanmanRedirector\YOUR_SERVER_NAME\YOUR_SERVER_SHARE\winxp”
[UserData]
ComputerName = *
; if needed
;ProductID=
==
*** Remember to set the share folder in the samba server ***
Ref: http://oss.netfarm.it/guides/pxe.php
[REMINST]
path = /mnt/disk/ris
browsable = true
read only = No
guest ok = Yes
7. Install NIC drivers to i386/inf
cp nicdrivers/* i386/inf
ln i386/inf/* i386/*
8. Rename all files in winxp to lowercase
find ./ -depth \ | perl -ne 'chomp;m</[^/]*$>;$d=$`;$_=$f=$&;'\ 's/([\x80-\xFF].)|(\w)/$1\l$2/g;system "echo",$d.$f,$d.$_ if $f ne $_'
9. Get Binl Server and extract it
fetch http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
tar zxf http://oss.netfarm.it/guides/ris-linux-0.2.tar.gz
cd ris-linux-0.2
10. Run infparser.py
./infparser.py /where/is/winxp/i386/inf
11. Run ./binlsrv.py
12. Go to install Windows XP
** Useful Ref **
http://oss.netfarm.it/guides/pxe.php
http://oss.netfarm.it/guides/ris-linux.php
http://syslinux.zytor.com/pxe.php
經過了漫長的等待,終於要 Release 了…
現在正在升級手邊自己的機器,學校的機器等自己的升完沒問題再升。
感謝老爹的指導,首先確定 Kernel 有 options GEOM_GPT
接著:
# gpt create -f /dev/da0
# gpt add -t ufs /dev/da0
# gpt label -a -l big /dev/da0
# newfs -m 0 -b 32768 -f 8192 /dev/da0p1
這樣就可以了…
http://proj.sunet.se/E2E/freebsd.txt
http://proj.sunet.se/E2E/tcptune.html
kern.ipc.maxsockbuf=8388608
net.inet.tcp.sendspace=3217968
net.inet.tcp.recvspace=3217968
net.inet.tcp.rfc1323=1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Tcp1323Opts=1
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpWindowSize=[wmax]
設好以後, FTP 的 throughput 提高到 50%, 雖不滿意但可以接受啦…
(原本只能跑到 15%, 還會讓機器 hang 住…)
用了個奇怪的標題…(汗)
- 安裝 isc-dhcpd
- 打開 inetd
# echo ‘inetd_enable=”YES”‘ >> /etc/rc.conf - 打開 tftpd
# vi /etc/inetd.conf
拿掉 tftpd 前面的註解
# /etc/rc.d/inetd start - 下載 SYSLinux 並解開
http://syslinux.zytor.com/download.php - 建立 tftpd 的根目錄
# mkdir /tftpboot - 複製 pxelinux.0, memdisk, menu.c32 到 /tftpboot
# cd syslinux-3.31
# cp pxelinux.0 /tftpboot
# cp com32/modules/menu.c32 /tftpboot
# cp memdisk/memdisk /tftpboot
找不到的話可以用 find 找 - 設定 dhcpd.conf
allow booting; allow bootp; option domain-name "example.org"; option domain-name-servers 10.0.0.1; subnet 10.0.0.0 netmask 255.255.255.0 { range 10.0.0.128 10.0.0.200; option routers 10.0.0.1; next-server 10.0.0.1; filename "pxelinux.0"; } - 打開 dhcpd
# echo ‘dhcpd_enable=”YES”‘ >> /etc/rc.conf
# /usr/local/etc/rc.d/dhcpd start - 設定開機選單
# mkdir /tftproot/pxelinux.cfg
# vi /tftproot/pxelinux.cfg/default
# 預設用 menu.c32 這個核心來啟動,即出現選單 DEFAULT menu.c32 # 不要用 prompt 的方式,即啟用選單 PROMPT 0 # 不要該使用者有選擇權 # 例如更改啟動參數或直接離開選單 ALLOWOPTIONS 0 # 選單的提示時間,50 指 5 秒 TIMEOUT 50 # 選單的標題 MENU TITLE PXELinux Menu # 名稱 LABEL freebsd54 # 選單上顯示的名稱 MENU LABEL BSD # 用來啟動影像檔的核心,pxelinux提供 kernel memdisk # 要載入的影像檔及參數 # 此例為將 bsd 的 bootonly CD # 所做成的 PXE 影像檔 (註一) append initrd=fbsd61.img c=812 h=255 s=63 LABEL local # MENU DEFAULT 是指預設選項 MENU DEFAULT LOCAL # 直接以硬碟開機 LOCALBOOT 0 LABEL dos MENU LABEL DOS kernel memdisk # 將磁片做成影像檔後,直接放進來就可以用了 # 不用加參數,下面的也都是直接用磁片所做成的影像檔 append initrd=dos.img LABEL ghost2003 MENU LABEL ghost2003 kernel memdisk append initrd=ghost2003.img
參考資料:
http://forum.rackred.com/showthread.php?t=2 (註一)
http://blog.rackred.com/2006/05/25/pxe-boot-freebsd-6x/
http://syslinux.zytor.com/pxe.php
http://phorum.study-area.org/viewtopic.php?t=40863
Updated: 忘了附上 bsdstats 的網站: http://www.bsdstats.org/
有圖有真相,台灣目前第6名:
有興趣的人可以裝起來,讓全世界知道FreeBSD也是很多人在用的!
下面附上台灣*BSD數量的統計圖。綠色是*BSD,藍色是FreeBSD的數目。






Latest Comments
RSS