將以下複製貼到文字檔上,然後改成.bat檔
---------------------------------------------------------------------
@echo off
route add 66.2.0.0 mask 255.255.0.0 66.1.0.254
route add 66.3.0.0 mask 255.255.0.0 66.1.0.254
route add 66.5.0.0 mask 255.255.0.0 66.4.0.254
route add 66.7.0.0 mask 255.255.0.0 66.6.0.254
route add 66.9.0.0 mask 255.255.0.0 66.8.0.254
route add 66.11.0.0 mask 255.255.0.0 66.11.0.254
route add 66.13.0.0 mask 255.255.0.0 66.13.0.254
---------------------------------------------------------------------
解說:
route add 66.2.0.0 mask 255.255.0.0 66.1.0.254
只要是跑66.2的網段的封包,則都丟給66.1.0.254來做routing
若以上有錯誤的話,也請各位告知! 謝謝~
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
英語地址常用單字縮寫:
Avenue: Ave.
Road: Rd.
Square: Sq.
Province: Prov.
Street: St.
District: Dist.
Floor: /F (一樓的寫法為 1 /F )
Room: Rm.
Apartment: Apt.
Building: Bldg.
Mountain: Mt.
而較少使用的"xx館 xx室"用法如下:
Rm. 168, Bldg. 6 (6館168室)
若以上有錯誤的話,也請大家留言告知,謝謝^^
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
# smartctl -a /dev/sda | grep -i temp | awk '{print $10}'
解說:
smartctl -a /dev/sda → 顯示HDD資訊
grep -i temp → -i為不分temp的大小寫
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
# brctl delif br0 eth0
將br0裡的eth0刪除
# brctl addif br0 eth0
綁定eth0至br0
# ifconfig br0 down
將br0 down下來
# brctl show
顯示bridge哪裡interface
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
# mkdir /mnt/cifs
# mount.cifs //192.168.1.1/file_dir /mnt/cifs -o username='myUsername',password='myPassword',codepage=cp950
(此指令為掛載)
or
# mount -t cifs //192.168.1.1/file_dir /mnt/cifs -o username='myUsername',password='myPassword',codepage=cp950
(此指令也是掛載)
# umount /mnt/cifs
(此為取消掛載)
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
step1. # vim /etc/init.d/dhcpd
step2. 將daemon --pidfile=$pidfile $exec $DHCPDARGS 2>/dev/null 改成 daemon --pidfile=$pidfile $exec eth0 $DHCPDARGS 2>/dev/null
(主要是加上了eth0, 這樣一來,DHCP server在派送ip只會對這個interface(eth0)做,而不會對eth1做。這樣做的理由為假設兩張網卡為不同網段,這樣就可以避掉eth1這個網段的其他電腦來要ip)
step3. # service dhcpd restart
資料來源:
1. http://go-linux.blogspot.com/2006/12/dhcp-server.html
2. http://www.csie.nctu.edu.tw/~tsaiwn/course/introcs/history/linux/linux.tnc.edu.tw/techdoc/dhcp.htm
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
由於工作需求,主管要我另起一台DNS server,但這台新的DNS server要把舊的DNS server資料全部copy過來,於是我參考了一些文章,自己來記錄一下過程!
step1: 在新的CentOS 5.5 安裝所需之packages
# yum install bind-utils bind-chroot bind bind-libs
step2: 先停止舊的DNS service
# service named stop
step3: 將舊的DNS server的/var/named/chroot下的var與etc目錄皆複製到新的CentOS的/var/named/chroot也就是要有以下這兩個目錄! 因為DNS主要的設定檔皆在裡面!
- /var/named/chroot/var
- /var/named/chroot/etc
step4: 啟動新的CentOS裡的DNS service,指令如下!
# service named start
參考資料來源:
1. http://blog.faq-book.com/?p=2969
2. http://linux.vbird.org/linux_basic/0580backup/0580backup-fc4.php
3. http://ithelp.ithome.com.tw/question/10072913
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
原來acpid daemon要啟動後,才有辦法在遠端用OpenIPMI下ipmitool指令去做power soft.不過,如果在BIOS下已開啟ACPI的話,就可以在BIOS的畫面直接下power soft.
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
自己建來CentOS的LiveCD,裡面有詳細的教學https://projects.centos.org/trac/livecd/
網頁有地方有錯:請將「LANG=C livecd-creator --config=centos-livecd-desktop.ks --fslabel=CentOS-5.4--LiveCD」改成「LANG=C livecd-creator -c kickstart.ks -f LiveCD」
註:可使用livecd-iso-to-pxeboot指令將iso換成pxe可以吃的檔案!
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
OpenIPMI command
Packages are OpenIPMI, OpenIPMI-tools, OpenIPMI-libs.
$ ipmitool -U username -P password -H 192.168.1.5 chassis power on
$ ipmitool -U username -P password -H 192.168.1.5 chassis power off
$ ipmitool -U username -P password -H 192.168.1.5 chassis power cycle
$ ipmitool -U username -P password -H 192.168.1.5 chassis power soft
$ ipmitool -U username -P password -H 192.168.1.5 chassis power status
$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev pxe
$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev bios
$ ipmitool -U username -P password -H 192.168.1.5 chassis bootdev disk
$ ipmitool -U username -P password -H 192.168.1.5 bmc info
$ ipmitool -U username -P password -H 192.168.1.5 lan print
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 ipsrc static
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 ipaddr 192.168.1.5
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 netmask 255.255.255.0
$ ipmitool -U username -P password -H 192.168.1.5 lan set 1 defgw ipaddr 192.168.1.254
$ ipmitool -U username -P password -H 192.168.1.5 mc info
$ ipmitool -U username -P password -H 192.168.1.5 mc reset cold
$ ipmitool -U username -P password -H 192.168.1.5 sdr
$ ipmitool -U username -P password -H 192.168.1.5 sel list
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
ALPHA AGS-24X switch開關ports的方法:
$ config ports 1 state enable
$ config ports 1 state disable
ALPHA AGS-24X switch看ports狀態的方法:
$ show ports 1
$ sh ports 1
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
uplink燈號:1G-switch跟10G-switch對接,1G-switch上的10G port燈號。
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
core switch ping ip不通,但region switch ping ip會通,這可能是core switch沒設定"管理IP",而不表示core switch沒有在運作,因為switch只要通了電,它就已經在運作了,因此我們要用console線去接core switch看設定有沒有跑掉。若core switch不通,region switch也不通,那可能core switch真的掛掉了,所以還是要用console線去看看它的情況。
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
smartctl看有關HDD資訊
看smart的log:
$ less /var/log/messages
看HDD是否支援S.M.A.R.T:
$ smartctl -i /dev/sda
若HDD有支援S.M.A.R.T,則啟動S.M.A.R.T功能:
$ smartctl -s on -d ata /dev/sda
看HDD支援哪些self-test routine,通常有short, conveyance與long三種self-test:
$ smartctl -c /dev/sda
使用long self-test routine取得較正確的結果(P.S. 一次只能執行一個測試):
$ smartctl -t long /dev/sda
smartctl不會顯示測試進度,但會回報這個測試要執行多久。等時間差不多後就確認測試進度:
$ smartctl -l selftest /dev/sda
看測試結果:
$ smartctl -a /dev/sda
看測試結果中,健康狀況的部份:
$ smartctl -H /dev/sda
看測試結果中,error log的部份:
$ smartctl -l error /dev/sda
請注意以下這一段:
===============================================
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
............
............
SMART Error Log Version: 1
No Errors Logged
===============================================
***若ID# 5、7、10、11、196~200這幾個項目的RAW_VALUE不為0,且持續增加,應立即備分並更換硬碟。
以上來源出自:http://sites.google.com/site/lab586/linuxnote/hddchecktip
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()
badblocks 指令檢測損壞磁區 (P.S. 讀寫次數龐大,常用會損害硬碟壽命)
語法:
badblocks [ -svwnf ] [ -b block-size ] [ -c blocks_at_once ] [ -e max_bad_blocks ] [ -d read_delay_factor ]
[-i input_file ] [ -o output_file ] [ -p num_passes ] [ -t test_pattern ] device [ last-block ] [ first-block ]
常用選項:
(default): non-destructive read-only mode 無損唯讀模式,較快。
-n: non-destructive read-write mode 無損讀寫模式,速度最慢。掛載中硬碟需加 -f 強制執行 (會有硬碟/檔案系統毀損的風險)
-w: destructive write test 毀滅性寫入測試。會將檔案全部抹銷!掛載中硬碟需加 -f 強制執行
-f: 強制執行,與 -n 或 -w 配合使用
-v: 執行中回報進度
-s: 將檢測出的壞磁區顯示在螢幕上
-i input_file: 略過不檢測 input_file 裡的已知 badblocks,這些已知 badblocks 同樣不會顯示在檢測結果中。
-o output_file: 將檢測出的 badblocks 寫在 output_file 上。
通常為求速度與資料安全,會使用預設的無損唯讀模式進行掃描。例如:
$ badblocks -v /dev/sda -o badblocks.txt
以上command為對 /dev/sda 進行無損唯讀模式掃描,-v 選項令 badblocks 在執行中回報進度,並以 -o 選項將檢測出的損壞磁區寫在 badblocks.txt 檔案裡。
Posted by dreamtails at 痞客邦 PIXNET 留言(0) 引用(0) 人氣()