Solved

CentOS KVM Client Networking Setup

Posted on 2014-02-23
8
762 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
Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

679 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