[Babel-users] Ahcpd update in OpenWrt (quick HOWTO)

Gabriel Kerneis kerneis at pps.jussieu.fr
Mon May 31 12:46:35 UTC 2010


To every Ahcpd/OpenWrt user,

I just realised that the init script was totally broken in server mode.
This is now fixed in r21644.  Since nobody reported it, I guess nobody
was using it, for whatever reason.  Anyway, here is a quick how-to.  I
hope it might help some of you to setup their own ahcp server with
OpenWrt.

               HOW TO USE AHCP IN MY (OpenWrt) NETWORK ?
               -----------------------------------------

0. Installing ahcpd

You need to get the latest release of ahcpd.  If you use Backfire 10.03
(or some reasonably recent release of OpenWrt) on an Atheros or
Brcm47xx (2.6) platform, it couldn't be simpler:
# use "atheros" instead of "brcm47xx" if needed
$ echo "src/gz snapshot http://www.pps.jussieu.fr/~kerneis/software/files/openwrt/brcm47xx/packages" \
  >> /etc/opkg.conf
$ opkg update
# use "upgrade" instead of "install" if it is installed already
$ opkg install ahcpd

Otherwise, you'll have to compile it yourself from svn, or ask me to do
it for you.

1. Server configuration

Choose one of your stations to act as an ahcpd server.  Edit
/etc/config/ahcpd so that it looks like this:
----------------------------------------------------------------------
package ahcpd

config ahcpd
  option 'mode' 'server'
  # list every interface you want here, one per line
  list 'interface' 'lan'
  list 'interface' 'wlan'

  # list every prefix, dns server and ntp server
  # you want to advertise here, one per line
  list 'prefix' 'fd10:4ac:8650::/64'
  list 'prefix' '192.168.1.128/25'
  list 'name_server' '192.168.1.1'
  list 'ntp_server' '192.168.1.1'

  option 'lease_dir' '/var/lib/leases'
----------------------------------------------------------------------

  [
  Hint: to assign a static ipv6 address to one of your interfaces, edit
  /etc/config/network and use something like:
  config 'interface' 'lan'
    option 'ifname' 'ath0'
    option 'proto' 'static'
    option 'ip6addr' 'fd10:4ac:8650::1/64'
    # ... ipv4 options follow as usual ...
  ]

Do not forget to create the leases directory, for instance:
$ mkdir /var/lib/leases

Then, enable and start:
$ /etc/init.d/ahcpd enable
$ /etc/init.d/ahcpd start

2. Client configuration

Edit /etc/config/network to use the ahcp protocol on the desired
interfaces, for instance:
---------------------------------------------------------------------
config 'interface' 'wifi'
  option 'ifname' 'ath0'
  option 'proto' 'ahcp'
---------------------------------------------------------------------

Restart.  You're done!


Regards,
-- 
Gabriel Kerneis



More information about the Babel-users mailing list