LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2013, 06:26 PM   #1
manuce
Member
 
Registered: Nov 2012
Posts: 48

Rep: Reputation: Disabled
KVM guest unable to ping and access internet from the Physical host machine


Hello,

I just installed a Centos VM over a physical machine. here is my scenario.

Host machine name : Physical.example.com (CENTOS 6.3) 192.168.2.200 255.255.255.0 dns:192.168.2.200 ( iptable / selinux all off)

Guest machine name setup through KVM: server.example.com (CENTOS6.3)

When I was setting this guest vm over KVM I chose DHCP and everything worked fine ,I was able to ping Physical.example.com and was able to access the wifi lan on it

Until

I changed the IP to 192.168.2.201 on server.example.com
everthing is mess I am unable to ping the physical.example.com and unable to access the internet.

I have very very minimal knowledge of NATing and bridge so please explain me a little more or refer me to some docs or tutorial so that I know how to set the VM properly.


Ifconfig from Physical.example.com :


eth0 Link encap:Ethernet HWaddr 00:19:21:0A:52:89
inet addr:192.168.2.200 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:16

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:3495 errors:0 dropped:0 overruns:0 frame:0
TX packets:3495 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11025039 (10.5 MiB) TX bytes:11025039 (10.5 MiB)

virbr0 Link encap:Ethernet HWaddr 52:54:008:EA:F8
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:53 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4419 (4.3 KiB) TX bytes:3302 (3.2 KiB)

virbr1 Link encap:Ethernet HWaddr 52:54:00:6D:C65
inet addr:192.168.3.1 Bcast:192.168.3.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:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:3290 (3.2 KiB)

vnet0 Link encap:Ethernet HWaddr FE:54:00:41:5B:F9
inet6 addr: fe80::fc54:ff:fe41:5bf9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:5341 (5.2 KiB) TX bytes:5678 (5.5 KiB)

wlan0 Link encap:Ethernet HWaddr 00:1B:2F2:BB:13
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::21b:2fff:fed2:bb13/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:164 errors:0 dropped:0 overruns:0 frame:0
TX packets:71 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:34906 (34.0 KiB) TX bytes:10317 (10.0 KiB

Setting on the Guest VM Server.example.com (centos 6.3)

Virtual network interface :
Source device : Virtual network 'default':NAT
Device Model : Hypervisor default
MAC address :52:54:00:5e:c1:81

It work fine on this default setting as it acquire the ip from DHCP and get the ip from vbr0 of physical.example.com which is 192.168.122.X

but as soon as I change it to static ip of 192.168.2.201 it (server.example.com) is unable to ping the physical.example.com(192.168.2.200) and unable to access the internet.

Will be thankful for the help. Cheers-M

Last edited by manuce; 05-26-2013 at 06:29 PM.
 
Old 05-28-2013, 02:48 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
so you changed the IP from one that matched the connected internal bridge, to one that didn't at all, broke the basic concepts of TCP/IP routing and it didn't work? Funny that!

You'd reach the internet conventionally by using NAT networking, which the 122 subnet usually is, which will make all traffic from the VM appear to come from the box as a whole. If you want the VM to be on the same network range as the host, then you'd need to add a new bridge interface and add both the physical eth0 aand the VM virtual interface on to that. Last time I did this osrt of thing though, it was impossible to automatically configure through virt-manager, unlike conventional bridge nat networking.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KVM guest cannot access internet Neven1986 Linux - Networking 1 10-24-2012 06:21 PM
KVM Guest network unable to connect to Host in CentOS-6.3 mglaris Linux - Virtualization and Cloud 5 10-05-2012 05:01 AM
KVM guest cannot access host thehemi Linux - Virtualization and Cloud 8 03-28-2012 04:36 AM
Unable to ping the vm's from the host machine ragatinavin Linux - Networking 5 01-28-2012 10:38 PM
KVM Win XP guest can internet, can see smb on Slack 12.1 host "but can't find path" acummings Slackware 6 12-02-2008 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration