[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:4C:0C:24
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
BRIDGE="br0"
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
重启network服务
[root@localhost ~]# service network restart
正在关闭接口 br0: [确定]
正在关闭接口 eth0: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: [确定]
弹出界面 br0:
正在决定 br0 的 IP 信息...完成。 [确定]
确认IP地址信息
[root@localhost ~]# ifconfig
br0 Link encap:Ethernet HWaddr 00:0C:29:4C:0C:24
inet addr:192.168.0.106 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe4c:c24/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:70 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:69660 (68.0 KiB) TX bytes:3066 (2.9 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:4C:0C:24
inet6 addr: fe80::20c:29ff:fe4c:c24/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28413 errors:0 dropped:0 overruns:0 frame:0
TX packets:20243 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37239885 (35.5 MiB) TX bytes:1683986 (1.6 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:140 errors:0 dropped:0 overruns:0 frame:0
TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12096 (11.8 KiB) TX bytes:12096 (11.8 KiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:0B:01:73
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
出现以上信息,说明网卡桥接成功了
3、KVM管理
[root@localhost ~]# virt-manager
virt-manager是基于libvirt的图像化虚拟机管理软件。请注意,不同的发行版上virt-manager的版本可能不同,图形界面和操作方法可能不同。本文使用了Centos 6企业版。创建KVM虚拟机最简单的方法是通过virt-manager接口。从控制台窗口启动这个工具,以root身份输入virt-manager命令
虚拟机管理界面
虚拟机管理步骤如下