Difference between revisions of "Zipit Linux Setup"

From eLinux.org
Jump to: navigation, search
Line 157: Line 157:
Now, your [[ZipIt]] should retrieve an IP address (there might be some errors in there, but they probably won't affect you, see Step 4 of [[OpenZipItLinuxInstall]] for more details)
Now, your [[ZipIt]] should retrieve an IP address (there might be some errors in there, but they probably won't affect you, see Step 4 of [[OpenZipIt Linux Install]] for more details)
Test out your connection by typing on your [[ZipIt]]:
Test out your connection by typing on your [[ZipIt]]:

Latest revision as of 14:55, 24 September 2007

Configuring Linux to be an Ad-Hoc Networking Node

    1. Click System->Administration->Networking 2. Click on "Wireless Connection", click Properties. 3. Check "This device is configured", set the rest of the options as follows: Wireless Settings
  • ESSID: zipnet
  • WEP key: [blank]
   Configuration Settings
  • Configuration: Static IP address
  • IP address:
  • Subnet mask:
  • Gateway address:


   4. Click OK.
   5. Click on "Wireless connection" again, click the "Activate" button.
   6. Change "Default gateway device" to "ath0" or "wlan0" (whichever)
   7. Click OK.

Putting back your network settings

    1. Go back to Networking, deactivate "Wireless connection", set the default gateway device back to eth0. 2. Reboot if you find that your internet/ethernet connection isn't working right away.

Configuring Linux to be a Wireless Network Bridge

This configuration allows you to bridge a wired ethernet connection with a wireless connection, essentially allowing a single WiFi card to act as an access point. (In reality, it's an ad-hoc network that is also bridging a network, but your ZipIt can't tell the difference.) This is really useful with a ZipIt because it'll let you share your internet connection with the device without a wireless access point.

Please note: The following instructions assume your wireless device to be called ath0. This will be the case if your device uses the Mad Wifi drivers. If it doesn't, then it's device name is probably wlan0. If unsure, identify your wireless device name by running iwconfig, and then make the corresponding replacements in the instructions below. Also note: If you've just installed BURN3, make sure you've put back your network settings as described in the section above this.

  1. Disable your firewall. In Ubuntu with Firestarter installed, it can be done with the command:
sudo /etc/init.d/firestarter --stop

If you don't disable your firewall, the NAT forwarding gets messed up or something.

2. Enable your wireless card. Type the following commands in a terminal:

sudo -s
ifconfig ath0 up
iwconfig ath0 mode Master
iwconfig ath0 channel 6
iwconfig ath0 essid zipnet key 0102030405

3. Bridge your wireless to wired network. Firstly, you need to install bridge-utils. In Ubuntu/Debian, simply type into a terminal:

sudo apt-get install bridge-utils

Now, find out what your router's IP address is. Run the command: route

You should get output something like the following:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface        *        U     0      0        0 eth1     *        U     0      0        0 eth0
default         UG    0      0        0 eth0
(I don't know how to format to differentiate from a command to run) is then the gateway for me to use as its the default.

We need to create the network bridge with a gateway IP that's on a different IP range than the one that your router is on, and with a different IP address. To be on the safe-side, we'll use as our bridge's IP address. Type in the following commands:

   brctl addbr br0
   brctl addif br0 ath0
   ifconfig br0 inet broadcast netmask \ up

4. Install and setup DHCPD In Ubuntu/Debian, install dhcpd by typing into a terminal:

sudo apt-get install dhcpd
(Ubuntu may say its gone and selected dhcp instead. This is fine.)

Now, edit one of the dhcp configuration files with:

sudo nano /etc/conf.d/dhcp

... and change the line IFACE="" to: IFACE="eth0 eth1 br0" (the eth1 part might be useless)

Next, edit you dhcpd.conf file with:

sudo nano /etc/dhcpd.conf

... and add lines that look something like this:

subnet netmask {

   option routers;

subnet netmask {

   option routers;

Replace with an entry that corresponds to your own wired ethernet network, replace the "range" line with another corresponding line, and replace with the IP address of your router.

Finally, run the DHCP server with:

sudo dhcpd

5. Enable IP masquerading. In a terminal window, type:

sudo -s
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Note, in the above: Replace eth0 with ppp0 if you're not behind a router... eth0 should go out to the internet (eth0 is hooked up to my router)

6. Test it out On your ZipIt, type:

iwlist eth0 scan

... and make sure that your wireless network is present.

If it is, then on your ZipIt, type:

iwconfig eth0 essid zipnet key 0102030405

Now, your ZipIt should retrieve an IP address (there might be some errors in there, but they probably won't affect you, see Step 4 of OpenZipIt Linux Install for more details)

Test out your connection by typing on your ZipIt:



ping www.google.com

Disabling the network bridge:

In Ubuntu/Debian, simply execute the following commands in a terminal:

sudo -s
brctl delif br0 ath0
ifconfig br0 down
brctl delbr br0
ifconfig ath0 down
iptables -t nat -F

Again, if your wireless card's device name is wlan0 instead of ath0, please make the replacement in the above lines accordingly.