LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 08-20-2013, 07:57 PM   #1
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Rep: Reputation: Disabled
CentOS 6 - KVM - Physical host losing network connectivity after Bridge configuration


Hello,

This is my first post on this forum and am looking forward to hear from the experts!
I am trying to setup my environment for the RHCSA exam. I have just installed CentOS 6 with KVM configured. I need my virtual machines (guest operating systems) to be accessible to the external network due to which I am trying to setup a bridge to eth0.

As soon as I setup the bridge (which i did by first copying the eth0 to a br0 in network-scripts, and then adding the static IP, gateway, etc in the br0 file and removing the same from the eth0 file, NM_CONTROLLED=no), I lose connectivity from my physical host to the DNS server and hence am not able to ping www.google.com. I am trying to fix this issue before going ahead and configuring virtual machines and running into more problems, since I would eventually need the physical host to be available externally.

Please let me know if you need any more info.

Thanks
 
Old 08-21-2013, 01:01 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 846

Rep: Reputation: 91
paste the config files for the network please
 
Old 08-21-2013, 01:04 PM   #3
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Dyasny, thank you for replying. Below are my config files, please let me know if you need any more info:

ifcfg-eth0:

DEVICE="eth0"
ONBOOT="yes"
NM_CONTROLLED=no
TYPE="Ethernet"
BOOTPROTO=none
HWADDR=00:1E:C9:3D:2A:0E
NAME="System eth0"
BRIDGE="br0"

ifcfg-br0:

DEVICE="br0"
ONBOOT="yes"
NM_CONTROLLED=no
TYPE="Bridge"
BOOTPROTO=none
IPADDR="10.x.x.18"
NETMASK="255.255.254.0"
GATEWAY="10.0.38.1"
DNS1=10.0.0.10
DELAY=0


[root@localhost ~]# ifconfig
br0 Link encap:Ethernet HWaddr 00:1E:C9:3D:2A:0E
inet addr:10.x.x.18 Bcast:10.0.39.255 Mask:255.255.254.0
inet6 addr: fec0::229:21e:c9ff:fe3d:2a0e/64 Scope:Site
inet6 addr: fe80::21e:c9ff:fe3d:2a0e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1049837 errors:0 dropped:0 overruns:0 frame:0
TX packets:1508 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:51091121 (48.7 MiB) TX bytes:117628 (114.8 KiB)

eth0 Link encap:Ethernet HWaddr 00:1E:C9:3D:2A:0E
inet6 addr: fe80::21e:c9ff:fe3d:2a0e/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:1261095 errors:0 dropped:0 overruns:0 frame:0
TX packets:1505 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:91138821 (86.9 MiB) TX bytes:140912 (137.6 KiB)
Interrupt:16 Memory:f8000000-f8012800

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:16436 Metric:1
RX packets:2634 errors:0 dropped:0 overruns:0 frame:0
TX packets:2634 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:260344 (254.2 KiB) TX bytes:260344 (254.2 KiB)

virbr1 Link encap:Ethernet HWaddr 4E:2C:84:BA:92D
inet addr:10.0.38.1 Bcast:10.0.38.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:6110 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:261366 (255.2 KiB)


resolv.conf:

# Generated by NetworkManager


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 10.0.0.10
 
Old 08-21-2013, 04:32 PM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 846

Rep: Reputation: 91
start the VM up and then show ifconfig -a and brctl show
virsh dumpxml VMNAME will also help
 
Old 08-21-2013, 06:00 PM   #5
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hey dyasny,

I haven't created a virtual machine. I have just installed Centos 6, and configured eth0 to a bridge br0 after which I lost network connectivity to the physical centos 6 host itself. I thought I should first resolve this first before going ahead and configuring virtual machines.
the ifconfig -a is as mentioned above and the brctl on the physical host shows,

[root@localhost ~]# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001ec93d2a0e no eth0
virbr1 8000.000000000000 yes
 
Old 08-21-2013, 10:33 PM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 846

Rep: Reputation: 91
are you able to ping the DNS server? what happens if you run dig directly against it?
 
Old 08-22-2013, 02:31 PM   #7
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Nope , i am no longer able to ping the DNS server. I was able to ping it before creating a bridge from eth0 to br0 though
 
Old 08-22-2013, 09:05 PM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 846

Rep: Reputation: 91
Just looking at:

NETMASK="255.255.254.0"
GATEWAY="10.0.38.1"
DNS1=10.0.0.10


If DNS is 10.0.0.10 your IP address should be between 10.0.0.1 - 10.0.1.254. The gateway 10.0.38.1 is not there, and you removed the actual IP. Might be a simple subnetting issue there
 
Old 08-26-2013, 09:15 PM   #9
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
I reinstalled CentOs on the physical host and it works fine now. Maybe some issue with the NIC.

Thanks
 
Old 10-24-2013, 07:36 PM   #10
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 6.5
Posts: 483

Rep: Reputation: 85
Is it working fine with the bridge enabled?

I also have a similar problem, i have configured bridges but the host has no connectivity, however when restarting the network service it is fine.

There is a bug in centos where restarting services changes the selinux user from system _u to unconfined.

When time permits, i will try and see if it is a config issue, or as i suspect, more related to selinux.

Right now i am not too bothered since vms work fine. No network access on the host is a problem that is sort convenient in my case at the moment . At least no worries about hacking into the host directly.
 
Old 10-27-2013, 05:41 PM   #11
gkulkarni
LQ Newbie
 
Registered: Aug 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Yes, it works fine with the bridge enabled. I never thought selinux would be a problem! I'll have a look at that though now you have mentioned it. Not sure why you don't have network access on the VMs (ideally the VMs should have network access as well)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu-kvm bridge connectivity similar to virtual box mlpa Slackware 14 10-20-2012 11:04 PM
KVM Guest network unable to connect to Host in CentOS-6.3 mglaris Linux - Virtualization and Cloud 5 10-05-2012 06:01 AM
Problem with libvirt and iptables on a CentOS 6 KVM physical host philx66 Linux - Virtualization and Cloud 1 10-03-2012 06:18 AM
Network issue KVM host centos michaelux Linux - Virtualization and Cloud 3 06-06-2010 12:51 AM
Network connectivity from Centos VM under XP host tulsi Linux - Newbie 7 08-22-2009 05:43 PM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration