Skip to content

Using iohyve over WiFi

pr1ntf edited this page May 20, 2016 · 2 revisions

###DON'T JUST COPY AND PASTE MY CONFIGURATIONS AND EXPECT THEM TO WORK ###Learn what they are doing, and why.

/etc/rc.conf

iohyve_enable="YES"
iohyve_flags="kmod=1"

cloned_interfaces="bridge0 tap0"
ifconfig_bridge0="addm wlan0 10.10.123.1/24 up addm tap0"

gateway_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="yes"

Note the lack of net=wlan0 in iohyve_flags. We set up the hardcoded bridge0 in cloned_interfaces. Also note we give the bridge a Gateway IP of 10.10.123.1 with a Netmask of /24 (255.255.255.0).

/etc/pf.conf

pub="192.168.XXX.XXX"
hyve_net="10.10.123.00/24"
hyve_fbsd="10.10.123.10"
hyve_win="10.10.123.11"
if="wlan0"
  
set block-policy return
set skip on lo
scrub in
  
# NAT
nat on $if from $hyve_fbsd to !$hyve_net -> $pub
nat on $if from $hyve_win to !$hyve_net -> $pub
  
# default
pass out on $if from $pub to any
block in log on $if