[SATLUG] kvm networking

Bruce Dubbs bruce.dubbs at gmail.com
Mon Jan 23 22:42:18 CST 2012


David Kowis wrote:
> On 01/23/2012 05:04 PM, Bruce Dubbs wrote:
>> #route -n Kernel IP routing table Destination     Gateway
>> Genmask         Flags Metric Ref Use Iface 0.0.0.0
>> 192.168.0.1  0.0.0.0         UG    0      0   0   eth0 10.0.2.15
>> 0.0.0.0      255.255.255.255 UH    0      0   0   tap0 192.168.0.0
>> 0.0.0.0      255.255.255.0   U     0      0   0   eth0
> 
>> And the following on the client:
> 
>> 192.168.0.22    0.0.0.0      255.255.255.255 UH    0      0   0
>> tap0
> 
> Did you set your host as the default gateway on the client? I suspect
> that packets are getting to your client, but not to your host.
> 
> Mentioned here:
> http://www.linux-kvm.org/page/Networking#iptables.2Frouting
> 
> Clientside v2: Since your guest VM is not on the same subnet as your
> host you have to add host, and then set the default gateway.
> 
> Hrm, wait, I'm assuming that your hosts' box is 192.168.0.22? Then
> you've probably already got a route to the host. But you said that the
> client has a gateway of 10.0.2.2. Try setting that to the IP of your
> host box?

Yes, the host is 192.168.0.22.  From what I've been reading, I need to 
set up a bridge, br0, and assign the client gw to that.  I think I have 
to set up a bridge in both the host and the client.

For right now, I don't think I should need any iptables masquerading 
rules.  If I can just get host <--> client talking directly to each 
other, then I think I know how to do the rest.

For setting the client up on the internet as a client, kvm is quite 
easy.  The hard part seems to be setting it up as a server (as in sshd).

> After this stuff, I'd check on tcpdump to see if packets are getting
> one way but not the other. Just to make sure.

Good idea.

   -- Bruce


More information about the SATLUG mailing list