Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
BSD

Journal TheRaven64's Journal: Look! No Wires! 4

I am typing this from my new PowerBook, via 802.11b. A while ago, I bought a PCI 802.11b card from eBay, with the aim of doing something with it once I'd got a laptop. Today, I popped it in Slave (the FreeBSD box of mine that sits on the landing).

Configuring WiFi on FreeBSD was so trivial it barely rated a section in the handbook. First of all, I needed to load the bridging kernel module (since I had not compiled bridging into my kernel).

# kldload bridge

Next, I had to tell the bridging module which interfaces to connect together. This was done with a pair of sysctls:

# sysctl net.link.ether.bridge=1
# sysctl net.link.ether.bridge_cfg="wi0 fxpl0"

Where, wi0 was my WiFi card, and fxp0 was the on board Intel NIC. Finally I had to bring the WiFi interface up. To do this, I wrote a simple init script, which I dumped in /usr/local/etc/rc.d/. Here it is, if anyone wants to copy it:

#!/bin/sh
case $1 in
start)
ifconfig wi0 ssid RavenNet wepmode on wepkey x0123456789 channel 11 media DS/11MBps mediaopt hostap up stationname "Slave"
;;
stop)
ifconfig wi0 down
;;
restart)
ifconfig wi0 down
ifconfig wi0 ssid RavenNet wepmode on wepkey 0x0123456789 channel 11 media DS/11MBps mediaopt hostap up stationname "Slave"
;;
*)
echo "Usage WiFi [start|stop]"
exit
;;
esac

echo WiFi

Slashdot seems to have munched my indenting, but you get the idea.

Slave is now acting as a bridge between my PowerBook and the rest of the network. The only drawback is that I can't access slave directly from the wireless portion of the network. There are two solutions that I can see to this problem; I can either configure the interface as a router, rather than a bridge, or I can just pop in a spare network card (I probably have a load of rtl8139's spare), put that on a different address and tell it to bridge from the wireless card to this address. I will implement one of these once I have worked out which is less effort.

This discussion has been archived. No new comments can be posted.

Look! No Wires!

Comments Filter:
  • by ryanr ( 30917 ) *
    Why shouldn't you be able to access the FreeBSDbox from the wireless? If it's bridged, you should just be able to hit the IP as if you were on the Ethernet segment.
    • All incomming traffic on wi0 is routed out through fxp0. I suspect that there is no route from fxp0 to the address bound to fxp0 (wi0 has no ip address associated with it). To be honest, I'm not exactly sure. I can get at every other machine on the LAN, and get to the outside world, I just can't get to Slave. I'll look in more detail later in the week, but I did this just before I went to bed, and I couldn't be bothered to try to figure it out exactly (I just guessed that was why it wasn't working).
      • I suspect that there is no route from fxp0 to the address bound to fxp0

        Of course there is, the loopback interface. It exists for this exact situation.

        (wi0 has no ip address associated with it)

        Ah, well there's the key bit of information I didn't have. So, this is not just bridging, it's also some flavor of NAT or similar.

        What host do you get if you hit 127.0.0.1?
        • The loopback interface (lo0) is not bound to fxp0. fxp0 is a physical ethernet adaptor. lo0 is the loopback. The routes from Slave to Slave's IP and 127.0.0.1 go via lo0, not via fxp0. The bridging simply forwards packets from wi0 to fxp0, and so they are not routed correctly. If I create a routing rule that will allow packets sent out from fxp0 to be routed back to Slave, then this will work. Alternatively, it may be possible to add lo0 to the forwarding list, so packets received by wi0 can be forwar

Simplicity does not precede complexity, but follows it.

Working...