[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. The configuration services

The configuration services provides configuration to requesting clients and maintains the registration between user and selected provider.

1.1 Design of the relay agent  
1.2 The registration services  
1.3 Setting up the MAC database  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Design of the relay agent

The BOOTP relay agent is a modified version of ISCs dhcrelay version 3.0. The relay agent has been modified to instead of sending a recieved DHCP message to one or more servers it now sends the DHCP message to only one server based on the MAC address of the requesting client. This is achieved by looking up the MAC address in a database consisting of mappings between MAC addresses and providers. The database is a PostgreSQL and is accessed trough libpq.

The database has the following definitions:

@verbatim CREATE TABLE T_provider ( provider_id SERIAL, provider_name text, provider_dhcp inet, provider_auth_url text, provider_net inet, provider_netmask inet, primary key (provider_id));

CREATE TABLE T_macbind ( mac_addr macaddr, provider_id bigint, mac_reg_date timestamp, primary key (mac_addr));

CREATE VIEW V_mapping AS SELECT M.mac_addr, P.provider_dhcp, P.provider_net, P.provider_netmask, P.provider_auth_url FROM T_macbind AS M,T_provider AS P WHERE M.provider_id = P.provider_id;

GRANT ALL ON T_provider TO macbind; GRANT ALL ON T_macbind TO macbind; GRANT ALL ON V_mapping TO macbind;

In the table T_provider:

`provider_id'
A serialnumber identifying the provider that is used to bind mac addresses to it.
`provider_name'
The name of the provider and is also displayed to the users when choosing provider.
`provider_dhcp'
The IP address of the dhcpserver of the provider.
`provider_auth_url'
The URL to the providers authentication page.
`provider_net'
The IP address of the network that the dhcpserver should hand to a client.
`provider_netmask'
The netmask for `provider_net'.

In T_provider there has to exist one entry with `provider_name' = "default" to be used as default when a (MAC address, provider) binding is not available.

In the table T_macbind:

`mac_addr'
The macaddress of the client.
`provider_id'
Referes to the table T_provider
`mac_reg_date'
A timestamp of when this MAC address last received a DHCP lease. This is used to delete old entries in the database.

The view V_mapping is just a way to ease up the queries to the database so that the client only has to make one query to get the (MAC address, provider) binding.

1.1.1 Compiling the relay agent  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1.1 Compiling the relay agent

Unpack the DHCP sources and apply the patch:
 
tar zxf dhcp-3.0.tar.gz
cd dhcp-3.0
patch -p0 < ../dhcp.patch

Now configure and make DHCP:

 
./configure
make
make install

The relay agent does not need any configuration. All neccessary information is retrieved from the MAC database.

For more instructions, see the included documentation in the original ISC DHCP sources.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 The registration services

The registration service lets users choose the provider to use. It is a web page that records the users choice in the MAC database.

When the user wants to authenticate to the network, he enters the registration page. This page looks up the MAC address of the requesting client in the MAC database and redirects the user to the real authentication webpage of the chosen ISP. The registration page also makes it possible for the user to change ISP.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Setting up the MAC database

PostgreSQL is used for the MAC database.

  1. Install PostgreSQL

    PostgreSQL is available as convenient packages for many GNU/Linux distributions, including RedHat (+ clones) and Debian.

    Alternatively, one can download and compile PostgreSQL from source. The sources are available from http://www.postgresql.org/. Instructions for compiling PostgreSQL are included in the sources.

  2. Create the database
     
    createdb macbind
    

  3. Create a user
     
    createuser -P macbind
    
    The -P option will ask you for a password to protect the macbind database. In the current version of the system, this password is hardcoded as macbind_qwerty into the access and DHCP relay sources. This really has to be fixed.

  4. Initialize the database
     
    psql -U macbind -f init-macbind.sql macbind
    

  5. Configure access permissions

    Edit the PostgreSQL access configuration file to allow connections to the macbind database with a password. Add the following line to /etc/postgresql/pg_hba.conf:
     
    local macbind password
    


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

Short Table of Contents

1. The configuration services

[Top] [Contents] [Index] [ ? ]

About this document

This document was generated by Oden Eriksson on November, 10 2004 using texi2html

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack previous or up-and-previous section 1.1
[ Up ] Up up section 1.2
[ >> ] FastForward next or up-and-next section 1.3
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index concept index  
[ ? ] About this page  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

This document was generated by Oden Eriksson on November, 10 2004 using texi2html