Instalación de NoCatAuth bajo Fedora 4,5 y 6 (3)


Este documento esta basado en las recopilaciones y  experiencias propias del autor. El autor declina cualquier responsabilidad derivada de la aplicación de este tutorial. La distribución total o parcial  de este documento con fines comerciales  esta expresamente prohibida en cualquier medio o soporte sin la autorización por escrito del autor.


Activando Servicios

 

Ahora que ya sabemos como activar servicios vamos a aprovechar y activaremos los distintos servicios que nos van a ser necesarios posteriormente para que nuestro "gateway" funcione. Vamos nuevamente a:

Inicio/Configuraciones del Sistema/Configuraciones del Servidor/Servicios

y activamos (si es que no lo estan ya) los siguientes:

httpd: El servidor web Apache

iptables: Tablas de enrutamiento de IP

mysqld: Servidor MySQL

Una vez activados guardamos la configuración y, desde nuestro ordenador "cliente", vamos a comprobar, al igual que hicimos anteriormente con el servidor DHCP, si funciona el servidor Web (httpd). Los servicios de IPtables y MySQL los verificaremos posteriormente ya que, de momento, no son imprescindibles para lo que nos interesa hacer en este momento.

Para ello deberemos dar una configuración mínima a nuestro servidor. Iremos primero a Administración>Configuraciones del Servidor>HTTP

y configuraremos un nombre para el servicio y, si lo deseamos, una dirección válida para que los usuarios se pongan en contacto con nosotros si detectan cualquier anomalia en nuestro servidor:

hecho esto, guardamos nuestra configuración basica y estamos ya en disposición de intentar acceder desde nuestro "cliente" al Servidor Web para constatar su correcto funcionamiento.

Abrimos pues la ventana de nuestro navegador en nuestro ordenador "cliente" y en la barra de navegacion escribimos:

http://10.34.122.1

y nos aparcera algo parecido a esto:

Esta es la confirmacion inequivoca de que vamos por el buen camino. Ya tenemos funcionando el servidor DHCP y el Servidor WEB.

 

Puente de Red

Vaamos ahora a configurar nuestro puente de red. Hasta aqui hemos configurado la parte basica de lo que va a ser nuestro "gateway" y ahora vamos ya a empezar la parte "importante", es decir, la parte que nos permitira que nuestros "clientes" pasen a traves de nuestra maquina y que es esencial para que luego, al instalar NoCatAuth nos funcione todo correctamente.

Lo primero que vamos a hacer va a ser decirle a nuestra maquina que cualquier petición que llegue a eth1 de nuestra maquina la enrute hacia eth0. De hecho es el primer concepto real de lo que es un "gateway".

Para ello vamos a /etc/rc.d/ y en el fichero rc.local añadimos la linea siguiente:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Guardamos y seguimos con el siguiente paso.

Ahora en /etc/ buscamos sysctl.conf y modificamos la siguiente linea:

net.ipv4_ipforward = 0

por

net.ipv4_ipforward = 1

Siguiente paso:

9.- en /etc/ buscamos named.conf e incluimos la siguiente linea en el final de la rama Options para que quede mas o menos asi:

options{

//otras lineas y opciones//

forward only;

forwarders{195.235.113.3; 195.235.96.90;};

};

en este caso corresponden a las IP de los servidores de DNS de Telefonica, aunque ahi podeis poner las IP de los servidores de DNS que vayais a usar.

Vamos ahora a dehabilitar todas las opciones de seguridad. NoCatAuth nos proporcionara las que necesitamos. Este es un paso importante que no aparece en la mayoria de los documentos referentes al NoCatAuth y que provoca posteriormente errores y quebraderos de cabeza a menos que quien lo configure sea un experto en IPtables.

Ir a Inicio/Configuraciones del sistema/Nivel de Seguridad

y deshabilitar todas las opciones.

Ahora paso IMPORTANTE en /etc/sysconfig/ borrar los ficheros de configuracion iptables , iptables.save y iptables-config .

El siguiente paso deberemos de hacerlo desde una ventana del Terminal para limpiar y comprobar que nuestro IPtables esta "limpio". Abrir una ventana del Terminal yendo a Inicio/Herramientas del sistema/Terminal y ejecutar:

/etc/init.d/iptables restart

Os dira algo parecido a esto:

Comprobar si la tabla de IP esta ya limpia escribiendo en la misma ventana del terminal:

iptables -L -n

deberia de aparecer algo parecido a esto:

Con esto nos aseguramos que tenemos nuestra tabla de IP "limpia" para que, cuando posteriormente reiniciemos nuestro ordenador, aplique solamente el contenido definido para nuestro puente de red, es decir, la linea iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE que hemos definido en /etc/rc.d/rc.local .

 

Paquetes adicionales

 

Vamos ahora a comprobar si tenemos instalados los paquetes DBI, Perl y GnuPGP. En caso de no tenerlos los instalamos (si habeis hecho una instalacion completa seguramente DBI y Perl ya los tengais instalados). Para saberlo utilizaremos el comando "locate" desde la ventana del terminal haciendo, por ejemplo, locate DBI. Si es la primera vez que lo usamos nos pedira que creemos la base de datos de todos los paquetes que tengamos en nuestra maquina. Esto se hace tecleando: locate -u .Esto tardara unos 5 minutos en hacerlo pero habra valido la pena ya que posteriormente nos ahorrara mucho tiempo en localizar paquetes en nuestra maquina.

Para instalar el GnuPGP recomendamos una version determinada (posiblemente con versiones posteriores tambien funcione...pero con esta funciona seguro) que es la gnupg-1.2.3.tar.bz2 . Podeis bajarla desde http://public.ftp.planetmirror.com/pub/gnupg/gnupg-1.2.3.tar.bz2.

Para instalarla la descomprimiis dentro de /root/ tecleando en una ventana de terminal:

tar xvf gnupg-1.2.3.tar.bz2

o bien desde la utilidad de descompresion del sistema de ventanas de Fedora

Una vez descomprimido entramos en el directorio con cd /root/gnupg-1-2-3 y ejecutamos:

./configure

despues:

make

y finalmente:

make install

Con esto ya tenemos instalado el GnuPGP.

Para hacer funcionar correctamente nuestro NocatAuth basico necesitaremos instalar 2 paquetes adicionales de Perl que no vienen habitualmente en las instalaciones de Fedora : Digest::MD5 y Net::Netmask

NOTA IMPORTANTE: En la versión 6 de Fedora es necesario instalar los dos paquetes de Perl desde CPAN

Para instalar el paquete Net::Netmask en las versiones 4 o 5 de Fedora podemos hacerlo de forma facil utilizando el yum , es decir, la herramienta de instalacion y actualizacion de paquetes que usa Fedora. Bastara con escribir en una ventana del terminal: yum install perl-Net-Netmask y el paquete se instalara automaticamente.

Para instalar el paquete Digest::MD5 tendremos que hacerlo desde CPAN, al igual que debereis hacerlo con el paquete Net::Netmask si utilizais la versión 6 de Fedora, que es, de hecho, la herramienta de Perl para la instalacion de nuevos paquetes de Perl. De hecho podiamos haber hecho lo mismo anteriormente con el paquete Net::Netmask pero, de esta forma, habeis conocido tambien el yum.

Para ello, desde la ventana del terminal tecleamos:

perl -MCPAN -e 'install Digest::MD5'

y , al ser la primera vez que lo usamos, nos pedira que configuremos CPAN para nuestra maquina. No os asusteis, empezara a pediros multitud de conceptos que, posiblemente, si no estais familiarizados con Linux, os sonaran a "chino", basta con que le deis "Enter" a todas las opciones que os vaya pidiendo para que aplique la configuracion por defecto. Solamente debeis indicarle la zona "Europe" cuando os pregunte donde estais (en el caso de que asi sea), en pais España (el 29) y los servidores a los que deseais acceder para bajaros los paquetes donde es conveniente elegirlos todos, en nuestro caso 1 2 3 4 como podeis ver en la secuencia siguiente. Hemos marcado en rojo solamente los parametros que debeis elegir:

We have to reconfigure CPAN.pm due to following uninitialized parameters:

cpan_home, keep_source_where, build_dir, build_cache, scan_cache, index_expire, gzip, tar, unzip, make, pager, makepl_arg, make_arg, make_install_arg, urllist, inhibit_startup_message, ftp_proxy, http_proxy, no_proxy, prerequisites_policy, cache_metadata

/usr/lib/perl5/5.8.6/CPAN/Config.pm initialized.


CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes]


The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide directory or a personal directory.

First of all, I'd like to create this directory. Where?

CPAN build and cache directory? [/root/.cpan]


If you want, I can keep the source files after a build in the cpan
home directory. If you choose so then future builds will take the
files from there. If you don't want to keep them, answer 0 to the
next question.

How big should the disk cache be for keeping the build directories
with all the intermediate files?

Cache size for build directory (in MB)? [10]


By default, each time the CPAN module is started, cache scanning
is performed to keep the cache size in sync. To prevent from this,
disable the cache scanning with 'never'.

Perform cache scanning (atstart or never)? [atstart]


To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable
is not available, the normal index mechanism will be used.

Cache metadata (yes/no)? [yes]


The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.

Your terminal expects ISO-8859-1 (yes/no)? [yes]


If you have one of the readline packages (Term::ReadLine::Perl,
Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
shell will have history support. The next two questions deal with the
filename of the history file and with its size. If you do not want to
set this variable, please hit SPACE RETURN to the following question.

File to save your history? [/root/.cpan/histfile]
Number of lines to save? [100]


The CPAN module can detect when a module that which you are trying to
build depends on prerequisites. If this happens, it can build the
prerequisites for you automatically ('follow'), ask you for
confirmation ('ask'), or just ignore them ('ignore'). Please set your
policy to one of the three values.

Policy on building prerequisites (follow, ask or ignore)? [ask]


The CPAN module will need a few external programs to work properly.
Please correct me, if I guess the wrong path for a program. Don't
panic if you do not have some of them, just press ENTER for those. To
disable the use of a download program, you can type a space followed
by ENTER.

Where is your gzip program? [/bin/gzip]
Where is your tar program? [/bin/tar]
Where is your unzip program? [/usr/bin/unzip]
Where is your make program? [/usr/bin/make]
Where is your links program? [/usr/bin/links]
Where is your wget program? [/usr/bin/wget]
Warning: ncftpget not found in PATH
Where is your ncftpget program? []
Warning: ncftp not found in PATH
Where is your ncftp program? []
Where is your ftp program? [/usr/kerberos/bin/ftp]
Where is your gpg program? [/usr/bin/gpg]
What is your favorite pager program? [/usr/bin/less]
What is your favorite shell? [/bin/bash]


Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in processes. If you have any
parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
to the calls, please specify them here.

If you don't understand this question, just press ENTER.

Parameters for the 'perl Makefile.PL' command?
Typical frequently used settings:

PREFIX=~/perl non-root users (please see manual for more hints)

Your choice: []
Parameters for the 'make' command?
Typical frequently used setting:

-j3 dual processor system

Your choice: []
Parameters for the 'make install' command?
Typical frequently used setting:

UNINST=1 to always uninstall potentially conflicting files

Your choice: []


Sometimes you may wish to leave the processes run by CPAN alone
without caring about them. As sometimes the Makefile.PL contains
question you're expected to answer, you can set a timer that will
kill a 'perl Makefile.PL' process after the specified time in seconds.

If you set this value to 0, these processes will wait forever. This is
the default and recommended setting.

Timeout for inactivity during Makefile.PL? [0]


If you're accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

Your ftp_proxy?
Your http_proxy?
Your no_proxy?

You have no /root/.cpan/sources/MIRRORED.BY
I'm trying to fetch one
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY


Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won't
work). If you are mirroring CPAN to your local workstation, specify a
file: URL.

First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs -- file:, ftp:, or
http: -- that host a CPAN mirror.

(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 4
Sorry! since you don't have any existing picks, you must make a
geographic selection.

(1) Austria
(2) Belgium
(3) Bosnia and Herzegovina
(4) Bulgaria
(5) Croatia
(6) Czech Republic
(7) Denmark
(8) Estonia
(9) Finland
(10) France
(11) Germany
(12) Greece
(13) Hungary
(14) Iceland
(15) Ireland
(16) Italy
17 more items, hit SPACE RETURN to show them
Select your country (or several nearby countries) []
Sorry! since you don't have any existing picks, you must make a
geographic selection.

(17) Latvia
(18) Lithuania
(19) Malta
(20) Moldova
(21) Netherlands
(22) Norway
(23) Poland
(24) Portugal
(25) Romania
(26) Russia
(27) Slovakia
(28) Slovenia
(29) Spain
(30) Sweden
(31) Switzerland
(32) Ukraine
1 more items, hit SPACE RETURN to show them
Select your country (or several nearby countries) [] 29
Sorry! since you don't have any existing picks, you must make a
geographic selection.

(1) ftp://ftp.etse.urv.es/pub/perl/
(2) ftp://ftp.rediris.es/mirror/CPAN/
(3) ftp://ftp.ri.telefonica-data.net/CPAN
(4) http://cpan.imasd.elmundo.es/
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. '1 4 5' [] 1 2 3 4

Enter another URL or RETURN to quit: []
New set of picks:
ftp://ftp.etse.urv.es/pub/perl/
ftp://ftp.rediris.es/mirror/CPAN/
ftp://ftp.ri.telefonica-data.net/CPAN
http://cpan.imasd.elmundo.es/


commit: wrote /usr/lib/perl5/5.8.6/CPAN/Config.pm
CPAN: Storable loaded ok
Fetching with LWP:
ftp://ftp.etse.urv.es/pub/perl/authors/01mailrc.txt.gz
Going to read /root/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Fetching with LWP:
ftp://ftp.etse.urv.es/pub/perl/modules/02packages.details.txt.gz
Going to read /root/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Sun, 19 Mar 2006 05:11:06 GMT

There's a new CPAN.pm version (v1.87) available!
[Current version is v1.7601]
You might want to try
install Bundle::CPAN
reload cpan
without quitting the current session. It should be a seamless upgrade
while we are running...

Fetching with LWP:
ftp://ftp.etse.urv.es/pub/perl/modules/03modlist.data.gz
Going to read /root/.cpan/sources/modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Running install for module Digest::MD5
Running make for G/GA/GAAS/Digest-MD5-2.36.tar.gz
Fetching with LWP:
ftp://ftp.etse.urv.es/pub/perl/authors/id/G/GA/GAAS/Digest-MD5-2.36.tar.gz
CPAN: Digest::MD5 loaded ok
Fetching with LWP:
ftp://ftp.etse.urv.es/pub/perl/authors/id/G/GA/GAAS/CHECKSUMS
Checksum for /root/.cpan/sources/authors/id/G/GA/GAAS/Digest-MD5-2.36.tar.gz ok
Scanning cache /root/.cpan/build for sizes
Digest-MD5-2.36/
Digest-MD5-2.36/t/
Digest-MD5-2.36/t/md5-aaa.t
Digest-MD5-2.36/t/clone.t
Digest-MD5-2.36/t/badfile.t
Digest-MD5-2.36/t/utf8.t
Digest-MD5-2.36/t/bits.t
Digest-MD5-2.36/t/align.t
Digest-MD5-2.36/t/files.t
Digest-MD5-2.36/README
Digest-MD5-2.36/MANIFEST
Digest-MD5-2.36/hints/
Digest-MD5-2.36/hints/MacOS.pl
Digest-MD5-2.36/hints/irix_6.pl
Digest-MD5-2.36/hints/dec_osf.pl
Digest-MD5-2.36/Changes
Digest-MD5-2.36/Makefile.PL
Digest-MD5-2.36/MD5.xs
Digest-MD5-2.36/typemap
Digest-MD5-2.36/MD5.pm
Digest-MD5-2.36/rfc1321.txt

CPAN.pm: Going to build G/GA/GAAS/Digest-MD5-2.36.tar.gz

Perl's config says that U32 access must not be aligned.
Checking if your kit is complete...
Looks good
Writing Makefile for Digest::MD5
cp MD5.pm blib/lib/Digest/MD5.pm
/usr/bin/perl /usr/lib/perl5/5.8.6/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.6/ExtUtils/typemap -typemap typemap MD5.xs > MD5.xsc && mv MD5.xsc MD5.c
gcc -c -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -DVERSION=\"2.36\" -DXS_VERSION=\"2.36\" -fPIC "-I/usr/lib/perl5/5.8.6/i386-linux-thread-multi/CORE" MD5.c
Running Mkbootstrap for Digest::MD5 ()
chmod 644 MD5.bs
rm -f blib/arch/auto/Digest/MD5/MD5.so
gcc -shared -L/usr/local/lib MD5.o -o blib/arch/auto/Digest/MD5/MD5.so
chmod 755 blib/arch/auto/Digest/MD5/MD5.so
cp MD5.bs blib/arch/auto/Digest/MD5/MD5.bs
chmod 644 blib/arch/auto/Digest/MD5/MD5.bs
Manifying blib/man3/Digest::MD5.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/align......ok
t/badfile....ok
t/bits.......ok
t/clone......ok
t/files......ok
t/md5-aaa....ok
t/utf8.......ok
All tests successful.
Files=7, Tests=275, 2 wallclock secs ( 1.20 cusr + 0.24 csys = 1.44 CPU)
/usr/bin/make test -- OK
Running make install
Installing /usr/lib/perl5/5.8.6/i386-linux-thread-multi/auto/Digest/MD5/MD5.so
Installing /usr/lib/perl5/5.8.6/i386-linux-thread-multi/auto/Digest/MD5/MD5.bs
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib/perl5/5.8.6/i386-linux-thread-multi/Digest/MD5.pm
Installing /usr/share/man/man3/Digest::MD5.3pm
Writing /usr/lib/perl5/5.8.6/i386-linux-thread-multi/auto/Digest/MD5/.packlist
Appending installation info to /usr/lib/perl5/5.8.6/i386-linux-thread-multi/perllocal.pod
/usr/bin/make install -- OK
[root@localhost ~]#

Una vez instalados y configurados los anteriores pasos ya tenemos instalado too lo necesario a excepción de NoCatAuth y estamos ya en disposicion de reiniciar el ordenador y comprobar si desde el Punto de Acceso tenemos conexion a Internet a traves del puente de red que hemos instalado entre las dos tarjetas. Si llegados a este punto no puedes conectarte aun a Internet desde tu enlace con el AP vuelve atras y revisa todos los puntos uno a uno ya que, si esto no funciona, todo lo que hay a partir de aqui tampoco te funcionara.

Asi pues, desde nuestro ordenador "remoto" y conectados a nuestro Punto de Acceso abrimos el navegador e intentamos el acceso a nuestra pagina favorita:

Si has llegado hasta aqui y el "gateway" te funciona, ENHORABUENA!!...ya tienes el 50% del proyecto en marcha.

 

Anterior            Siguiente


Si consideras que este tutorial te ha sido útil y te ha ahorrado tiempo, problemas y dolores de cabeza, cualquier donación será bienvenida y destinada a la expansión del Wireless en general  y al mantenimiento de la red Wireless de OlotWireless. Puedes hacer efectiva tu colaboración  haciendo una transferencia a la cuenta 2030 0091 11 3300004824. Gracias.
©Pere Espunya. EA3CUU  para Unión de Radioaficionados Españoles