# FreeBSD 11.1 doesn't connect to (wireless) network in Hyper-V



## AAB (Oct 10, 2017)

I'm a FreeBSD noob. There I said it.

Connecting to the wireless network seems a little problematic and confusing when using Hyper-V. I've tried a few commands to try to ascertain what is happening:

`ifconfig wlan0 list scan`

Returns "interface does not exist"

`pciconf -lv | grep -B3 network | grep vendor`

Returns  "vendor = 'Digital Equipment Corporation'"

`ifconfig`

Returns information for interfaces de0 (hyper-v legacy interface), lo0 (standard loopback), and hn0 (hyper-v interface), but none of them have any real connectivity, although status is active for them.

I've also tinkered with the /etc/rc.conf, but the standard DHCP setup is not finding anything, and adding 
	
	



```
wlans_ath0="wlan0"
```
 following `ifconfig wlan0 create wlandevice ath0` doesn't help either.

It seems like FreeBSD needs to connect pseudo-directly to the wireless, which maybe requires some device loading (via `kldload` perhaps, or the existing driver that exists which seems to be ethernet only (no wireless) needs to be reconfigured somehow.

I don't recall precisely how hyper-v does the networking handoff, so I'm not certain what the next step would look like.

This image I'm using is not self-created, but pulled from https://download.freebsd.org/ftp/snapshots/VM-IMAGES/11.1-STABLE/i386/Latest/

I'm using a Win 2012 host.


----------



## SirDice (Oct 10, 2017)

Your network interfaces are virtualized, the guest doesn't 'see' a wireless connection, it just has a regular ethernet interface. You have to bind that interface to your wireless interface in Hyper-V itself.


----------



## AAB (Oct 10, 2017)

I appreciate the answer, but in Hyper-V the server instance is already set to bind to Wireless. I've created both legacy and network adapters in the hyper-v management interface for the VM Client, which is running FreeBSD 11.1 . Those adapters are set to bind to that wireless connection that the server is offering. And from my fairly regular use of hyper-v, it doesn't seem like the issue would be in the hyper-v itself, unless Hyper-v and FreeBSD are not compatible on some level, but the Microsoft documentation on the subject seems to imply there isn't an issue. Of course, the MS documentation is not very granular, IMHO.

Occasionally, you can have issues with more than one network adapter hogging the connection. However, no other VMs are running, and I generally expect at least one of the adapters to be good.


----------



## aragats (Oct 10, 2017)

AAB said:


> Hyper-V the server instance is already set to bind to Wireless


That's fine, just configure your _*hn0*_ interface. There cannot be _*wlan0*_ or _*ath0*_ in FreeBSD in your configuration.


----------



## AAB (Oct 12, 2017)

Is there some configuration step I'm missing? It seems to me that this should be working as is, but I'm still not getting an IPv4 address.


----------



## SirDice (Oct 12, 2017)

Post the output of `ifconfig`.


----------



## AAB (Oct 12, 2017)

It looks like this, but without the hardware and IP6 addresses blacked out.


----------



## SirDice (Oct 12, 2017)

It looks like you tried a few things. Verify the VM's configuration in Hyper-V and make sure it only have one interface and that interface is bound to the correct physical interface of the host.


----------



## AAB (Oct 13, 2017)

I removed the legacy network adapter. That's kind of a last ditch effort fall back anyway.





After starting back up:





This is present config now, but no connectivity out, although my host wireless is there and connected.


----------



## SirDice (Oct 13, 2017)

Well, it's doing something, your hn(4) interface now has an IP address. Now you need to configure the host to allow that traffic, enable NAT if needed, and generally make sure things are routed correctly. But that's all on the host side of things.


----------



## AAB (Oct 13, 2017)

AAB said:


> I removed the legacy network adapter. That's kind of a last ditch effort fall back anyway.
> 
> View attachment 4051
> 
> ...



I'll take that back. Switching locations, the wireless connectivity is better. And having removed the other network config, I seem to be able to traceroute fine to source. I have to check a couple more things to be sure it's all good.


----------

