0

I have a Centos 6 KVM host. I installed the KVM following this manual:

https://wiki.centos.org/HowTos/KVM

Its network has been configured as a bridge:

[root@server ~]# ifconfig
br0       Link encap:Ethernet  HWaddr 6C:3B:E5:B2:EB:6C  
          inet addr:46.165.249.25  Bcast:46.165.249.31  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:254174 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213352 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:615737501 (587.2 MiB)  TX bytes:16748545 (15.9 MiB)

eth0      Link encap:Ethernet  HWaddr 6C:3B:E5:B2:EB:6C  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:437599 errors:0 dropped:0 overruns:0 frame:0
          TX packets:214143 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:631436193 (602.1 MiB)  TX bytes:16829508 (16.0 MiB)
          Memory:f7c00000-f7cfffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:5018 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5018 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1845511 (1.7 MiB)  TX bytes:1845511 (1.7 MiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:87:43:E3  
          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)

vnet0     Link encap:Ethernet  HWaddr FE:54:00:AA:CB:1E  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1742 errors:0 dropped:0 overruns:187 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:3812 (3.7 KiB)  TX bytes:119656 (116.8 KiB)

and routed like:

[root@server ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
46.165.249.0    0.0.0.0         255.255.255.224 U     0      0        0 br0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
169.254.0.0     0.0.0.0         255.255.0.0     U     1009   0        0 br0
0.0.0.0         46.165.249.30   0.0.0.0         UG    0      0        0 br0

and ip a

[root@server ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 6c:3b:e5:b2:eb:6c brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 6c:3b:e5:b2:eb:6d brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 6c:3b:e5:b2:eb:6e brd ff:ff:ff:ff:ff:ff
5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 6c:3b:e5:b2:eb:6f brd ff:ff:ff:ff:ff:ff
6: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 52:54:00:87:43:e3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
    link/ether 52:54:00:87:43:e3 brd ff:ff:ff:ff:ff:ff
9: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 6c:3b:e5:b2:eb:6c brd ff:ff:ff:ff:ff:ff
    inet 46.165.249.25/27 brd 46.165.249.31 scope global br0
12: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether fe:54:00:aa:cb:1e brd ff:ff:ff:ff:ff:ff

and I created a Ubuntu 14.04 VM and its network is like this: enter image description here

but it can't get access to the gateway: enter image description here what is wrong with my configuration!?!?!?

br0 bridge file:

#nano /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
BOOTPROTO="static"
DNS1="37.58.58.137"
DNS2="91.109.25.225"
GATEWAY="46.165.249.30"
HOSTNAME="localhost.localdomain"
IPADDR="46.165.249.25"
IPV6INIT="no"
MTU="1500"
NETMASK="255.255.255.224"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Bridge"
DELAY=0

eth0 file:

#nano /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
BOOTPROTO="static"
DNS1="37.58.58.137"
DNS2="91.109.25.225"
GATEWAY="46.165.249.30"
HOSTNAME="localhost.localdomain"
HWADDR="6C:3B:E5:B2:EB:6C"
IPADDR="46.165.249.25"
IPV6INIT="no"
MTU="1500"
NETMASK="255.255.255.224"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="1c33f9f6-36ae-45c7-82a1-1bd3bb8d2d32"
BOOTPROTO="none"
BRIDGE=br0

eth1 file:

#nano /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
BOOTPROTO="dhcp"
DHCP_HOSTNAME="localhost.localdomain"
HWADDR="6C:3B:E5:B2:EB:6D"
NM_CONTROLLED="yes"
ONBOOT="no"
TYPE="Ethernet"
UUID="646064b0-b8e7-4476-82fc-01026c0c962f"
  • What does /etc/network/interfaces look like on the host machine? – Donnied Sep 17 '15 at 11:49
  • @Donnied because of this is not a ubuntu os its networking is a bit different.i just added some network files to the post – peiman F. Sep 17 '15 at 12:06
  • What is the gateway IP you gave Ubuntu? – 0xSheepdog Sep 17 '15 at 13:04
  • @0xSheepdog its 91.109.28.254 – peiman F. Sep 17 '15 at 15:54
  • 1
    I believe your gateway must be on the same broadcast domain as your VM. You should try the gateway as 192.168.122.1 – 0xSheepdog Sep 17 '15 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.