Solved

CentOS KVM Client Networking Setup

Posted on 2014-02-23
8
753 Views
Last Modified: 2014-03-03
I need some help setting up networking to a KVM Client machine.

I have a laptop with 16GB of RAM, On which CentOS 6.5 is installed, I am accessing the internet via my Wifi. My "wlan0" attributes are (There is no ifcfg-wlan0 in my /etc/sysconfig/network-scripts/ )

wlan0     Link encap:Ethernet  HWaddr 00:25:9C:F4:BB:40  
          inet addr:192.168.1.120  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::225:9cff:fef4:bb40/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3320703 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1811549 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4755265211 (4.4 GiB)  TX bytes:189692669 (180.9 MiB)

i have installed KVM and configured a virtual network "virbr0", which is a default virtual network in KVM.Here is the info
Network : 192.168.122.0/24
DHCP start : 192.168.122.2
DHCP end : 192.168.122.254

#ifconfig on the server shows
virbr0    Link encap:Ethernet  HWaddr 52:54:00:91:1E:AE  
          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:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2030 (1.9 KiB)  TX bytes:1818 (1.7 KiB)


Now I have installed a CentOS KVM virtual machine(Client), I dont have any networking configured so how do configure networking on this client so that I can access internet.

THank you
0
Comment
Question by:aanya247
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 25

Accepted Solution

by:
Zephyr ICT earned 500 total points
ID: 39881798
Is your VM getting a DHCP address from the virbr0? Is your nic enabled on this VM (eg: if you check the ifcfg-eth0 on the VM, does it show as BOOTPROTO=dhcp and ONBOOT=yes)?

Do you want your VM's to be on the same network as your host or?? ...

In any case, most of the time WLAN will not work with bridging, the adapters (most if not all) do not support it.

So if you want your VM to be on the same network as your host you'll need to create a bridge, but you'll need to use eth0 or similar for it ... There's a "workaround" that "might" work explained here ("Alternative setup (might not work, but it's brilliant)") , if you insist on using WLAN... It routes the traffic from a virtual network adapter to eth(x).
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39881815
Most important,, network adapter should be bridged with host adapter so it can connect to outer world.

TY/SA
0
 

Author Comment

by:aanya247
ID: 39884759
My VM is getting the DHCP address and I don't want my VM to be on the same network as my host. Since my laptop is connected to my router and accessing the outside network looks like even if I create a bridge between wlan0 and virbr0, Will this work...So that way my VM can access external network via the bridge, wlan0.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 13

Expert Comment

by:Sandy
ID: 39884846
Agree.
0
 

Author Comment

by:aanya247
ID: 39884852
Ok let me try it
0
 
LVL 88

Expert Comment

by:rindi
ID: 39885058
If you don't want the VM to be on the same network segment as your host, select NAT under the NIC in the VM's properties. Also make sure you select a "Device Model" NIC that the VM is most likely to have a driver for, for example rtl8139 is common.
0
 

Author Comment

by:aanya247
ID: 39893993
For some reason the bridge didn't work
0
 
LVL 25

Assisted Solution

by:Zephyr ICT
Zephyr ICT earned 500 total points
ID: 39897115
Are you trying to bridge a Wireless NIC? As I said, this doesn't work with most Wifi cards ... You'll have to use a package called parprouted ...

More info: http://yalb.blogspot.be/2012/04/wireless-bridging-for-kvm.html
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to update  and reset admin password for Linux 5 65
fedora linux on laptop - setup sendmail - or some kind of email 5 54
linux 13 75
Samba Question 11 73
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question