On 14 October 2016 at 00:38, Edd Barrett <e...@theunixzoo.co.uk> wrote:
> Hey,
>
> As we saw earlier on misc@, getting a vmm host on the internet when the
> host is using a wireless interface is not as straightforward as with
> wired interfaces.
>
> Specifically, a bridge won't work on a wireless interface, which in turn (I
> think) means virtual switches don't work either (although I did not try
> that).
>
> Some mentioned that it's possible to use a nat with a vether bridge.
>
> Striving for a simpler working setup, after some thinking, and a
> discussion with mlarkin@, I decided to find out:
>
>  1) If you really need the vether interface in the equation.
>  2) If you could use dhcpd on the tap interface of a vm.
>
> Mike asked me to write to tech@ reporting the outcome of 2.
>
> Starting with 1, if all you want is to get a VM on the internet, you
> don't need a vether.
>
> On the host:
> ---8<---
> # ifconfig tap0 192.168.10.1
> # echo "pass out on iwn0 inet from tap0:network to any nat-to (iwn0)" >> 
> /etc/pf.conf
> # pfctl -f /etc/pf.conf
> # sysctl net.inet.ip.forwarding=1
> --->8---
>
> On the guest:
>
> ---8<---
> # ifconfig vio 192.168.10.2
> # route add default 192.168.10.1
> --->8---
>
> (Or enter those parameters into the installer)
>
> And you are good to go. I managed to install a guest via this method.
>
> There are a couple of quirks though. First, you can't boot with that line in
> pf.conf, as pf comes up before vmd, so the tap interface will not exist as pf
> starts, causing pf to not parse its config file. Second, if you halt/reboot 
> the
> guest (I notice reboot actually halts), then the tap interface is deleted and
> the IP is lost. If you want to bring the host back up, you need to set the IP
> on the tap device again.
>

Just put a pair of parenthesis around "tap0:network" to indicate the dynamic
nature of your configuration.

Reply via email to