Configuring the NIC
cd/etc/sysconfig/network-scripts/
CP Ifcfg-eth0 IFCFG-BR0
Edit eth0 and Br0 separately
ifcfg-eth0 changed to the following:
Device=eth0
hwaddr=00:0c:29:55:a7:0a
Type=ethernet
Uuid=2be47d79-2a68-4b65-a9ce-6a2df93759c6
Onboot=yes
Nm_controlled=yes
bootproto=None
Bridge=br0
ifcfg-br0 changed to the following:
device=br0
# hwaddr=00:0c:29:55:a7:0a
Type=Bridge
# Uuid=2be47d79-2a68-4b65-a9ce-6a2df93759c6
Onboot=yes
Nm_controlled=yes
Bootproto=static
ipaddr=192.168.11.17
netmask=255.255.255.0
gateway=192.168.11.1
dns1=202.106.0.20
Description: My virtual machine is a bridge mode, so set BR0 IP and my real machine the same network segment, including the gateway is also my router's IP, we can be configured according to their own environment, the purpose is to let the virtual machine can surf the Internet.
/etc/init.d/network restart
Check the network card as follows:
Br0 Link encap:ethernet HWaddr 00:0c:29:55:a7:0a
inet addr:192.168.11.17 bcast:192.168.11.255 mask:255.255.255.0
Inet6 ADDR:FE80::20C:29FF:FE55:A70A/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:141326 errors:0 dropped:0 overruns:0 frame:0
TX packets:90931 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:456024940 (434.8 MiB) TX bytes:10933593 (10.4 MiB)
Eth0 Link encap:ethernet HWaddr 00:0c:29:55:a7:0a
Inet6 ADDR:FE80::20C:29FF:FE55:A70A/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:341978 errors:0 dropped:0 overruns:0 frame:0
TX packets:90946 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:468848861 (447.1 MiB) TX bytes:10934699 (10.4 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: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)
Virbr0 Link encap:ethernet HWaddr 52:54:00:14:ef:d5
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)
1.4-Installing the KVM module Configuration network