Archive for 十月, 2007

FreeBSD IP設定相關

ifconfig [interface] [IP] netmask [netmask] alias
或者
ifconfig [interface] [IP/mask] alias
(似乎可以加在/etc/rc.net中成為開機設定,未嘗試)
要拿掉就用
ifconfig [interface] delete [IP]

在/etc/rc.conf寫類似下面的內容,每外加就依此類以推
ifconfig_lnc0="inet 192.168.30.3 netmask 255.255.255.0″
ifconfig_lnc0_alias0="inet 192.168.30.1 netmask 255.255.255.255″
ifconfig_lnc0_alias1="inet 192.168.30.2 netmask 255.255.255.255″

改過後ping看看外部網路,有可能會需要
route add default [IP]
重設default gateway

發表迴響

vim-lite如何把iconv編進來

答案是,先把libiconv裝好,vim-lite就會自動把它編進來(死)

發表迴響

資料夾檔案分別設定權限

find ./ -type d -exec chmod 775 "{}" \;
全部資料夾改775
find ./ -type f -exec chmod 664 "{}" \;
全部檔案改664

發表迴響

*nix console ssh tunnel

ssh -N -f -g -L [localport]:[targethost]:[targetport] [username]@[sshservername]
-N 不建立shell
-f 背景執行(含-n)
-g 不限聆聽lo0(就是127.0.0.1啦)
-L [localport]:[targethost]:[targetport]將本機的port經由sshserver對應到目標機器的目標port
-R [localport]:[targethost]:[targetport]將遠端的port經由client對應到目標機器的目標port

發表迴響

FreeBSD 內建BIND使用方式

在/etc/namedb
rndc-confgen > rndc.conf
rndc-confgen -a -c /etc/namedb/rndc.key
把rndc.conf下mark起來的地方丟到/etc/namedb/named.conf最後
/etc/rc.d/named start

其他的例如domain file設定就一如往昔…
listen-on跟allow-transfer要記得設{ any; };或相對應的東西…

發表迴響