This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Comment out any other sections in the f le that refer to wlan0 or wlan1 to make sure that they don't interfere with our setup. This syntax for setting up bridges via the interfaces file is specific to Debian-based distributions, and the details of actually setting up the bridge are handled by a couple of scripts: /etc/network/if-pre-up.d/bridge and /etc/network/if-post-down.d/bridge . The documentation for these scripts is found in /usr/share/doc/bridge-utils/ . If those scripts don't exist on your distribution (such as Fedora Core), here is an alternative setup for /etc/network/interfaces which will achieve the same thing with only marginally more hassle: iface br0 inet static pre-up ifconfig wlan 0 0.0.0.0 up pre-up ifconfig wlan1 0.0.0.0 up pre-up iwconfig wlan0 essid “office” mode Managed pre-up iwconfig wlan1 essid “repeater” mode Master pre-up brctl addbr br0 pre-up brctl addif br0 wlan0 pre-up brctl addif br0 wlan1 post-down ifconfig wlan1 down post-down ifconfig wlan0 down post-down brctl delif br0 wlan0 post-down brctl delif br0 wlan1 post-down brctl delbr br0 Starting the bridge Once the bridge is defined as an interface, starting the bridge is as simple as typing: # ifup -v br0 The “-v” means verbose output and will give you information to what is going on. On Fedora Core (i.e. non-debian distributions) you still need to give your bridge interface an ip address and add a default route to the rest of the network: #ifconfig br0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 #route add default gw 192.168.1.1 You should now be able to connect a wireless laptop to this new access point, and connect to the Internet (or at least to the rest of your network) through this box. Use the brctl command to see what your bridge is doing: # brctl show br0 Chapter 5: Networking Hardware 151 Scenario 1 & 2 the easy way Instead of setting up your computer as an access point from scratch, you may wish to use a dedicated Linux distribution that is specially tailored for this purpose. These distributions can make the job as simple as booting from a particular CD on a computer with a wireless interface. See the follow- ing section, “Wireless-friendly operating systems” for more information. As you can see, it is straightforward to provide access point services from a standard Linux router. Using Linux gives you signi f cantly more control over how packets are routed through your network, and allows for features that simply aren ¡ t possible on consumer grade access point hardware. For example, you could start with either of the above two examples and im- plement a private wireless network where users are authenticated using a standard web browser. Using a captive portal such as Chillispot, wireless users can be checked against credentials in an existing database (say, a Windows domain server accessible via RADIUS). This arrangement could allow for preferential access to users in the database, while providing a very limited level of access for the general public.limited level of access for the general public....
View Full Document