瀏覽模式: 普通 | 列表

Linux 更改網卡卡號


ip link set eth0 down
ip link set eth0 address 11:22:33:44:55:66
ip link set eth0 up



ifconfig eth0 down
ifconfig eth0 hw ether 11:22:33:44:55:66
ifconfig eth0 up

參考
http://alangnet.blogdns.net/index.php?op=printView&articleId=100&blogId=1
http://linux.vbird.org/linux_server/0140networkcommand.php#ip_cmd

Linux 底下免費的遊戲

Linux 指令 dd - 可以產生大檔及備份硬碟磁區

Linux 有個指令 dd

dd - convert and copy a file

它的本意只是用來複製與轉換檔案

1。如果我要一個大檔,比方說 1MB的
dd if=/dev/zero of=1MB_file count=2048 bs=512

bs 是block 的大小,預設 512 bytes

count 是要多少個 bs

1MB的檔也可以這麼作

[閱讀全文]

標籤: dd 硬碟

fedora 沒有 kudzu 了

起頭是,我把虛擬機器的image檔放到別台系統跑,網卡因為 MAC Address 不一樣了所以無法up

照慣例會下 kudzu 去讓系統重新抓一遍網卡,可能偏說這個指令不存在,

fedora 應該有的啊 !!!

查了一下,原來不知道從那個版本開始這個指令就不再使用了,

那怎麼修正這個問題

在 linux 下了 dmesg 會發現
udev: renamed network interface eth0 to eth1
網卡竟改名字了

cat /proc/net/dev 查看也是 eth1

[閱讀全文]

標籤: fedora kudzu

如何知道現在Linux Kernel 支援那些東西

當我要知道我想要使用的東西核心有沒有支援,可以查這個檔

/boot/config-`uname -r`

1。沒有註解的
2。=y 表示已編在核心裡
3。=m 表示是用模組的方式掛載使用

標籤: kernel

iptables 的 limit 模組使用

目的: 希望每分鐘只允許10個ICMP封包

設定
iptables -A INPUT -p icmp --icmp-type 8 -m limit --limit 6/m --limit-burst 10 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 8 -j DROP
-m limit 就是代表要使用 limit 這個功能

--limit 6/m 代表每分鐘只允許6個icmp

--limit-burst 10 代表每分鐘只允許10個icmp

是不是覺得很怪,到底是只允許6個還是10個 ??

實際舉例

PING 10.10.10.168 (10.10.10.168) 56(84) bytes of data.
64 bytes from 10.10.10.168: icmp_seq=0 ttl=64 time=4.10 ms
64 bytes from 10.10.10.168: icmp_seq=1 ttl=64 time=0.286 ms
64 bytes from 10.10.10.168: icmp_seq=2 ttl=64 time=0.281 ms
64 bytes from 10.10.10.168: icmp_seq=3 ttl=64 time=0.261 ms

[閱讀全文]

標籤: iptables limit

怎麼在ssh console底下刪除特殊字元的檔案

比方說不小心產生了一個檔案名為 '-file',它多了一個字元 - (dash,在鍵盤數字 0 的右邊)

當我要刪除它執行了
rm -file
這個 - 會被認為是 rm 的參數之一而無法刪除成功
就算是
rm '-file'
也是如此

這時後可以再多兩個 --就可以成功刪除了
# 說明: rm(空隔)--(空隔)-file
rm -- -file
標籤: ssh