DebConf7/OpenWRT

From Wiki
Jump to: navigation, search

Contents

[edit] Documentation for the OpenWrt setup at DebConf7

This page describes the accesspoint configuration for DebConf7. We'll use the Kamikaze version of OpenWrt. Despite it's name, Kamikaze is the new stable release of OpenWrt, the successor of WhiteRussian.

The accesspoints will be bridging networks and provide unencrypted wireless (authentification via chillispot, you'll have to login once via a webfrontend, then your MAC address will be recorded and you don't need to login again) on the ESSID DebConf7. On the b+g network we'll use the channels 1, 6 and 11, maps with the locations will be linked later. microperl and snmp are installed for monitoring.

We need 16 converters from german power-plugs to UK-style, or seven 5V 2A power-suppies with UK plugs and nine 12V 1A power-supplies.

a german power strip with a uk-style plug can do the job nicely ;-)


[edit] Hardware list

  • 2 Asus WL-500g Premium (b/g) from ryd, hamburg.freifunk.net, 5V 2A
  • 8 Linksys WRT54GL v1.1 (b/g) from berlin.freifunk.net, 12V 1A
  • 1 Linksys WRT54G v1.1 (b/g) from nbd, 12V, 1A
  • 1 Linksys WRT54G from Phillip Hands, 5V 2A
  • 2 Fonera (bg) from nbd, hamburg.freifunk.net, 5V 2A
  • 3 Fonera (b/g) from ryd (only one power supply, 5V 2A needed)

We also have 3 Linksys WRT55AG (a/b/g) from berlin.freifunk.net (they need different power-supplies than the other linksys!, 5V, 2A), which don't (and can't AFAWK) run OpenWRT but are listed here for simplicity

[edit] Instructions to build images from the 1.0 branch (for Broadcom chipsets) and from trunk (for Atheros-based)

sudo apt-get install gcc binutils patch bzip2 flex bison make gettext pkg-config unzip libz-dev  libc6-dev libncurses5-dev gawk autoconf
#
# broadcom (linksys/asus) is build from stable kamikaze 1.0 tag
# 
# atheros (fonera) is build from trunk because of the newer madwifi driver
#
svn co https://svn.openwrt.org/openwrt/tags/kamikaze_7.06/
svn co https://svn.openwrt.org/openwrt/trunk kamikaze-trunk
svn co https://svn.openwrt.org/openwrt/packages
cd kamikaze_7.06/package
ln -s ../../packages/*/* .
cd ..
cd kamikaze-trunk/package
ln -s ../../packages/*/* .
cd ..
cd kamikaze_7.06
wget http://layer-acht.org/broadcom-debconf-build.config -O .config
cd ..
cd kamikaze-trunk
wget http://layer-acht.org/atheros-debconf-build.config -O .config
cd ..
# ./files is copied into the images at the end of the build process
cd kamikaze_7.06
mkdir -p files/etc/config
vi files/etc/config/network
vi files/etc/config/wireless
cd ..
cd kamikaze-trunk
# repeat the above
# for each of the two: :)
make menuconfig
# target profile for linksys+asus: ASUS WL-500g Premium 
make download # for building without net 
make
# images in ./bin/ now

[edit] kamikaze_7.06/files/etc/config/network

#### VLAN configuration
config switch eth0
	option vlan0	"1 2 3 4 5*"
	option vlan1	"0 5"

#### Loopback configuration
config interface loopback
	option ifname	"lo"
	option proto	static
	option ipaddr	127.0.0.1
	option netmask	255.0.0.0

#### LAN configuration
config interface lan
	option type	bridge
	option ifname	"eth0.0"
	option proto	static
	option ipaddr	10.7.255.1
	option netmask	255.255.0.0
	option gateway	10.7.0.1

[edit] kamikaze_7.06/files/etc/config/wireless

config wifi-device  wl0
       option type     broadcom
       option channel  1 # 6 or 11 - consult map for each individual device
       option diversity 1
       option txantenna 0
       option rxantenna 0

config wifi-iface
       option device   wl0
       option network  lan
       option mode     ap
       option ssid     DebConf7-TODO
       option hidden   0
       option encryption none

[edit] kamikaze-trunk/files/etc/config/network

config interface loopback
       option ifname   lo
       option proto    static
       option ipaddr   127.0.0.1
       option netmask  255.0.0.0

config interface lan
       option ifname   eth0
       option type     bridge
       option proto    static
	option ipaddr	10.7.255.1
	option netmask	255.255.0.0
	option gateway	10.7.0.1

[edit] kamikaze-trunk/files/etc/config/wireless

# fonera
config wifi-device  wifi0
       option type     atheros
       option channel  1 # 6 or 11 - consult map for each individual device
       option diversity 1
       option txantenna 0
       option rxantenna 0

config wifi-iface
       option device   wifi0
       option network  lan
       option mode     ap
       option ssid     DebConf7-TODO
       option hidden   0
       option encryption none

[edit] Flashing

Also see Installation of OpenWrt

[edit] Asus WL-500g Premium

  • power off
  • press black button while powering on, keep button pressed
  • wait 5 secs, release button
  • the asus has 192.168.1.1 on the lan-ports
  • upload openwrt-brcm-2.4-squashfs.trx with tftp-client
$ atftp 192.168.1.1 
tftp> put openwrt-brcm-2.4-squashfs.trx 
tftp> quit
  • wait 5 min
  • power cycle
  • first boot takes 2 min

[edit] Linksys WRT54G{,S,L}

  • power off
  • do NOT press the reset button
  • power on
  • immediately upload openwrt-wrt54g-2.4-squashfs.bin with tftp-client to 192.168.1.1 on one of the LAN ports. e.g.
$ while true ; do atftp -p -l openwrt-wrt54g-2.4-squashfs.bin 192.168.1.1 ; done
  • the linksys automatically resets after flashing (approx 5 min)

[edit] Fonera

  • needs special cable for serial (TTL to EIA-232)
  • sudo apt-get install atftpd ; sudo /etc/init.d/shorewall stop ; sudo iptables -F ; sudo ifconfig eth1 192.168.1.2
  • sudo mkdir /tftpboot
  • cp kamikaze-trunk/bin/openwrt-atheros-2.6-root.squashfs kamikaze-trunk/bin/openwrt-atheros-2.6-vmlinux.lzma /tftpboot/
  • power on, then immediately connect GND (blue) from the serial cable within a second (connect RX/TX before power on). then press CTRL-C to enter redboot:
IP: 0.0.0.0/255.255.255.255, Gateway: 0.0.0.0
Default server: 0.0.0.0

RedBoot(tm) bootstrap and debug environment [ROMRAM]
Non-certified release, version v1.3.0 - built 16:57:58, Aug  7 2006

Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.

Board: ap51 
RAM: 0x80000000-0x81000000, [0x80040450-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87f0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 1.000 seconds - enter ^C to abort
^C
RedBoot> ip_addr -l 192.168.1.1/16 -h 192.168.1.2
RedBoot> fis init
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.lzma
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801007ff, assumed entry at 0x80040800
RedBoot> fis create -e 0x80041000 -r 0x80041000 vmlinux.bin.l7
... Erase from 0xa8030000-0xa80f0000: ............
... Program from 0x80040800-0x80100800 at 0xa8030000: ............
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .
RedBoot> load -r -b %{FREEMEMLO} openwrt-atheros-2.6-root.squashfs
Using default protocol (TFTP)
Raw file loaded 0x80040800-0x801e07ff, assumed entry at 0x80040800
RedBoot> fis create -l 0x6f0000 rootfs
... Erase from
0xa80f0000-0xa87e0000: ...............................................................................................................
... Program from 0x80040800-0x801e0800 at 0xa80f0000: ..........................
... Erase from 0xa87e0000-0xa87f0000: .
... Program from 0x80ff0000-0x81000000 at 0xa87e0000: .

roldarr

[edit] Setup / Configuration

  • configure your PC to 10.7.255.X (e.g. 10)
  • telnet to 10.7.255.1
  • type passwd and set the root password. After that, telnet will stop working (your session stays alive) and ssh will start working
  • edit /etc/config/network and change the IP address to an unallocated one (please go sequentially!)
  • edit /etc/config/wireless and change the channel (1, 6 or 11) and the ESSID from DebConf7-TODO to DebConf7
  • use ifconfig | grep HWaddr, note the MAC addresses and put them on the table below
  • print and place a "dc7apX" sticker, where X is the last octet of the IP address
  • print and place a "chan Y" sticker
  • place a "freinfunk.net" sticker, if it's coming from freifunk

[edit] Misc

  • Little-endian: Linksys, Asus
  • Big-endian: Fonera
  • Wireless-throughput performance: Asus > Linksys WRT54G{,S,L} (802.11b/g) > Linksys WRT55ag (802.11a/b/g) > Fonera (25mbit)
  • Do not use the WAN port. It's configured as a different interface (VLAN) and doesn't have an IP address assigned.
  • OpenWRT Kamikaze doesn't use nvram variables like WhiteRussian did. Instead, all settings are stored in configuration files in /etc (mostly /etc/config)

[edit] Physical topology

We're using the "dc7apX" notation; the IP address are 10.7.255.X (so for example, dc7ap1 has an IP address of 10.7.255.1)

Floor Room position Name IP channel MAC address (eth,wireless) Switch port
2 Main Hall front, left of stage dc7ap1 10.7.255.1 1 00:17:31:BF:6E:73 dc7sw1 port 17
2 Main Hall left balcony near projector  ?  ? A 00:12:17:A7:CA:C9 dc7sw1 port 7
2 Upper Bof room on switch in corner dc7ap11 10.7.255.11 11 00:18:F8:F9:FF:7E dc7sw2 port 24
1 Canteen on drinks machine dc7ap3 10.7.255.3 6 00:0F:66:24:E9:E4 dc7sw0 port 11?
1 Hacklab 2 by window dc7ap8 10.7.255.8 11 00:18:F8:FA:02:C0, 00:18:F8:FA:02:CB 10.172.4.11 port 3
1 Hacklab 1 fireplace R, LHS dc7ap4 10.7.255.4 1 00:18:F8:FA:02:C9, 00:18:F8:FA:02:CB dc7sw4 port 2
1 Hacklab 1 fireplace R, RHS  ?  ? A 00:12:17:A7:FA:DD dc7sw4 port 1
-1 Talk Room 2 stage LHS dc7ap5 10.7.255.5 11 00:18:F8:FA:02:7E, 00:18:F8:FA:02:80 dc7sw5 port 1

[edit] Up and running

Asus WL-500g Premium, courtesy of freinfunk.net


dc7ap1, channel 1, Main Talk room, ethernet & wireless MAC: 00:17:31:BF:6E:73

dc7ap2, channel 11, BoF room 2 / Upper BoF room, ethernet & wireless MAC: 00:17:31:E7:5E:60

Linksys WRT54G{,L}, courtesy of freinfunk.net


dc7ap3, channel 6, Costa / Canteen ethernet MAC: 00:0F:66:24:E9:E2 wireless MAc: 00:0F:66:24:E9:E4

dc7ap4, channel 1, Hacklab 1 ethernet MAC: 00:18:F8:FA:02:C9 wireless MAC: 00:18:F8:FA:02:CB

dc7ap5, channel 11, Talk room 2 (Night club) ethernet MAC: 00:18:F8:FA:02:7E wireless MAC: 00:18:F8:FA:02:80

[edit] Ready to be deployed

Linksys WRT54G{,L}, courtesy of freinfunk.net


dc7ap6, channel 1 (single antenna), ethernet MAC: 00:1A:70:47:A5:2A wireless MAC: 00:1A:70:47:A5:2C

dc7ap7, channel 6, ethernet MAC: 00:18:F8:FA:01:79 wireless MAC: 00:18:F8:FA:01:7B

dc7ap8, channel 11, ethernet MAC: 00:18:F8:FA:02:C0 wireless MAC: 00:18:F8:FA:02:C2

dc7ap9, channel 1, ethernet MAC: 00:18:F8:FA:02:72 wireless MAC: 00:18:F8:FA:02:74

dc7ap10, channel 6, ethernet MAC: 00:18:F8:FA:02:BD wireless MAC: 00:18:F8:FA:02:BF

dc7ap11, channel 11, ethernet MAC: 00:18:F8:F9:FF:7E wireless MAC: 00:18:F8:F9:FF:80


Thanks to nbd, ryd, cven & alxhh for all the fish! Document written by Holger Levsen and Faidon Liambotis with the help of nbd and ryd.


Personal tools
DebConf17