Re: How should vmm hosts access the internet?

2016-10-13 Thread Dimitris Papastamos
On Thu, Oct 13, 2016 at 05:16:05PM +0200, Reyk Floeter wrote:
> > Am 13.10.2016 um 16:18 schrieb Dimitris Papastamos :
> >
> >> On Thu, Oct 13, 2016 at 03:43:54PM +0200, Stefan Sperling wrote:
> >>> On Thu, Oct 13, 2016 at 02:23:20PM +0100, Edd Barrett wrote:
> >>> Hi,
> >>>
> >>> Since vmm is now enabled, I thought I would have a play.
> >>>
> >>> So far so good, but I've not managed to get the host on the internet
> >>> yet.
> >>>
> >>> If I set up a vmm VM on my laptop, we have on the host:
> >>>
> >>> * iwn0 providing internet access to the host
> >>> * tap0 connected to vio0 in the guest.
> >>>
> >>> What is the reccommended way to give the guest internet access via iwn0?
> >>>
> >>> I thought I could bridge the interfaces using bridge(4), but it seems I
> >>> am wrong. (I have a vague recollection that a bridge involving a
> >>> wireless interface doesn't do as one might expect, but I don't recall
> >>> the exact details).
> >>>
> >>> (I also tried routing between the two interfaces, using static addresses
> >>> for tap0 and vio0, then adding a default route in the guest and a static
> >>> route in the host. I was able to ping between the host and guest via
> >>> tap, but I couldn't ping between subnets.)
> >>>
> >>> (Yep, I have net.inet.ip.forwarding=1).
> >>
> >> Use NAT.
> >>
> >> Bridging over wifi does not work (limitation of the ieee802.11 standard).
> >
> > Just hijacking the thread for a moment, I tried vmm yesterday in
> > bridge mode with em(4).  Everything works fine except dhcp.  I cannot use
> > dhclient to get an address from within the vm.  IPv6 SLAAC works though
> > as well as setting IPv4 addresses manually.
> >
> > Any ideas?
> >
> 
> Do you run dhclient on the host as well (on em0)?

Yes I do.

> It is a known problem that dhclient "steals" dhcp packets from the stack with
> its bpf drop filter.
> 
> For laptop or mobile hosts, I suggest to use NAT and dhcpd on a vether0 in the
> same bridge as the taps.

Thanks, will try that!



Re: How should vmm hosts access the internet?

2016-10-13 Thread Reyk Floeter
> Am 13.10.2016 um 16:18 schrieb Dimitris Papastamos :
>
>> On Thu, Oct 13, 2016 at 03:43:54PM +0200, Stefan Sperling wrote:
>>> On Thu, Oct 13, 2016 at 02:23:20PM +0100, Edd Barrett wrote:
>>> Hi,
>>>
>>> Since vmm is now enabled, I thought I would have a play.
>>>
>>> So far so good, but I've not managed to get the host on the internet
>>> yet.
>>>
>>> If I set up a vmm VM on my laptop, we have on the host:
>>>
>>> * iwn0 providing internet access to the host
>>> * tap0 connected to vio0 in the guest.
>>>
>>> What is the reccommended way to give the guest internet access via iwn0?
>>>
>>> I thought I could bridge the interfaces using bridge(4), but it seems I
>>> am wrong. (I have a vague recollection that a bridge involving a
>>> wireless interface doesn't do as one might expect, but I don't recall
>>> the exact details).
>>>
>>> (I also tried routing between the two interfaces, using static addresses
>>> for tap0 and vio0, then adding a default route in the guest and a static
>>> route in the host. I was able to ping between the host and guest via
>>> tap, but I couldn't ping between subnets.)
>>>
>>> (Yep, I have net.inet.ip.forwarding=1).
>>
>> Use NAT.
>>
>> Bridging over wifi does not work (limitation of the ieee802.11 standard).
>
> Just hijacking the thread for a moment, I tried vmm yesterday in
> bridge mode with em(4).  Everything works fine except dhcp.  I cannot use
> dhclient to get an address from within the vm.  IPv6 SLAAC works though
> as well as setting IPv4 addresses manually.
>
> Any ideas?
>

Do you run dhclient on the host as well (on em0)?

It is a known problem that dhclient "steals" dhcp packets from the stack with
its bpf drop filter.

For laptop or mobile hosts, I suggest to use NAT and dhcpd on a vether0 in the
same bridge as the taps.

Reyk



Re: How should vmm hosts access the internet?

2016-10-13 Thread Dimitris Papastamos
On Thu, Oct 13, 2016 at 03:43:54PM +0200, Stefan Sperling wrote:
> On Thu, Oct 13, 2016 at 02:23:20PM +0100, Edd Barrett wrote:
> > Hi,
> > 
> > Since vmm is now enabled, I thought I would have a play.
> > 
> > So far so good, but I've not managed to get the host on the internet
> > yet.
> > 
> > If I set up a vmm VM on my laptop, we have on the host:
> > 
> >  * iwn0 providing internet access to the host
> >  * tap0 connected to vio0 in the guest.
> > 
> > What is the reccommended way to give the guest internet access via iwn0?
> > 
> > I thought I could bridge the interfaces using bridge(4), but it seems I
> > am wrong. (I have a vague recollection that a bridge involving a
> > wireless interface doesn't do as one might expect, but I don't recall
> > the exact details).
> > 
> > (I also tried routing between the two interfaces, using static addresses
> > for tap0 and vio0, then adding a default route in the guest and a static
> > route in the host. I was able to ping between the host and guest via
> > tap, but I couldn't ping between subnets.)
> > 
> > (Yep, I have net.inet.ip.forwarding=1).
> 
> Use NAT.
> 
> Bridging over wifi does not work (limitation of the ieee802.11 standard).

Just hijacking the thread for a moment, I tried vmm yesterday in
bridge mode with em(4).  Everything works fine except dhcp.  I cannot use
dhclient to get an address from within the vm.  IPv6 SLAAC works though
as well as setting IPv4 addresses manually.

Any ideas?



Re: How should vmm hosts access the internet?

2016-10-13 Thread Stefan Sperling
On Thu, Oct 13, 2016 at 02:23:20PM +0100, Edd Barrett wrote:
> Hi,
> 
> Since vmm is now enabled, I thought I would have a play.
> 
> So far so good, but I've not managed to get the host on the internet
> yet.
> 
> If I set up a vmm VM on my laptop, we have on the host:
> 
>  * iwn0 providing internet access to the host
>  * tap0 connected to vio0 in the guest.
> 
> What is the reccommended way to give the guest internet access via iwn0?
> 
> I thought I could bridge the interfaces using bridge(4), but it seems I
> am wrong. (I have a vague recollection that a bridge involving a
> wireless interface doesn't do as one might expect, but I don't recall
> the exact details).
> 
> (I also tried routing between the two interfaces, using static addresses
> for tap0 and vio0, then adding a default route in the guest and a static
> route in the host. I was able to ping between the host and guest via
> tap, but I couldn't ping between subnets.)
> 
> (Yep, I have net.inet.ip.forwarding=1).

Use NAT.

Bridging over wifi does not work (limitation of the ieee802.11 standard).