small updates on my OpenBSD 4.4 configuration

First, I googled on how to start daemons that are not part of the standard install. Surprisingly, it's not that hard. You only need to edit `/etc/rc.local'.

In my case, I wanted to run dnsmasq on boot, so I added the following in `/etc/rc.local'


if [ -x /usr/local/sbin/dnsmasq ]; then
echo -n ' dnsmasq'; /usr/local/sbin/dnsmasq
fi


Second, I noticed that `/etc/dhcpd.interfaces' no longer existed in OpenBSD 4.4 (this used to contain the interfaces you want your dhcp server to listen to). So, instead of using that file, I added the interface name as a flag in `dhcpd_flags`.

My `/etc/rc.conf.local' now contains this entry


dhcpd_flags="rum0"

Well this is it for now... these are just small details but I just want to note them down.

My home network config (for now)

I configured one of my old desktop as a home router with OpenBSD 4.4 installed. It still needs more polishing but roughly this is what I have,

1) Wired LAN with static IP addresses connected to my router-desktop's rl0 interface thru a switch with a 10.10.10.0/24 network address.

2) Wireless LAN interface with DHCP'd addresses coughed up by a USB rum0 interface with a 172.168.255.0/24 network address

3) Gateway interface (vr0) connected to my ADSL router, acquires IP thru DHCP. The ADSL router's IP adress is 192.168.1.1 sitting on a 192.168.1.0/24 network.

What I wanted to do with my setup was to simply allow all my LAN (wired/wireless) devices to say "hello world" to the internet using my ADSL router. To do this, I needed a way to do NAT (pf is an obvious choice for doing this) and also, I needed a way for my LAN to get send and receive DNS packets. For the DNS thingie, I opted to use dnsmasq because I think it is the easiest to configure.

here's my pf.conf


LAN_IF="rl0"
WLAN_IF="rum0"
EXT_IF="vr0"

TRANS_PROTO="{tcp, udp, icmp}"

table const {10.10.10.0/24, 172.168.255.0/24}

scrub in all

no nat on $EXT_IF proto $TRANS_PROTO from to
nat on $EXT_IF proto $TRANS_PROTO from to any -> ($EXT_IF)

block log all

pass quick log on lo0

pass out quick log on $LAN_IF inet proto udp from ($LAN_IF) port 53 to any \
port 53 keep state
pass out quick log on $WLAN_IF inet proto udp from ($WLAN_IF) port 53 to any \
port 53 keep state

pass in quick log on $LAN_IF inet proto $TRANS_PROTO from to any
pass out quick log on $LAN_IF inet proto $TRANS_PROTO from any to keep state

pass in quick log on $WLAN_IF inet proto $TRANS_PROTO from to any
pass out quick log on $WLAN_IF inet proto $TRANS_PROTO from any to keep state
pass out quick log on $EXT_IF inet proto $TRANS_PROTO all keep state


And, here's my dnsmasq.conf (actually, it contains more than that but they were commented out, I'm just showing the parts that I uncommented for brevity's sake)



interface=rl0
interface=rum0
except-interface=vr0
no-dhcp-interface=rl0
no-dhcp-interface=rum0


So basically that's it. With this setup, I can connect to the Internet from inside my LANs. Although, I still run dnsmasq manually. I still haven't figured out how to run it on bootup.

If by some freak of nature somebody else other than myself happen to read this post - I'm refering to YOU, obviously - and found something wrong with the setup, most specially the pf configuration. Please, by all means, feel free to comment on it. Because at this moment, I'm having my beer and I'm too tired to check my configurations again.

Making OpenBSD 4.4 detect a D-Link DWA-110 USB Wireless adapter

I previously posted something about how to make OpenBSD 4.3 detect a DWA-110 USB wireless adpater. Well, I upgraded my box to 4.4 but the code did not make it to that release. So, I had to do the same modifications for the rum driver code.

I guess I'll just have to wait for future releases to have a working/clean driver out of the box.