[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anteriorRevisión previa
Próxima revisión
Revisión previa
es:howtos:network_services:running_an_access_point_from_a_slackware_box [2019/04/05 02:22 (UTC)] – [3 Software Requirements] antares_alfes:howtos:network_services:running_an_access_point_from_a_slackware_box [2019/07/05 02:07 (UTC)] (actual) – [4.6 Dynamic DNS] antares_alf
Línea 30: Línea 30:
 Otro error común es hacer redes SSID WiFi ocultas: en términos de seguridad, en realidad es menos seguro porque hacer que a los clientes les resulte más difícil encontrar el AP hace que sea más fácil para un usuario malintencionado acceder a la LAN inalámbrica. No hagamos nuestro WiFi con un ssid oculto. Otro error común es hacer redes SSID WiFi ocultas: en términos de seguridad, en realidad es menos seguro porque hacer que a los clientes les resulte más difícil encontrar el AP hace que sea más fácil para un usuario malintencionado acceder a la LAN inalámbrica. No hagamos nuestro WiFi con un ssid oculto.
  
-===== 3.1 Required Kernel Options ===== +===== 3.1 Opciones de kernel requeridas =====
-The kernel shipped with Slackware has all you need but just in case you build your own you will need to have these options checked along with whatever is required for your hardware to work properly:+
  
-  * 802.1d Ethernet Bridging +El kernel que se incluye con Slackware tiene todo lo que necesita, pero en caso de que construya el suyo, deberá verificar estas opciones junto con lo que sea necesario para que su hardware funcione correctamente:
-  * Network packet filtering framework (Netfilter) [and a lot of sub options in there] (*) +
-  * cfg80211 - wireless configuration API +
-  * cfg80211 wireless extensions compatibility +
-  * Common routines for IEEE802.11 drivers  +
-  * Generic IEEE 802.11 Networking Stack (mac80211) +
  
-(*) If you're not familiar with iptables your best bet is to check all sub options that are not experimental+  802.1d Puente Ethernet 
 +  * Marco de filtrado de paquetes de red (Netfilter[y una gran cantidad de sub opciones allí] (*) 
 +  * cfg80211 - API de configuración inalámbrica 
 +  * cfg80211 compatibilidad de extensiones inalámbricas 
 +  * Rutinas comunes para controladores IEEE802.11  
 +  * Generic IEEE 802.11 Networking Stack (mac80211)
  
-==== 3.1.1 Runtime Kernel Parameters ==== +(*) Si no está familiarizado con iptables, lo mejor es verificar todas las subopciones que no sean experimentales. 
-Here are the runtime kernel parameters I've grouped together in one placelike some other distrosin /etc/sysctl.conf+==== 3.1.1 Parámetros del kernel en tiempo de ejecución ==== 
 +Aquí están los parámetros del kernel en tiempo de ejecución que he agrupado en un solo lugarcomo algunas otras distribucionesen /etc/sysctl.conf
      
   net.ipv6.conf.all.disable_ipv6=1   net.ipv6.conf.all.disable_ipv6=1
Línea 49: Línea 49:
   net.ipv4.conf.all.rp_filter=1   net.ipv4.conf.all.rp_filter=1
   net.ipv4.conf.default.rp_filter=1   net.ipv4.conf.default.rp_filter=1
-  #use this if you get odd behavior vaguely resembling failing to find pmtu +  #usa esto si obtienes un comportamiento extraño que se parece vagamente a no encontrar pmtu
   #net.ipv4.tcp_sack=0   #net.ipv4.tcp_sack=0
   net.ipv4.ip_dynaddr=1   net.ipv4.ip_dynaddr=1
Línea 56: Línea 56:
   net.ipv4.conf.all.accept_redirects=0   net.ipv4.conf.all.accept_redirects=0
   net.ipv4.conf.default.accept_redirects=0   net.ipv4.conf.default.accept_redirects=0
-  #use this if icmp black holes become an issue for you+  #Use esto si los agujeros negros icmp se convierten en un problema para usted
   #net.ipv4.tcp_mtu_probing=1   #net.ipv4.tcp_mtu_probing=1
   #net.ipv4.tcp_base_mss=1024   #net.ipv4.tcp_base_mss=1024
  
-===== 3.2 Slackware Packages =====+===== 3.2 Paquetes de Slackware =====
   * dnsmasq   * dnsmasq
   * bridge-utils   * bridge-utils
Línea 71: Línea 71:
   * rp-pppoe (*)   * rp-pppoe (*)
  
-(*) only if you want your AP to actually manage your internet connection+(*)solo si desea que su AP administre realmente su conexión a Internet.
  
  
-===== 3.3 Other Software =====+ 
 +===== 3.3 Otro software =====
   * hostapd   * hostapd
 +Hostapd no se incluye con los paquetes de Slackware y es el único software adicional que necesita para una configuración básica.
 +Para obtener hostapd, puede descargar una versión binaria de alguna fuente confiable o compilarla desde las fuentes. Puede ser que sea un poco mejor compilando desde fuentes, de modo que obtenga una versión bastante reciente, pero depende de usted. Simplemente no intentes usar versiones muy antiguas de hostapd como 0.6.7 en 2.6+ kernels:hostapd ha seguido los controladores de pila inalámbrica del kernel y ha pasado de ser compatible con dispositivos FullMAC a SoftMAC en casi todos los dispositivos a través del nl80211. Hoy en día, la combinación de hardware y controlador compatible con FullMAC es difícil de conseguir (Prism2/2.5/3 y Atheros ar521x) todos los demás tienen que usar SoftMAC, por lo que sugiero ignorar los 2 que aún podrían hacerlo con FullMAC y solo ir a SoftMAC para todos, lo que le permite usar casi cualquier tarjeta WiFi para crear un AP. Si lo desea, puede leer más sobre [[http://wireless.kernel.org/en/developers/Documentation/mac80211 | mac80211 aquí]].
  
-Hostapd is not shipped with Slackware packages and is the only extra software you need for a basic setup. +Las fuentes de Hostapd se pueden descargar desde [[http://w1.fi/hostapd/ | aquí]], debería ver la versión estable reciente (2.5 la última vez que se editó este artículo) y evitar el desarrollo/las ramas antiguas. 
-To obtain hostapd you could either download a binary version from some reliable source or compile it from sources. You might be slightly better off compiling from sources, so that you get e fairly recent version, but it's up to you. Just don't try using really old hostapd versions like 0.6.7 on 2.6+ kernels: hostapd has followed the kernel wireless stack drivers and transitioned from only supporting FullMAC devices to supporting SoftMAC on almost all devices trough nl80211. Nowadays the combination of both hardware and driver supporting FullMAC is hard to come by (Prism2/2.5/3, and Atheros ar521x) all the others need to go the SoftMAC way so I suggest ignoring the 2 that could still go the FullMAC way and just go for SoftMAC for all, allowing you to use almost any WiFi card for creating an AP. If you like you can read more about [[http://wireless.kernel.org/en/developers/Documentation/mac80211  mac80211 here]].+Compilar hostapd es realmente simple:
  
-Hostapd sources can be downloaded from [[http://w1.fi/hostapd/ | here]], you should be looking at recent stable version (2.5 last time this article was edited) and avoid the development/old branches. +  extraer las fuentes 
-Compiling hostapd is really simple: +  - ingrese al árbol de origen (debería ver algo como estoCONTRIBUCIONES DE COPIA DE README hostapd/ patches/ src/) 
-  extract the sources +  - ingrese al subdirectorio hostapd (de aquí en adelante nos referiremos a esta carpeta como HOSTAPD_SOURCE_TREE) 
-  - enter the source tree (you should see something like thisCONTRIBUTIONS  COPYING  README  hostapd/  patches/  src/) +  - edite el archivo defconfig y habilite las funciones opcionales que necesite (la configuración predeterminada es buena para una configuración simple) 
-  - enter the hostapd sub-directory (we shall refer to this folder as HOSTAPD_SOURCE_TREE from here on+  - Copie el archivo defconfig .config
-  - edit the defconfig file and enable any optional features you need (default is fine for a simple setup+
-  - copy the defconfig file to .config+
   - make   - make
-  - make install (or optionally just put in /usr/local/bin just the hostapd binary) +  - make install (u opcionalmente solo coloque en /usr /local /bin solo el binario de hostapd)
- +
-If you are using a cross compiler to target non x86 hardware make sure you have set it up to right: if you have trouble with that you can try a native build as building hostapd is really simple and not demanding on the hardware.+
  
-==== 3.3.1 File Integrity ==== +Si está utilizando un compilador cruzado para apuntar al hardware que no es x86, asegúrese de haberlo configurado correctamente: si tiene problemas, puede intentar una compilación nativa ya que la construcción de hostapd es realmente simple y no requiere mucho hardware. 
-If your AP also acts router it's probably going to be exposed to malware and even if you do your best to keep malicious users out of your work they might still find way inIf your router is exposed to internet you might want to consider some sort of file integrity tool that would alert you if files have been tampered withFile integrity checking could be whole article so I'm not going to go into any detail beyond advising to read more about it on security oriented communities like [[http://www.securityfocus.com|security focus]] or maybe just do a google search on "file integrity tool"  +==== 3.3.1 Integridad de archivos ==== 
-====== 4 Configuring ====== +Si su AP también actúa como un enrutador, probablemente estará expuesto a malware e incluso si hace todo lo posible por mantener los usuarios malintencionados fuera de su trabajo, es posible que todavía encuentren una forma de ingresarSi su enrutador está expuesto a Internet, es posible que desee considerar algún tipo de herramienta de integridad de archivos que le avise si los archivos han sido manipuladosLa verificación de la integridad de los archivos podría ser un artículo completo, por lo que no voy entrar en detalles más allá de recomendar que lea más sobre las comunidades orientadas a la seguridad como [[http://www.securityfocus.com|security focus]] o tal vez solo hacer una búsqueda de google en 'herramienta de integridad de archivos'
-Now let's have a look at how to configure everything to that it will work right.+====== 4 Configurando ======
  
 +Ahora veamos cómo configurar todo para que funcione correctamente.
 ===== 4.1 Hostapd ===== ===== 4.1 Hostapd =====
-Create hostapd folder inside /etc and copy into it a few files:+Cree una carpeta hostapd dentro de /etc y copie en ella algunos archivos:
   mkdir /etc/hostapd   mkdir /etc/hostapd
   cp HOSTAPD_SOURCE_TREE/hostapd.conf /etc/hostapd/hostapd.template   cp HOSTAPD_SOURCE_TREE/hostapd.conf /etc/hostapd/hostapd.template
   cp HOSTAPD_SOURCE_TREE/hostapd.wpa_psk /etc/hostapd/   cp HOSTAPD_SOURCE_TREE/hostapd.wpa_psk /etc/hostapd/
      
-Now supposing that wlan0 is the interface you will be using for creating the AP I suggest that you copy hostapd.template to wlan0.conf or br0.conf if it's bridged.+Ahora, suponiendo que wlan0 es la interfaz que utilizará para crear el AP, le sugiero que copie hostapd.template wlan0.conf br0.conf si está enlazado.
   cd /etc/hostapd   cd /etc/hostapd
   cp hostapd.template wlan0.conf   cp hostapd.template wlan0.conf
-alternatively just copy it to hostapd.conf ... but if you like to run several AP you might prefer to differentiate their config files.+como alternativa, simplemente cópielo en hostapd.conf ... pero si desea ejecutar varios AP, es posible que prefiera diferenciar sus archivos de configuración.
  
-These are the things you have-to edit in wlan0.conf+Estas son las cosas que usted tiene que editar en wlan0-conf
   * interface=wlan0   * interface=wlan0
   * driver=nl80211   * driver=nl80211
Línea 128: Línea 128:
   * wpa_ptk_rekey=600   * wpa_ptk_rekey=600
  
-This will use WPA-PSK/WPA2-PSK authenticationHave a look [[http://wireless.kernel.org/en/users/Documentation/hostapd|here]] in the section "A good starting point for a wpa wpa2 enabled access point is:" for more details on authentication.+Esto utilizará autenticación WPA-PSK/WPA2-PSK. Hecha un vistaso [[http://wireless.kernel.org/en/users/Documentation/hostapd|here]] en la sección "Un buen punto de inicio para un punto de acceso habilitado para wpa wpa2 es:" para más detalles sobre la autenticación.
  
-There are pros and cons for dealing with mac address filtering either with iptables or with mac ACL, to put it in really short terms the main difference is that doing it with iptables allows you to keep all filtering stuff in one place but has tendency to get lengthy if your network has many clients while doing it with mac ACL will require editing of separate file (containing just a newline separated list of mac addressesbut can really simplify things if you have several wired and wireless clinets.+Existen ventajas y desventajas al tratar con el filtrado de direcciones mac, ya sea con iptables o con mac ACL, para ponerlo en términos realmente breves, la principal diferencia es que hacerlo con iptables le permite mantener todas las cosas de filtrado en un solo lugar, pero tiene una tendencia prolongarse si su red tiene muchos clientes mientras lo hace con mac ACL requerirá la edición de un archivo separado (que contiene solo una lista de direcciones mac separadas en una nueva líneapero realmente puede simplificar las cosas si tiene varios clientes cableados e inalámbricas.
  
-The above hostapd configuration has mac ACL so if you followed it closely you should now create your /etc/hostapd/wlan0.accept containing a new line separated list of macs you wish to allow into your wireless networkFailing to do so will not allow any of your wireless clients to authenticate even with the correct credentials.+La configuración de hostapd anterior tiene mac ACL, por lo que si la sigue de cerca, ahora debe crear su /etc/hostapd/wlan0.accept que contiene una nueva lista de macs separados por líneas que desea permitir en su red inalámbricaNo hacerlo no permitirá que ninguno de sus clientes inalámbricos se autentique, incluso con las credenciales correctas.
  
-There is also an option for telling hostapd about bridging but the comment in hostapd.conf states: "If the bridge parameter is not setthe drivers will automatically figure out the bridge interface (assuming sysfs is enabled and mounted to /sys) and this parameter may not be needed"I followed that to the letter and ignored altogether  +También hay una opción para decirle a hostapd sobre el puente, pero el comentario en hostapd.conf dice: "Si el parámetro bridge no está establecidolos controladores descubrirán automáticamente la interfaz del bridge (suponiendo que sysfs esté habilitado y montado en /sys) y este parámetro puede no ser necesario"Lo seguí al pie de la letra y lo ignore por completo. 
-  #bridge=br0   +  #bridge=br0 
-and besides that we'll be brigding the interfaces after having setup the AP. I've not played with this option but I suspect that enabling it and/or brigding before starting up hostapd may result in having the wired clients mandated to using WPA too+y además de eso estaremos armando las interfaces después de haber configurado el AP. No he jugado con esta opción, pero sospecho que habilitarla y/o interrumpirla antes de iniciar hostapd puede resultar en que los clientes cableados tengan la obligación de usar WPA también
- +Ahora es el momento de lidiar con la frase de contraseña para asociarsehay más de una forma de tratar las contraseñas, pero me gusta usar wpa_psk_file ya que permite las contraseñas de NIC, e incluso tener contraseñas diferentes para sus diferentes estaciones wifiSi quieres mantener las cosas simples solo usa el MAC especial "00:00:00:00:00:00" que coincidirá con cada MAC, por lo tanto, tendrá la misma frase de contraseña para todos los clientesAquí hay un ejemplo:
-Now it's time to deal with the passphrase for associatingthere is more then one way of dealing with the passwords but I like to use wpa_psk_file as it allows per NIC passwordsand even have different passwords for your different Wifi staionsIf you want to keep things simple just use the special MAC "00:00:00:00:00:00" that will match with every MAC thus having the same passphrase for all the clientsHere's an example:+
  
   00:00:00:00:00:00 your_psk_for_all_stations   00:00:00:00:00:00 your_psk_for_all_stations
  
 +Ahora deberías estar listo para encender hostapd
  
-Now you should be ready to fire up hostapd 
   /usr/local/bin/hostapd -B /etc/hostapd/wlan0.conf   /usr/local/bin/hostapd -B /etc/hostapd/wlan0.conf
   iwconfig  wlan0   iwconfig  wlan0
Línea 150: Línea 149:
           Power Management:on           Power Management:on
  
-and iwconfig should report that the interface is in master modeIf this fails you either got an old version of hostapd that does not support nl80211 of your kernel lacks the necessary options for supporting nl80211.+iwconfig debe informar que la interfaz está en modo maestroSi esto falla, o bien tiene una versión anterior de hostapd que no es compatible con el nl80211 de su kernel le faltan las opciones necesarias para admitir nl80211. 
 + 
 +Si prefiere usar iw, este es el tipo de salida que debe tener:
  
-If you prefer to use iw instead this is the sort of output you should have: 
   iw dev wlan0 info   iw dev wlan0 info
   Interface wlan0   Interface wlan0
Línea 159: Línea 159:
         wiphy 0         wiphy 0
         channel 6 (2437 MHz) NO HT         channel 6 (2437 MHz) NO HT
-===== 4.2 Bridging ===== +===== 4.2 El puente ===== 
-Now it's time to bridge together wired and Wireless NICsIt's possible to use the native bridge setup from rc.inet1.conf but you may need to restart bridge after starting hostapd so here are the commands necessary to set it up manually.+Ahora es el momento de unir las NIC inalámbricas y por cableEs posible usar la configuración nativa del puente desde rc.inet1.conf, pero es posible que deba reiniciar el puente después de iniciar hostapd, por lo que aquí están los comandos necesarios para configurarlo manualmente.
  
   /usr/sbin/brctl addbr br0   /usr/sbin/brctl addbr br0
Línea 171: Línea 171:
  
  
-===== 4.3 DNS and DHCP Servers ===== +===== 4.3 Servidores DNS DHCP ===== 
-Now it's time to start dnsmasq. You can actually leave it running from boot if you like or even run specific servers at your choiceI now run separate dnsmasq instances for each AP so I've abandoned Slackware'rc.dnsmasq and start it from my custom network scripts which requires separate config files for each interface (like /etc/dnsmasq/br0.conf and /etc/dnsmasw/wlan1.conf). +Ahora es el momento de comenzar dnsmasq. Si lo desea, puede dejarlo ejecutándose desde el arranque o incluso ejecutar servidores específicos a su elección.Ahora ejecuto instancias dnsmasq separadas para cada AP, así que abandoné rc.dnsmasq de Slackware y lo inicio desde mis scripts de red personalizados que requieren archivos de configuración separados para cada interfaz (como /etc/dnsmasq/br0.conf /etc/dnsmasw/wlan1.conf). 
-Configuring it is something you should look into to suit best your networking needs ... let's just look at some of the most common tings. +La configuración es algo que debe considerar para adaptarse mejor a sus necesidades de red... Echemos un vistazo a algunos de los tings más comunes
-Supposing that you want to assign ip addresses belonging to 192.168.0.0/24 and this are the options you will need:+Suponiendo que desea asignar direcciones IP que pertenecen a 192.168.0.0/24 y estas son las opciones que necesitará:
  
   * interface=br0   * interface=br0
Línea 184: Línea 184:
   * conf-dir=/etc/dnsmasq.d   * conf-dir=/etc/dnsmasq.d
  
-The options except-interface bind-interfaces and listen-address are particularly useful if you want to run more then one instance of dnsmasq. +Las opciones except-interface bind-interface y listen-address son particularmente útiles si desea ejecutar más de una instancia de dnsmasq. 
-For the bridge to work correctly don't forget to allow forwarding either by using rc.ip_forward or by executing +Para que el puente funcione correctamente, no olvide permitir el reenvío utilizando rc.ip_forward o ejecutando
   /bin/echo 1 > /proc/sys/net/ipv4/ip_forward   /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
-See section 3.1.1 for the other useful run-time kernel parameters. +Mirar la sección 3.1.1 para los otros parámetros útiles del kernel en tiempo de ejecución.
- +
-===== 4.4 Firewalling ===== +
-Now is a good time to configure your firwall protection. +
-Supposing that the box will be routing packages thought it I'll show some rules that you might find helpfull. +
-This is the output of iptables-save, you can edit it to make the changes you require and then pipe your edited file to iptables-restore. +
-The iptables-save/iptables-restore is a handy way of keeping configuration for easy firewall activation and editing.+
  
 +===== 4.4 Cortafuegos =====
 +Ahora es un buen momento para configurar su protección de firewall.
 +Suponiendo que la caja estará enrutando paquetes, creo que le mostraré algunas reglas que le pueden resultar útiles.
 +Esta es la salida de iptables-save, puede editarla para realizar los cambios que necesita y luego canalizar su archivo editado a iptables-restore.
 +Iptables-save / iptables-restore es una forma práctica de mantener la configuración para una fácil activación y edición del cortafuegos.
      
   *mangle   *mangle
Línea 225: Línea 224:
   COMMIT   COMMIT
  
-NOTE *: Clamping MSS to PMTU can get internet browsing from your LAN working but can brake VPN packetsThe proposed workaround has been made necessary by the increasing tendency of failing to find PMTU. It is not always necessary for you to activate the workaround but be warned that it can equally inadvertently stop working leaving you with an intermittent  problem that is difficult to debugIt can be intermittent because the path your packets take to arrive to any destination on internet is not always the same dew to the necessity of fault tolerance. This note could become whole article on it's own so [[https://blog.cloudflare.com/path-mtu-discovery-in-practice/|here's]] an intresting read on the issue+NOTA *: La fijación de MSS PMTU puede hacer que la navegación por Internet funcione desde su LAN, pero puede frenar los paquetes VPN. La solución propuesta se ha hecho necesaria por la creciente tendencia a no encontrar PMTU. No siempre es necesario que active la solución alternativa, pero tenga en cuenta que también puede dejar de funcionar de manera inadvertida, lo que le deja un problema intermitente que es difícil de depurarPuede ser intermitente porque la ruta que toman sus paquetes para llegar cualquier destino en Internet no siempre es la misma necesidad de tolerancia a fallas. Esta nota podría convertirse en un artículo completo por sí mismo, por lo que [[https://blog.cloudflare.com/path-mtu-discovery-in-practice/|here]] es una lectura interesante sobre el tema.
  
-I generally put the content above in /ect/firewall.cf and add "/usr/sbin/iptables-restore < /etc/firewall.cf" to rc.local.+Generalmente pongo el contenido arriba en /ect/firewall.cf y agrego "/usr/sbin/iptables-restore < /etc/firewall.cf" rc.local. 
  
-If you want to manage your AP via ssh now is good time to restart sshd that did not appreciate taking down the interfaces it was binding on (back in section 4.2).+Si desea administrar su AP a través de ssh ahora es un buen momento para reiniciar sshd que no estaba de acuerdo en eliminar las interfaces con las que estaba enlazado (en la sección 4.2).
   /etc/rc.d/rc.sshd restart   /etc/rc.d/rc.sshd restart
-If you're going to share internet connection you might want to stop ssh access from internet by adding a firewall rule to regulate it or making sshd bind only to the address assigned to br0. The config shown above will not allow incoming ssh traffic from the internet link (by the connection tracking rulebut you may want to back that up with further safety+Si va compartir la conexión a Internet, es posible que desee detener el acceso a ssh desde Internet agregando una regla de firewall para regularlo o haciendo que sshd se enlace solo a la dirección asignada a br0. La configuración que se muestra arriba no permitirá el tráfico ssh entrante desde el enlace de Internet (según la regla de seguimiento de la conexión), pero es posible que desee realizar una copia de seguridad con mayor seguridad
-Longer iptabls chains generally have bad impact on firewall performance so you might want to add something like this to /etc/ssh/sshd_config:+Las cadenas de iptabls más largas generalmente tienen un impacto negativo en el rendimiento del firewall, por lo que es posible que desee agregar algo como esto a /etc/ssh/sshd_config:
   ListenAddress 192.168.0.1   ListenAddress 192.168.0.1
 +En este punto, debe poder asociar clientes al AP.
 +Con las reglas de iptables anteriores, el cliente con MAC 0a:0b:0c:0d:0e:0f puede asociarse y acceder al AP en sí, pero no puede enrutar a través del AP (con la excepción de las consultas dns que son enviadas por dnsmasq),el cliente con MAC 00:01:02:03:04:05 puede enrutar el AP pero no acceder al AP en sí. El ejemplo fue simplemente para mostrar claramente la diferencia de tener paquetes que van a la caja y enrutar paquetes a través de la caja ya que este comportamiento fue radicalmente diferente en las ip_chains.
 +Otra forma de implementar MAC ACL aún más compleja para decidir quién administra AP, quién solo puede enrutar y quién puede hacer ambas cosas se puede hacer mediante ebtables (es necesario agregar eso a la lista de software que no está presente en Slackware) y jugar con el cadena de broute En todos los casos, puede encontrar interesante el [[http://en.wikipedia.org/wiki/Iptablesmediaviewer/File:Netfilter-packet-flow.svg | diagrama de flujo de filtros de red]].
  
-At this point you should be able to associate clients to the AP. +Si no desea la ACL de la dirección MAC o solo implementa la ACL de MAC para el AP, puede reemplazar
-With the above iptables rules client with MAC 0a:0b:0c:0d:0e:0f can associate and access the AP itself but not route trough the AP (with the exception of dns querys that get forwarded by dnsmasq), +
-client with MAC 00:01:02:03:04:05 can route thought the AP but not access the AP itself. The example was just to show clearly the difference of having packets go into the box and routing packets trough the box as this behavior was radically different in the ip_chains.  +
-An other way to implement even more complex MAC ACL to decide who manages AP, who can only route trough and who can do both can be done by using ebtables (nee to add that to the software list not present in Slackware) and fiddle with the broute chain. In all cases you might find interesting the [[http://en.wikipedia.org/wiki/Iptables#mediaviewer/File:Netfilter-packet-flow.svg | netfilter flow diagram]].+
  
- 
- 
-If you don't want MAC address ACL or you only implement MAC ACL for the AP you could replace  
-   
   -A INPUT -p icmp -s 192.168.1.0/24 -j ACCEPT   -A INPUT -p icmp -s 192.168.1.0/24 -j ACCEPT
   -A INPUT -p tcp --dport 53 -s 192.168.0.0/24 -j ACCEPT -m comment --comment "allow dns from LAN"   -A INPUT -p tcp --dport 53 -s 192.168.0.0/24 -j ACCEPT -m comment --comment "allow dns from LAN"
Línea 252: Línea 247:
   -A FORWARD -m mac --mac-source 00:01:02:03:04:05 -j ACCEPT -m comment --comment "some other comment"   -A FORWARD -m mac --mac-source 00:01:02:03:04:05 -j ACCEPT -m comment --comment "some other comment"
  
-With something like this +Con algo como esto
      
   -A INPUT -p all -i br0 -j ACCEPT   -A INPUT -p all -i br0 -j ACCEPT
   -A FORWARD -p all -i br0 -j ACCEPT   -A FORWARD -p all -i br0 -j ACCEPT
  
-Most off the shelf AP also let you do a number of port forwardingthis is also an iptables jobRemember that we are masquerading all outgoing traffic to look like it's coming from the AP itself so we only need to create rules of the incoming trafficSupposing you want to run a web server on 192.168.0.2 you might want to add a rule like this in the FORWARD chain of the filter table+La mayoría de los AP disponibles también le permiten hacer una cantidad de reenvío de puertosesto también es un trabajo de iptables. Recuerde que estamos enmascarando todo el tráfico saliente para que parezca que viene del propio AP, por lo que solo necesitamos crear reglas del tráfico entranteSuponiendo que desea ejecutar un servidor web en 192.168.0.2 es posible que desee agregar una regla como esta en la cadena FORWARD de la tabla de filtro
-  +
   -A FORWARD -p tcp -d 192.168.0.2 -m multiport --dports 80,443 -j ACCEPT -m comment --comment "allow http traffic to be routed thought the box only to the correct server"   -A FORWARD -p tcp -d 192.168.0.2 -m multiport --dports 80,443 -j ACCEPT -m comment --comment "allow http traffic to be routed thought the box only to the correct server"
  
-and a rule like this in the PREROUTING chain of the nat table:+y una regla como esta en la cadena PREROUTING de la tabla nat:
      
   -A PREROUTING -p tcp -m multiport --dports 80,443 -j DNAT --to-destination 192.168.0.2 -m comment --comment "nat incomming http requests to local destination before routing"   -A PREROUTING -p tcp -m multiport --dports 80,443 -j DNAT --to-destination 192.168.0.2 -m comment --comment "nat incomming http requests to local destination before routing"
  
-To understand how this works you need to look at the [[http://en.wikipedia.org/wiki/Iptables#mediaviewer/File:Netfilter-packet-flow.svg | netfilter flow diagram]]: +Para entender cómo funciona esto, debe consultar el [[http://en.wikipedia.org/wiki/Iptablesmediaviewer/File:Netfilter-packet-flow.svg | diagrama de flujo de filtro de red]]: 
-As a http request arrives to the AP from the internet link it will first have the DNAT changed in the nat prerouting stagebut it would get dropped by the filter policy if we don't find a way to let it inthat's where the forward filter rule comes in to play.+Cuando una solicitud http llega al AP desde el enlace de Internet, primero se cambiará el DNAT en la etapa de pre-enrutamiento nat, pero la política de filtro la eliminará si no encontramos una manera de déjalo entrarahí es donde entra en juego la regla de filtro de avance.
  
-If you start going crazy over transferring large files over fast networks for problem that seems like mtu related but is not you might want to consider turning net.ipv4.tcp_sack off.+Si comienza volverse loco con la transferencia de archivos grandes a través de redes rápidas para un problema que parece estar relacionado con mtu pero no es posible que desee considerar la posibilidad de desactivar net.ipv4.tcp_sack.
  
-If your ISP gives you some sort of traffic quota you may want to add some quotas to your firewall configurationYou may fully understand the consequences of streaming on your ISP quota but maybe the rest of the family may notgiving them quota might save you a fit when you need to do an urgent job that requires internet connectionThere a re various ways you could go about putting quotas on specific clients on your LAN just keep in mind a few things: +Si su ISP le da algún tipo de cuota de tráfico, es posible que desee agregar algunas cuotas a la configuración de su firewall. Es posible que entienda completamente las consecuencias de la transmisión en su cuota de ISP, pero tal vez el resto de la familia no lo hagadarles una cuota podría ahorrarle un ajuste cuando necesite hacer un trabajo urgente que requiera conexión InternetHay varias maneras en las que podría establecer cuotas en clientes específicos en su LAN, solo tenga en cuenta algunas cosas:
-  * rules with quotas stop matching once quota is exceeded  +
-  * flushing your tables will reset all quota counters +
-  * quota counters do not reset themselves whenever your ISP resets your internet quota+
  
-Here's an example of how you could go about putting a quota on the FORWARD chain to stop client using more then 300Mb daily:+  * las reglas con cuotas dejan de coincidir una vez que se excede la cuota 
 +  * el lavado de sus tablas reiniciará todos los contadores de cuotas 
 +  * los contadores de cuota no se reinician cuando su ISP restablece su cuota de Internet 
 + 
 +Este es un ejemplo de cómo podría poner una cuota en la cadena FORWARD para detener un cliente que usa más de 300Mb diarios:
      
   -A FORWARD -p all -m conntrack --ctstate ESTABLISHED,RELATED ! -d 192.168.0.200 -j ACCEPT -m comment --comment "allow related traffic but not for 192.168.0.200 that has a quota"   -A FORWARD -p all -m conntrack --ctstate ESTABLISHED,RELATED ! -d 192.168.0.200 -j ACCEPT -m comment --comment "allow related traffic but not for 192.168.0.200 that has a quota"
Línea 284: Línea 279:
   -A FORWARD -s 192.168.0.200 -d 192.168.0.0/24 -j ACCEPT -m quota --quota 314572800 -m comment --comment "allow LAN traffic anyway for 192.168.0.200"   -A FORWARD -s 192.168.0.200 -d 192.168.0.0/24 -j ACCEPT -m quota --quota 314572800 -m comment --comment "allow LAN traffic anyway for 192.168.0.200"
  
-Or you could use a user-defined chain to group all your quoted traffic into a single quota like this+O puede usar una cadena definida por el usuario para agrupar todo su cuota de tráfico en una sola cuota como esta:
      
   -A FORWARD -d 192.168.1.0/24 -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "allow quota related traff. to quoted LAN" -j QUOTA   -A FORWARD -d 192.168.1.0/24 -m conntrack --ctstate RELATED,ESTABLISHED -m comment --comment "allow quota related traff. to quoted LAN" -j QUOTA
Línea 291: Línea 286:
   -A QUOTA -m comment --comment "when quota is exceeded start rejecting" -j REJECT --reject-with icmp-port-unreachable   -A QUOTA -m comment --comment "when quota is exceeded start rejecting" -j REJECT --reject-with icmp-port-unreachable
  
-Along with this you need to flush the iptables counters every day (or every how often you wnat the quota counters to resetwith something like this+Junto con esto, debe vaciar los contadores de iptables todos los días (o cada vez que quiera reiniciar los contadores de cuotascon algo como esto
   iptables -Z   iptables -Z
-I generally do this with an AT job because AT has less adverse effects then CRON on readonly systems+ 
-Here's one possible way of making an AT job re schedule itself every day at 00:30:+Generalmente hago esto con un trabajo de AT porque AT tiene menos efectos adversos que CRON en sistemas de solo lectura
 +Aquí hay una manera posible de hacer que un trabajo de AT se programe todos los días a las 00:30:
   # cat /usr/local/bin/flush_iptables_counters    # cat /usr/local/bin/flush_iptables_counters 
   /usr/sbin/iptables -Z   /usr/sbin/iptables -Z
   /usr/bin/at -f /usr/local/bin/flush_iptables_counters "0030 tomorrow"   /usr/bin/at -f /usr/local/bin/flush_iptables_counters "0030 tomorrow"
   #   #
-Just run it once and it should then re schedule itself. On a readonly system you will need to have atjobs directory on tmpfs and run it the first time from rc.local. 
  
 +Simplemente ejecútelo una vez y luego debería volver a programarse. En un sistema de solo lectura, deberá tener el directorio atjobs en tmpfs y ejecutarlo la primera vez desde rc.local.
  
  
 ===== 4.5 PPP ===== ===== 4.5 PPP =====
-Tectonically you're not going to need this on pure access point (AP) but it's common that the AP also acts as router for your internet accessin this case you will need to configure your PPP link from your AP. +Tectónicamente, no va necesitar esto en un punto de acceso puro (AP), pero es común que el AP también actúe como enrutador para su acceso a Interneten este caso necesitará configurar su enlace PPP desde su AP. 
-Depending on how your ISP provides your internet access you might or might not have an external modem which may or may not understand pppoe protocolNowadays it seems to have become less common to have internal *DSL modem wile external modems have become more popularMost of them use pppoe protocolTechnically there's not much difference between configuring an internal modem with just the use of pppd on an external modem that uses pppoe, the former will require an extra package (rp-pppoe) and just a few extra options in the configuration fileI'll show how to configure with the use of pppoe, if that's not your case just strip off a few options.+Dependiendo de la forma en que su ISP le brinde acceso a Internet, puede tener o no un módem externo que puede o no entender el protocolo pppoe. Hoy en día parece que se ha vuelto menos común tener módem *DSL interno mientras que los módems externos se han vuelto más popularesLa mayoría de ellos utilizan el protocolo pppoe. Técnicamente, no hay mucha diferencia entre configurar un módem interno con solo el uso de pppd en un módem externo que usa pppoe, el primero requerirá un paquete adicional (rp-pppoe) y solo algunas opciones adicionales en el archivo de configuraciónMostraré cómo configurar con el uso de pppoe, si ese no es su caso, solo elimine algunas opciones.
  
-If you have installed both ppp and rp-pppoe you will find a that most of the configuration has already been done with most commonly usefull options in /etc/ppp, still there is a limited amount of work that needs to be done and I also advise to detour from the use of pppoe-start to initiate the connection to stick to something that remains the same regardless of whether you're using pppoe or notTo do this I configure a peer for my ISP and add in there few options instructing pppd to use pppoe plugin+Si ha instalado tanto ppp como rp-pppoe, encontrará que la mayoría de la configuración ya se ha realizado con las opciones más comunes en /etc/ppp, aún hay una cantidad limitada de trabajo que debe hacerse y también se aconseja desviarse del uso de pppoe-start para iniciar la conexión para mantener algo que permanece igual, independientemente de si está utilizando pppoe o noPara hacer esto, configuro un igual para mi ISP y agrego algunas opciones que le indican a pppd que use el complemento pppoe.
  
-To do this you need to create a file in /etc/ppp/peers, call it something that will make it obvious to you what the peer will connect tofor instance if your ISM is called "Telco" you might want to create a file called something like /etc/ppp/peers/telco and here's what needs to go in there typically:+Para hacer esto, necesita crear un archivo en /etc/ppp/peers, llámelo como algo que le haga evidente a qué se conectará el peer: por ejemplo, si su ISM se llama "Telco", es posible que desee crear un archivo llamado algo así como /etc/ppp/peers/telco y esto es lo que debe incluir normalmente:
      
   plugin rp-pppoe.so   plugin rp-pppoe.so
Línea 340: Línea 336:
   updetach   updetach
  
-If your ISM charges you based on time rather than band usage you might want to uncomment the idle and demand options so that the PPP connection will not stay alive when it's not actually in use+Si su ISM le cobra por tiempo en lugar del uso de la banda, es posible que desee descomentar las opciones de inactividad y demanda para que la conexión PPP no permanezca activa cuando no esté en uso
-Pot as much as you can here in the peer and as little as possible in the /etc/ppp/options file so that you can possibly have one or more backup peres that are functional without editing any configuration+Haga lo mejor que pueda aquí en el par y tan poco como sea posible en el archivo /etc/ppp/options, de modo que posiblemente pueda tener una o más tareas de copia de seguridad que funcionen sin editar ninguna configuración
-If these options do not work for you I suggest you read the /usr/doc/rp-pppoe-3.11/HOW-TO-CONNECT documentation and use pppoe-setup for a guided configurationfire up the connection with pppoe-start and take not of the options usedthen edit accordingly your peer and revert back to using pppd call <peer>.+Si estas opciones no funcionan para usted, le sugiero que lea la documentación /usr/doc/rp-pppoe-3.11/HOW-TO-CONNECT use pppoe-setup para una configuración guiadainicie la conexión con pppoe-start y tome No es una de las opciones utilizadasluego edite en consecuencia a su par y vuelva a usar pppd call <peer>.
  
-We're not done yet we need to edit pap-secrets or chap-secrets so that pppd can complete authenticationWhich file needs to be addressed may depend on your isp but if you put the same content in both then you should be ok whatever your ISP requires.+Aún no hemos terminado. Necesitamos editar pap-secrets chap-secrets para que pppd pueda completar la autenticaciónEl archivo que deba abordarse puede depender de su ISP, pero si coloca el mismo contenido en ambos, debería estar bien, independientemente de lo que requiera su ISP.
  
-   
   # Secrets for authentication using PAP   # Secrets for authentication using PAP
   # client        server  secret                  IP addresses   # client        server  secret                  IP addresses
   "username your ISM gave you"  *       "password your ISM gave you"   "username your ISM gave you"  *       "password your ISM gave you"
  
-You can now fire up your internet connection with+Ahora puede activar su conexión a Internet con
   pppd call telco   pppd call telco
  
-===== 4.6 Dynamic DNS ===== +===== 4.6 DNS Dinámico ===== 
-If you are going to do the port forwarding thing and if you ISP is not giving you static IP you might want to use some sort of dynamic DNS service so that people can reach whatever service you are forwarding+Si va hacer el reenvío de puertos y si su ISP no le proporciona una IP estática, es posible que desee utilizar algún tipo de servicio de DNS dinámico para que las personas puedan acceder al servicio que está reenviando
-There are many free dynamic DNS service providers ... google is your friend if you don't like any of the ones I'm suggesting:+ 
 +Hay muchos proveedores de servicios DNS dinámicos gratuitos... google es tu amigo si no te gustan ninguno de los que te sugiero: 
   * http://www.gnutomorrow.com/r/namecheap   * http://www.gnutomorrow.com/r/namecheap
   * http://www.dnsexit.com/   * http://www.dnsexit.com/
Línea 363: Línea 360:
  
  
-Most give you a client for managing the update ... all you need do is arrange for that client to run either from the router or from any other pc in your LAN with internet access. +La mayoría le brinda un cliente para administrar la actualización... todo lo que necesita hacer es organizar que el cliente se ejecute desde el enrutador o desde cualquier otra PC de su LAN con acceso a Internet.
- +
 ===== 4.7 Configuring Clients ===== ===== 4.7 Configuring Clients =====
 For the client side configurations there are many ways too, to keep things simple let's just go about it by using wpa_supplicant. Remember that regardless of whether it's a wired or wireless client: if you're using managing MAC ACL from iptables your client's MAC address needs to be added to the firewall configuration while ff you're doing MAC ACL just with hostapd then you only need to make sure your wireless clients are in the ACL. For the client side configurations there are many ways too, to keep things simple let's just go about it by using wpa_supplicant. Remember that regardless of whether it's a wired or wireless client: if you're using managing MAC ACL from iptables your client's MAC address needs to be added to the firewall configuration while ff you're doing MAC ACL just with hostapd then you only need to make sure your wireless clients are in the ACL.
 es:howtos:network_services:running_an_access_point_from_a_slackware_box ()