linux命令

ldconfig用於添加動態鏈接庫目錄,及更新動態鏈接庫信息

fuser,可以用來斷開特定的端口鏈接,一個用法:fuser -un tcpport_num

~代表當前用戶的home目錄,如/home/xuriwuyun/
~user 代表user的home目錄,如~root=> /root/

ack ?


kvm創建虛擬機,以網橋方式連接網絡

ifconfig eth0 down # 先關閉eth0接口

brctl addbr br0 # 增加一個虛擬網橋br0

brctl addif br0 eth0 # 在br0中添加一個接口eth0

brctl stp br0 off # 只有一個網橋,所以關閉生成樹協議

brctl setfd br0 1 # 設置br0的轉發延遲

brctl sethello br0 1 # 設置br0的hello時間

ifconfig br0 0.0.0.0 promisc up # 打開br0接口

ifconfig eth0 0.0.0.0 promisc up # 打開eth0接口

dhclient br0 # 從dhcp服務器獲得br0的IP地址

brctl show br0 # 查看虛擬網橋列表

brctl showstp br0 # 查看br0的各接口信息

在沒有dhcp服務器的網絡中也可以用ifconfig命令爲br0接口配置一個靜態IP地址:

ifconfig br0 192.168.0.22 netmask 255.255.255.0

route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.0.254

配置TAP設備的操作:

tunctl -t tap0 -u root # 創建一個tap0接口,只允許root用戶訪問

brctl addif br0 tap0 # 在虛擬網橋中增加一個tap0接口

ifconfig tap0 0.0.0.0 promisc up # 打開tap0接口

brctl showstp br0 # 顯示br0的各個接口


qemu -kernel arch/x86/boot/bzImage -net nic -net tap,ifname=tap0,script=no,downscript=no


taskset 將任務綁定到具體CPU上執行


kernel啓動參數 isolcpus=2,3 使調度器不將任務調度到2,3CPU上執行。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章