LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-18-2010, 05:22 AM   #1
eyemole80
Member
 
Registered: Jun 2004
Distribution: Fedora Core 1
Posts: 47
Blog Entries: 1

Rep: Reputation: 16
KVM networking


HI Friends,
I am trying to setup a hardware virtual machine on my Dell Laptop having wireless network card in it. I know there is no bridging support in wireless card, so I am using the routing techniques but thats not working.
I do not want to use "net user" mode of working as it is slow. So I am trying only TUN/TAP mode of netwroking.

Scenario is:
Laptop is running Fedora-12 X64
Laptop is connected with internet using WIFI card. WIFI IPADDR = 192.168.1.64/24 (DHCP). Default GW = 192.168.1.254
Created a tap interface "tap0" and gave it IPADDR = 192.168.100.50/24 (static IP)
Enabled IPV4 forwarding in kernel.

Launched the VM machine (Suse Linux). Gave it a static IP = 192.168.100.20/24, default route set to = 192.168.100.50

Now VM can ping to 192.168.100.50 and 192.168.1.64 , but it cannot ping to 192.168.1.254 or any other internet IP.

Error while trying to ping 192.168.1.254 is :
dst host unreacheble , error code 10

PS: I am able to ping any other internet IP from Host machine (i.e. Fedora-12)

Could someone suggest , where things are wrong?
 
Old 02-18-2010, 06:32 AM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Probably the packets flow OK from your VM to your GW = 192.168.1.254. But does your gateway know how to reach your VM? Probably not.

Instead of configuring your gateway, you could set up IP Masquerading in your host firewall.
 
1 members found this post helpful.
Old 02-18-2010, 06:51 AM   #3
eyemole80
Member
 
Registered: Jun 2004
Distribution: Fedora Core 1
Posts: 47

Original Poster
Blog Entries: 1

Rep: Reputation: 16
oops . you are right , I forgot the very basic thing.

Okay one more doubt . Proxy ARP can also be used in this scenario.

So what would be appropriate (more in terms of speed), using Proxy ARP or IP Masq ?
 
Old 02-18-2010, 06:55 AM   #4
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by eyemole80 View Post
So what would be appropriate (more in terms of speed), using Proxy ARP or IP Masq ?
Don't know, because I don't know about proxy-arp.

I've been using both bridged and routed (and NATed) networking with QEMU/KVM, and I like bridging the most - the easier to implement, once you understand how it works. But that's my opinion, of course.
 
Old 02-18-2010, 09:51 AM   #5
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
You almost got it. You need both tuntap AND brctl to bridge the host's wireless interface with the KVM guest's tap interface. If I remember correctly, tap interfaces are also built into qemu and qemu-kvm if you don't want to use tuntap.

Start up the host bridge:
Code:
      ip addr flush wlan0
      ifconfig wlan0 0.0.0.0

      brctl addbr br0
      brctl stp br0 off
      brctl setfd br0 1
      brctl sethello br0 1
      brctl addif br0 wlan0

      tunctl -t tap0 -u kvm
      ifconfig tap0 0.0.0.0

      brctl addif br0 tap0

      dhclient br0
Shut down the host bridge:
Code:
      brctl delif br0 tap0
      tunctl -d tap0

      brctl delif br0 wlan0
      ip addr flush br0
      ifconfig br0 down
      brctl delbr br0

      ifconfig wlan0 0.0.0.0

      dhclient wlan0
You can replace the "-u kvm" with your system's KVM username and use dhcpcd instead of dhclient.

YMMV!
 
Old 02-18-2010, 10:02 AM   #6
eyemole80
Member
 
Registered: Jun 2004
Distribution: Fedora Core 1
Posts: 47

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Thanks Chucks,
But I cannot use bridging in wireless card as it is not supported in my wireless card. I have to use other methods only.
 
Old 02-18-2010, 10:25 AM   #7
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Quote:
Originally Posted by eyemole80 View Post
Thanks Chucks,
But I cannot use bridging in wireless card as it is not supported in my wireless card. I have to use other methods only.
Is brctl installed on your system? I don't think it cares what wireless or ethernet card you have.
 
  


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 networking: Firewall blocks traffic between guests on private network kenneho Linux - Virtualization and Cloud 6 12-21-2010 02:51 PM
KVM, and Dos. Networking possible? Gangrif Linux - Virtualization and Cloud 7 02-12-2010 02:32 AM
kvm networking with a wireless dhcp host extendedping Linux - Virtualization and Cloud 7 11-23-2009 04:29 AM
Loading kvm-intel module for qemu-kvm 0.11.0 alkos333 Slackware 6 11-13-2009 10:01 PM
KVM-85 and using SlackBuilds kvm (83) script Chuck56 Slackware 2 04-22-2009 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:18 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