Wireless Hacks Free Open Book

Wireless Hacks

Previous Section Next Section

Hack 58 Make Host AP a Layer 2 Bridge

figs/expert.giffigs/hack58.gif

Make a simple Ethernet bridge with Host AP and one other network interface.

So far, we have seen how to set up your Host AP machine as a routed or NAT'd network appliance. But what if you want to bridge directly to your Ethernet network or another wireless card?

Bridging is very straightforward to implement. You need a copy of the bridge utilities from http://bridge.sourceforge.net/, as well as a kernel with 802.1d Ethernet bridging enabled. The basic procedure for configuring a bridge is to remove any existing IP configuration on the devices you want to bridge, then create a logical bridge device with the interfaces you want to bridge together. Finally, you configure an IP address and routes for the logical bridge device, so you can still use the network from the bridge device itself (as well as access any services provided by the bridge device from the rest of the network).

Suppose we want to bridge a Prism card running Host AP (wlan0) with the first Ethernet device (eth0). Try this, preferably from the console:

pebble:~# ifconfig eth0 0.0.0.0
pebble:~# ifconfig wlan0 0.0.0.0
pebble:~# brctl addbr br0
pebble:~# brctl addif br0 eth0
pebble:~# brctl addif br0 wlan0
pebble:~# ifconfig br0 10.15.6.2
pebble:~# route add default gw 10.15.6.1

When you first create the bridge device, it takes a moment or two for the bridge to "learn" the layout of your network. It can take several seconds for traffic to begin to pass through the bridge when first brought up, so don't panic if you don't immediately see traffic.

If you have one bridge only on your network, you can also safely turn off Spanning Tree:

pebble:~# brctl stp br0 off

This prevents the bridging code from needlessly sending 802.1d negotiation traffic to nonexistent bridges. You can see the configuration of your bridge at any time by using brctl show:

pebble:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.00026f018574       no              eth0
                                                        wlan0

If you are interested in which MACs have been found on the bridge interfaces, use brctl showmacs <interface>:

pebble:~# brctl showmacs br0
port no mac addr                is local?       ageing timer
  2     00:02:6f:01:aa:ff       yes                0.00
  1     00:03:93:6c:11:99       no               135.69
  2     00:30:65:03:00:aa       no                 0.08
  1     00:40:63:c0:aa:bb       no                 0.16
  1     00:a0:24:ab:cd:ef       yes                0.00

Generally, bridges are "set and forget" devices. Once configured, your bridge maintains itself, barring a huge amount of traffic or untoward miscreants fiddling with it. Be sure to read the documentation available at http://bridge.sourceforge.net/, as well as the documents listed at the end of this hack.

Caveats

Not all network devices allow bridging. Specifically, some radio cards (notably the Lucent/Orinoco/Avaya/Proxim Gold and Silver cards) prohibit Ethernet bridging in the radio firmware. If you need to bridge, I highly recommend upgrading these cards to a Prism card, such as the very popular Senao/EnGenius models. These cards not only allow bridging, but are more powerful and sensitive as well.

Also keep in mind that, as easy as a simple bridge is to configure, it isn't the most secure device on the planet. If you have any interest in controlling the packets that flow across your bridge (and you should), then you will want to implement some firewalling on your bridge. But unfortunately, standard netfilter commands don't work with bridges under Linux 2.4. Be sure to read [Hack #59] if you need more control over your bridge.

See Also

    Previous Section Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Z]


         Main Menu
    Main Page
    Table of content
    Copyright
    Credits
    Foreword
    Preface
    Chapter 1. The Standards
    Chapter 2. Bluetooth and Mobile Data
    Chapter 3. Network Monitoring
    Chapter 4. Hardware Hacks
    4.1 Hacks #43-69
    Hack 43 Add-on Laptop Antennas
    Hack 44 Increasing the Range of a Titanium PowerBook
    Hack 45 WET11 Upgrades
    Hack 46 AirPort Linux
    Hack 47 Java Configurator for AirPort APs
    Hack 48 Apple Software Base Station
    Hack 49 Adding an Antenna to the AirPort
    Hack 50 The NoCat Night Light
    Hack 51 Do-It-Yourself Access Point Hardware
    Hack 52 Compact Flash Hard Drive
    Hack 53 Pebble
    Hack 54 Tunneling: IPIP Encapsulation
    Hack 55 Tunneling: GRE Encapsulation
    Hack 56 Running Your Own Top-Level Domain
    Hack 57 Getting Started with Host AP
    Hack 58 Make Host AP a Layer 2 Bridge
    Hack 59 Bridging with a Firewall
    Hack 60 MAC Filtering with Host AP
    Hack 61 Hermes AP
    Hack 62 Microwave Cabling Guide
    Hack 63 Microwave Connector Reference
    Hack 64 Antenna Guide
    Hack 65 Client Capability Reference Chart
    Hack 66 Pigtails
    Hack 67 802.11 Hardware Suppliers
    Hack 68 Home-Brew Power over Ethernet
    Hack 69 Cheap but Effective Roof Mounts
    Chapter 5. Do-It-Yourself Antennas
    Chapter 6. Long Distance Links
    Chapter 7. Wireless Security
    Appendix A. Deep Dish Parabolic Reflector Template
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele