为KVM设置桥接网络

date: 2010-03-21 21:21:51
0.install the package bridge-utils
1 | yum install bridge-utils |
1.Stop the Ethernet device that you plan to create a bridge for using the ifdown command
1 | ifdown eth0 |
2.configure a bridge. Create the file /etc/sysconfig/network-scripts/ifcfg-br0
1 | vi /etc/sysconfig/network-scripts/ifcfg-br0 |
3.Modify /etc/sysconfig/network-scripts/ifcfg-eth0
1 | vi /etc/sysconfig/network-scripts/ifcfg-eth0 |
4.Restart the network and run ifconfig to check
1 | /etc/init.d/network restart |
5.Prepare the bridge for KVM
1 | # Add a script to connect your guest instance to the bridge on guest boot |
1 | # Silence a qemu warning by creating a noop qemu-ifdown script |
6.Start VM
1 | qemu-kvm -hda centos5x.img -m 512 |
- Title: 为KVM设置桥接网络
- Author: Micheal Chen
- Created at : 2010-03-21 21:21:51
- Updated at : 2025-03-22 21:00:48
- Link: https://www.xhis.com/hexo/2010/03/21/notes/为KVM设置桥接网络/
- License: This work is licensed under CC BY-NC-SA 4.0.