Fedora KVM Bridge 备忘

 

Fedora KVM Bridge 备忘

 

 

Fedora KVM Bridge 备忘

环境:

 

Fedora 9 x86_64 @ AMD Athlon X2 5000+

单网卡 (eth0), runlevel 3

角色: Linux NATDHCP ServerKVM Host

内容:

 

开机自动桥接 eth0

DHCP Server eth0 改用 br0

使用 cbq.init 限制 LAN User 的下载带宽

KVM on Fedora 9 操作备忘 (Bridge Mode)

开机自动桥接 eth0

 

yum install bridge-utils

 

vi /etc/sysconfig/network-scripts/ifcfg-br0

 

DEVICE=br0

TYPE=Bridge

BOOTPROTO=static

ONBOOT=yes

IPADDR=192.168.1.1

NETMASK=255.255.255.0

GATEWAY=192.168.1.254

 

vi /etc/sysconfig/network-scripts/ifcfg-eth0

 

DEVICE=eth0

HWADDR=xx:xx:xx:xx:xx:xx

ONBOOT=yes

BRIDGE=br0

 

DHCP Server eth0 改用 br0

 

vi /etc/sysconfig/dhcpd

 

DHCPDARGS=br0

 

使用 cbq.init 限制 LAN User 的下载带宽

 

iptables -t mangle -A FORWARD -o br0 -d 192.168.1.100 -j MARK --set-mark=10

 

vi /etc/sysconfig/cbq/cbq-0002.test

 

DEVICE=eth0,100Mbit,10Mbit

RATE=500Kbit

WEIGHT=50Kbit

PRIO=5

MARK=10

 

KVM on Fedora 9 操作备忘 (Bridge Mode)

 

yum install kvm qemu

 

modprobe kvm_amd

 

ln -s /usr/bin/qemu-kvm /usr/bin/kvm

 

vi /etc/qemu-ifup

 

#!/bin/sh

sudo /sbin/ifconfig $1 0.0.0.0 promisc up

sudo /usr/sbin/brctl addif br0 $1

 

vi /etc/qemu-ifdown

 

#!/bin/sh

echo Bye.

 

chmod +x /etc/qemu-if*

 

qemu-img create -f qcow2 f10.qcow2 10G

 

kvm -hda f10.qcow2 -cdrom /path/to/Fedora-10-i386-DVD.iso -boot d -m 256 -localtime -net nic -net tap,ifname=tap0 -vnc :1

 

转载自

http://cha.homeip.net/blog/archives/2009/04/fedora_kvm_brid.html#more

 

 

 

 

你可能感兴趣的:(linux,server,user,X86)