steve@eva00::~> cat /etc/ifconfig.wi0 inet 192.168.1.1 up media DS11 mediaopt adhoc nwid g3_bridge !wiconfig wi0 -c 1 !wiconfig wi0 -p 1wiconfig wi0 -c 1 causes the airport card to create IBSS, so other wireless devices can see it. -p 1 causes the card to enter into BSS mode. Now this isn't strictly correct, but some how it magically works. If you know why, feel free to let me know! :-)
steve@eva00::~> cat /etc/ifconfig.gem0 inet 192.168.0.4 up netmask 255.255.255.0 media 100BaseTXRouting and NAT setup Routing and NAT under netbsd is fairly well documented, so I am just going to be brief:
usage: arp -s hostname ether_addr [temp] [pub]is used to map a hostname (IP) to an ether_addr (MAC), and if the pub keyword is present, it will be published, and the server will act as an ARP server for that host. Now 192.168.1.0/24 has 256 hosts, and doing 256 such commands is a pain. Thankfully arp -f allows us to specify a file containing lines with the same syntax as above, to add entry to the ARP table. But this still requires a file containing 256 lines. Bummer. Its at this point the legendary laziness of geeks prevails, and arp-deny is thus born. This simply program reads in a file containing trusted hosts' IP and MAC address, and generates output suitable for use with arp. I wrote a simple script to re-create the table, so I can easily add new hosts:
root@eva00::~> cat /usr/pkg/etc/rc.d/arp-deny.sh #!/bin/sh # clear the table /usr/sbin/arp -d -a # re-generate the arp-deny list /root/arp-deny/arp-deny 192.168.1. 00:00:00:00:00:00 /etc/arp-allowed > /etc/arp-deny # re-populate it /usr/sbin/arp -f /etc/arp-deny > /dev/null 2>&1Yet another get-it-working-asap hack :-) For reference, here is my /etc/arp-allowed file:
root@eva00::~> cat /etc/arp-allowed 192.168.1.1 00:30:65:09:73:ec 192.168.1.2 00:0d:93:eb:01:11 192.168.1.13 00:80:c8:07:3f:f9Values has of course been censored :-) To add a new host, simple do
echo IP MAC >> /etc/arp-allowed && /usr/pkg/etc/rc.d/arp-deny.shEasy as pie :) Notes This really calls for a bridge, but for some reason I could not get a wireless/lan bridge working, so the router option was taken. If you can create a bridge, then by all means, do it. Ignore this method completely. With the above configuration, in order for your lan (192.168.0.0/24) clients to access their wireless (192.168.1.0/24) siblings, you need to add a static route, either on the machines or on your router, so that they use our router (192.168.0.4) as the gateway when attempting such communication events. MAC filter is also rather weak. Its strongly encouraged that you read up on WEP and enable it. Hope this was helpful :-) Cheers, Steve
Subscribe to
Posts [Atom]