/*******************************************************************************

  OPENAIRINTERFACE 0/1/2/3
  Copyright(c) 1999 - 2010 EURECOM

  This program is free software; you can redistribute it and/or modify it
  under the terms and conditions of the GNU General Public License,
  version 2, as published by the Free Software Foundation.

  This program is distributed in the hope it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  more details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".

  Contact Information:
  Openair Admin <openair_admin@eurecom.fr>
  Mailing List <openair_tech@eurecom.fr>
  Forums  http://forums.eurecom.fr/openairinterface
  Eurecom, 2229, route des cretes, 06560 Valbonne Sophia Antipolis, France

*******************************************************************************/
/*________________________OPENAIR/OPENAIR3/________________________

 File    : INSTALL
 Authors : OpenAir3
 Company : EURECOM
 Emails  : openair3@eurecom.fr
________________________________________________________________*/

-------------------------
Table of contents
-------------------------

The content of this readme is the following:

	0) System requirements
	1) Installation of SYSLOGs Servers on MAGs (it has to be done only on MAG machines)
	2) EURECOM FreeRadius Installation
		2.1) FreeRadius client installation (concern only MAG machines)
		2.2) FreeRadius Server installation (concern only LMA machines)
	3) PMIP6D Compilation
	4) Change MAC addresses on other MAGs
	
-----------------------------------------
0) System Requirements
-----------------------------------------

	We validated that PMIP6D runs under UBUNTU 10.04 x86 LTS version. For this reason, we highly recommend you to use this UBUNTU version.
	However, we don't exclude that it might also work with other linux systems.
			
-------------------------------------------------------------------------------
1) Installation of SYSLOGs Servers on MAGs (It does not have to be done on LMA)
-------------------------------------------------------------------------------

	1.1) Each MAG machine has to run a SYSLOG Server on it.
		So on each machine that you use as MAG, you have to install a SYSLOG server :
		Installation of the SOCKLOG and SYSKLOGD packages :
			$ apt-get install socklog sysklogd

		Edit and change the Syslog server configuration :
			$ gedit /etc/syslog.conf 
				-> In this file, look for the line containing local7.info and change it to have this -> "local7.info   /var/log/pmip_syslog.log"
				-> In case the line wouldn't exist, go at the bottom of the text file and add this line "local7.info   /var/log/pmip_syslog.log"
			$ touch /var/log/pmip_syslog.log
				-> The file has to exist before to be used
			$ gedit /etc/default/syslogd
				-> You should have the option "-r" enabled for the SYSLOG Daemon. So be sure you have -> SYSLOGD="-r"
			$ /etc/init.d/sysklogd restart
				-> We restart the syslog daemon to take into account the modifications we just did

	1.2) Each Access Point should have their SYSLOG client enabled and configured.
		So on each Access Point you have to do what follows :
		For example on a CISCO SERIES 1100 ACCESS POINT web interface, you should go to EVENT LOG, then to CONFIGURATION and then add the MAG IP Address on which the syslog server is running. 
			Access Point Web Interface (10.0.0.1) --> EVENT LOG --> CONF --> Put SYSLOG SERVER's IP ADDRESS 

----------------------------------------------------------------------
2) EURECOM FreeRadius Installation  
----------------------------------------------------------------------
	
	Since the FreeRADIUS Client v1.1.6 from freeradius.org is limited to IPv4 protocol, we modified it in order to use only IPv6. 
	The Freeradius clients has to installed on all LMA and MAG.
	
	FYI, "THEGOODPATH" indicates the path where you downloaded PMIPv6_v0.4.1. We suggest you to copy everything in "/usr/local/src".
	Each line starting by a "$" are commands to be executed in a shell.
	
	2.1) FreeRadius client installation (It has to be installed on all MAGs and LMAs)
			$ cd THEGOODPATH/freeradiusclient-1.1.6/
			$ autoreconf -i
			$ ./configure
			$ make
			$ make install
						
		On all the MAGs, do as follows :
			In the "/etc/hosts" file, you have to tell the ipv6 address of the FreeRadius Server
				$ gedit /etc/hosts
			At the bottom of the file, type for example : "2001:100::1 radius6server"

		To let PMIP6D find Freeradius libraries, execute what follows :
			$ gedit /etc/ld.so.conf
			Add at the bottom of the file this line -> "include /usr/local/lib/". Save and exit.
			$ ldconfig
			
	2.2) FreeRadius Server installation (Has to be done only on LMAs)
			
		Now we proceed to the FreeRadius Server 2.1.12 installation :
		We will get the code from http://freeradius.org/ website, and download the 2.1.12 FreeRADIUS server source code (2.5 MB)
			$ wget ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-2.1.12.tar.bz2 
			$ tar xjf freeradius-server-2.1.12.tar.bz2
			$ cd freeradius-server-2.1.12
			$ ./configure
			$ make
			$ make install	
			
		You need now to copy three configuration files to the FreeRADIUS server in order to correctly connect the clients.
			$ cd THEGOODPATH/freeradiusclient-1.1.6/examples/
			$ cp users /usr/local/etc/raddb/
			$ gedit /usr/local/etc/raddb/users
				N.B: This file contains all the Mobile Node MAC addresses authorised in the PMIP6D domain. Please update it with your data. 
			$ cp radiusd.conf /usr/local/etc/raddb/
				N.B: This file contains all the information required for the connection, authentication between the Server and clients (MAGs).
			$ cp clients.conf /usr/local/etc/raddb/
				N.B: This file contains the list of authorised clients (MAGs). Please update this file with all your MAGs information.
		
-----------------------------------------------------
3) PMIP6D Compilation  (To be done on LMAs and MAGs)
-----------------------------------------------------
	Execute the following commands :
		$ cd THEGOODPATH/pmipv6-daemon-umip-0.4/
		$ autoreconf -i
		$ ./configure
		$ make
		$ make install
		
	WARNING : If you have some issues during the PMIP6D compilation, please look into the BUGS file. 
	If you are still facing any issue, please report it to us using the following email "openair3@eurecom.fr"
	
-----------------------------------------
4) Change MAC addresses on other MAGs
-----------------------------------------	
	
		4.1) One of the specificity of a PMIP Domain is that the Mobile Node should not be aware of its mobility inside the PMIP Domain.
		One of the way to achieve this is to copy the MAC Address of one of the MAG and duplicate it for all other MAGs.
		So in the configuration scripts we force the ingress MAG address to a predefined MAC address: 00:11:22:33:44:55 with the help of the macchanger executable.
		If you have a look to "THEGOODPATH/pmipv6-daemon-umip-0.4/extras/UMIP0.4_MAG2_UBUNTU.10.04.py" file, you will notice that we achieve this automatically via the configuration script.

	Moreover, your Access Points should not add their MAC Address to the IP Packets that they forward. To do this, you should put your Access Points in a MASQUERADING mode. 
