Difference between revisions of "Access Point"

From LinuxMCE
Jump to: navigation, search
m (Added page category)
m (/etc/network/interfaces)
Line 94: Line 94:
  
  
/etc/default/dhcp.conf
+
We need to set the bridge (which contains eth1 and ath0) as the new interface for the dhcpd server.
 +
Edit /etc/default/dhcp.conf as followed:
 +
 
 +
    INTERFACES="br0"
  
 
/etc/default/dhcpd3/dhcpd.conf
 
/etc/default/dhcpd3/dhcpd.conf

Revision as of 12:41, 18 November 2009

WORK IN PROGRESS

Introduction

This tutorial describes how to add Access Point functionality to your LMCE core. The core will act as a WiFi access point permitting wireless devices to connect to the core, the internal network and the internet.

Hardware setup

  • Dell Optiplex Gx620
  • WiFi card with Atheros chipset (using madwifi drivers)
  • Linux MCE 810 alpha2

If you install LMCE from scratch make sure that your wifi card is NOT inserted prior to installation so that LMCE doesn't use it as the internal network interface. After LCME installation has finished, insert the wifi card.

Overview

the idea is to combine or bridge eth1 and ath0 to a new virtual interface called br0.

  • -> eth0 connects to my ADSL modem (192.168.1.0)
  • -> eth1 connects to my internal LAN switch (192.168.80.0)
  • -> ath0 connects the wireless part of my internal network (192.168.80.0)

Needed packages

  • hostapd
  • bridge


Config files

/etc/network/interfaces

We'll make a copy of /etc/network/interfaces in case something goes wrong before we edit it.

mv /etc/network/interfaces /etc/network/interfaces.bck
joe /etc/network/interfaces
auto lo eth0 eth1 br0

automatically initialise eth0 (external interface) eth1 (internal LAN) and br0 (our bridge interface). Keep ath0 out of this for now, we'll initialise it separately.

iface lo inet loopback
# Internet Interface
iface eth0 inet static
       address 192.168.1.2
       netmask 255.255.255.0
       gateway 192.168.1.1
       dns-nameservers 192.168.1.1

Fill in your own settings here, in my case 192.168.1.1 is the ADSL modem. Alternatively you can use dhcp to get the adress details from your ADSL modem.

# LAN interface
iface eth1 inet manual
  up /sbin/ifconfig eth0 up
  down /sbin/ifconfig eth0 down

The internal interface, note that it doesn't get an adress assigned.

# Wireless interface
auto ath0
iface ath0 inet manual
  up /sbin/ifconfig ath0 up

The wireless interface, again no adress details here.

iface br0 inet static
   address 192.168.80.1
   network 192.168.80.0
   netmask 255.255.255.0
   broadcast 192.168.80.255
   pre-up /usr/sbin/brctl addbr br0
   pre-up /usr/sbin/brctl addif br0 eth1

The fun part. Finally we assign the adress for the internal LAN to the bridge interace br0 (I'm sticking here with the standard LMCE network 80.0). The pre-up will create a bridge and add the eth1 interface to it.

   pre-up /sbin/wlanconfig ath0 destroy
   pre-up /sbin/wlanconfig ath0 create wlandev wifi0 wlanmode ap
   pre-up /sbin/iwconfig ath0 channel 3

This part is necessary as the atheros interface has some issues to switch ino access point mode (master mode)

   pre-up /usr/sbin/brctl addif br0 ath0

After firing up the wireless interface we add it to the bridge as well.

   post-down /usr/sbin/brctl delif br0 eth1
   post-down /usr/sbin/brctl delif br0 ath0
   post-down /usr/sbin/brctl delbr br0

Just some lines to define how to cleanly shut down the bridge: remove both interfaces and then remove the bridge interace itself


We need to set the bridge (which contains eth1 and ath0) as the new interface for the dhcpd server. Edit /etc/default/dhcp.conf as followed:

   INTERFACES="br0"

/etc/default/dhcpd3/dhcpd.conf

wireless configuration

We'll use hostapd to manage the wireless part as it provides WPA encryption. I suggest that you first try to setup your network without encryption, make sure it works and then enable encryption.

Enable WPA encryption

  • edit the /etc/hostapd

Set static IP adresses

It is possible to set static ip adresses manually instead of using LMCE