[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:ethernet_bridging_with_openvpn [2019/02/15 22:05 (UTC)] – [Configuración de la máquina virtual en VirtualBox] rrampes:howtos:network_services:ethernet_bridging_with_openvpn [2019/03/18 06:56 (UTC)] (actual) – [Fuentes] rramp
Línea 1: Línea 1:
-<note warning>En proceso de traducción. rramp</note> 
 <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). -->
 ====== Puente ethernet con OpenVPN ====== ====== Puente ethernet con OpenVPN ======
  
 Otras guías detallan la configuración de OpenVPN para un puente 'tun', donde el tráfico es enrutado eficientemente entre un par de sitios alejados geográficamente, pero esta guía trata acerca de los puentes 'tap'. De hecho, describe cómo unirse a un par de sitios que reenvían todo el tráfico ethernet, independientemente del protocolo. Esto es útil para el desarrollo, probar redes y si necesitas reenviar protocolos que no sean IP. Esto es también más simple que los puentes tun porque no tiene que preocuparse por el enrutamiento, solo se necesita ejecutar un único servidor DHCP en uno u otro lado del puente. Otras guías detallan la configuración de OpenVPN para un puente 'tun', donde el tráfico es enrutado eficientemente entre un par de sitios alejados geográficamente, pero esta guía trata acerca de los puentes 'tap'. De hecho, describe cómo unirse a un par de sitios que reenvían todo el tráfico ethernet, independientemente del protocolo. Esto es útil para el desarrollo, probar redes y si necesitas reenviar protocolos que no sean IP. Esto es también más simple que los puentes tun porque no tiene que preocuparse por el enrutamiento, solo se necesita ejecutar un único servidor DHCP en uno u otro lado del puente.
 +===== Acerca de OpenVPN =====
 +OpenVPN es cubierto en [[openvpn|este otro artículo]], así que haré referencias a las secciones en lugar de copiar y pegar partes de esto aquí. Espero que esto cubra las brechas necesarias para obtener un puente ethernet que funcione.
  
-<del>Other guides detail setting up of OpenVPN for 'tun' bridging, where IP traffic is efficiently routed between a couple of geographically separated sites, but this guide is about so-called 'tap' bridging.  In effect, it describes how to join a couple of sites forwarding all ethernet traffic between, regardless of protocol.  This is useful for development, test networks and if you need to forward non-IP protocols.  It is also conceptually simpler than tun bridging because you don't have to care about routing, and you only need run a single DHCP server on one or other side of the bridge.</del> 
- 
-===== Acerca de OpenVPN ===== 
-OpenVPN es cubierto en [[openvpn|este otro articulo]], así que haré referencias a las secciones en lugar de copiar y pegar partes de esto aquí. Espero que esto cubra las brechas necesarias para obtener un puente ethernet que funcione. 
-<del>OpenVPN is covered in [[openvpn|another article]], so I will reference sections in that rather than just copy-paste parts of it here.  This will hopefully plug the gaps required to get a working ethernet bridge. 
-</del> 
 ===== Introducción ===== ===== Introducción =====
 Solo para que quede claro de qué estamos hablando, aquí hay un diagrama: Solo para que quede claro de qué estamos hablando, aquí hay un diagrama:
  
-<del>Just so we are clear what we're talking about, here is a diagram:</del> 
  
 {{ howtos:network_services:ethernet_bridging_with_openvpn:overview.png }} {{ howtos:network_services:ethernet_bridging_with_openvpn:overview.png }}
Línea 20: Línea 14:
 Hay dos máquinas físicas (cliente PM y servidor PM) y cuatro máquinas virtuales.  Hay dos máquinas físicas (cliente PM y servidor PM) y cuatro máquinas virtuales. 
 El objetivo es que el 'Cliente privado' se comunique directamente con el 'Servidor privado', como si estuvieran en el mismo segmento de Ethernet.  El objetivo es que el 'Cliente privado' se comunique directamente con el 'Servidor privado', como si estuvieran en el mismo segmento de Ethernet. 
-El switch en el medio es solo mi red domestica pero usted puede considerar que se trata de internet si lo desea.  +El conmutador (switchen el medio es solo mi red domestica pero usted puede considerar que se trata de internet si lo desea.  
-Muchas configuraciones reales harán que 'el servidor de puerta de enlace' y el 'servidor privado' sean lo mismo, no hay razón para que sean distintas, sin embargo, siento que es más fácil seguir lo que está sucediendo si son distintas.+Muchas configuraciones reales harán que 'el servidor de puerta de enlace (Server Gateway)' y el 'Servidor privado' sean lo mismo, no hay razón para que sean distintas, sin embargo, siento que es más fácil seguir lo que está sucediendo si son distintas.
  
  
-<del>There are two physical machines (Client PM and Server PM) and four virtual machines.  The aim is that the 'Private Client' talks directly to the 'Private Server', as though they are on the same ethernet segment.  The switch in the middle is just my home network but you could consider that to be the Internet if you like. 
-Many real setups will make the 'Server Gateway' and the 'Private Server' one and the same, there is no reason for them to be separate machines, however I felt it's easier to follow what's going on if they are distinct. 
-</del> 
  
 ===== VirtualBox ===== ===== VirtualBox =====
Línea 32: Línea 23:
 [[https://www.virtualbox.org/ | VirtualBox]] es mi solución preferida para virtualización por que se instala limpiamente en Slackware 14.2 y -current y es fácil de usar. [[https://www.virtualbox.org/ | VirtualBox]] es mi solución preferida para virtualización por que se instala limpiamente en Slackware 14.2 y -current y es fácil de usar.
 ¡Si tiene cuatro máquinas físicas en las que puede instalar Slackware, por supuesto puede hacer todo esto sin virtualización! ¡Si tiene cuatro máquinas físicas en las que puede instalar Slackware, por supuesto puede hacer todo esto sin virtualización!
-En mi caso yo tengo dos máquinas físicas que representan cada 'sitio' que quieres unirte. Todas las máquinas virtuales corren Slackware 14.2 sin parchar. +En mi caso yo tengo dos máquinas físicas que representan cada 'sitio' que quieres unirte. Todas las máquinas virtuales corren Slackware de 64 bit versión 14.2 sin parchar.
- +
  
-<del>[[https://www.virtualbox.org/ | VirtualBox]] is my preferred virtualisation solution because it installs cleanly under Slackware 14.2 and -current and is pretty easy to use. If you happen to have four physical machines on which you can install Slackware you can of course do all of this without virtualisation!  In my case I have two physical machines to represent each 'site' that you want to bridge together.  All virtual machines run un-patched Slackware64 14.2 </del>  
  
 ===== Servidor privado ===== ===== Servidor privado =====
Línea 43: Línea 31:
   * 1024 MB RAM,   * 1024 MB RAM,
   * 8GB de disco duro.   * 8GB de disco duro.
-<del>Without further ado, let's get on with setting up our private server.  I've given the virtual machine the following resources: 
-</del> 
-  * 1024 MB RAM 
-  * 8GB Hard disk 
-</del> 
-En la configuración de red de Virtualbox, le he dicho a la máquina virtual que use 'Red interna' y escribí el nombre de la red 'slacknet' por falta de un nombre mejor. Podrías llamarlo 'privado' si vos querés. Nada alcanzará esta red a menos que configuremos una máquina como enrutador. 
  
-<del>In the VirtualBox network settingsI've told the virtual machine to use 'Internal Networkand I've typed in the network name 'slacknet' for want of a better name You could call it 'privateif you like Nothing will reach this network unless we setup machine as some kind of router to it.</del>+En la configuración de red de Virtualboxle he dicho a la máquina virtual que use 'Red internay escribí el nombre de la red 'slacknet' por falta de un nombre mejor 
 +Si usted quiere podrías llamarlo 'privado'Nada alcanzará esta red menos que configuremos una máquina como enrutador. 
  
 Yo instalé Slackware con el conjunto de discos A, AP, N y L por que no necesito ninguna GUI pero es necesario las herramientas de red, pero esto realmente no importa, si querés podes hacer una instalación completa. Configure esta máquina con una dirección IP estática, en este caso 10.0.0.1. De otra forma, la instalación sigue las opciones por defecto. Yo instalé Slackware con el conjunto de discos A, AP, N y L por que no necesito ninguna GUI pero es necesario las herramientas de red, pero esto realmente no importa, si querés podes hacer una instalación completa. Configure esta máquina con una dirección IP estática, en este caso 10.0.0.1. De otra forma, la instalación sigue las opciones por defecto.
  
-<del>I've told Slackware to install the A, AP, N and L disk sets because I don't need any GUI but want networking stuff, but it doesn't really matter, make it a full install if it pleases you.  I've taken care to give this machine a static IP address, in this case 10.0.0.1.  Otherwise the install is following all defaults.</del>  + 
  
 Luego del arranque, solo hay una cosa que debemos hacer para que esta prueba sea realista. Es necesario habilitar [[dhcp_server_via_dnsmasq | Dnsmasq]]. Luego del arranque, solo hay una cosa que debemos hacer para que esta prueba sea realista. Es necesario habilitar [[dhcp_server_via_dnsmasq | Dnsmasq]].
 Puede seguir ese enlace para obtener más detalles, pero solo necesitamos un pequeño archivo de configuración /etc/dnsmasq.conf que contiene solo: Puede seguir ese enlace para obtener más detalles, pero solo necesitamos un pequeño archivo de configuración /etc/dnsmasq.conf que contiene solo:
  
-<del>After boot there is just one thing we need to do to make this test realistic.  We need to enable [[dhcp_server_via_dnsmasq | Dnsmasq]].  You can follow that link for details, but we just need a small configuration file /etc/dnsmasq.conf containing only: 
-</del> 
  
 <code> <code>
Línea 67: Línea 49:
 </code> </code>
  
-¡Eso es! Haga una copia de respaldo del archivo del antiguo dnsmasq.conf en algún lugar primero si está preocupado por perder todos los comentarios, pero no importa realmente ya que es una máquina de pruebas.+¡Eso es! Primero haga una copia de respaldo del archivo antiguo dnsmasq.conf en algún lugar si está preocupado por perder todos los comentarios, pero no importa realmenteya que es una máquina de pruebas desechable.
 Lo anterior es todo lo que necesita para trabajar con el servidor dhcp. Eso es lo que hace tan grande a Dnsmasq.  Lo anterior es todo lo que necesita para trabajar con el servidor dhcp. Eso es lo que hace tan grande a Dnsmasq. 
-<del> 
-That's it!  Backup the old dnsmasq.conf somewhere first if you're worried about losing all the comments in it, but it doesn't matter, this is really just a throw-away test machine.  The above is all you need for working dhcp server.  That's what makes Dnsmasq so great.</del> 
  
-Ahora solo necesitamos iniciar el servidor: 
-<del>Now we just need to start the server:</del> 
  
 +Ahora solo necesitamos iniciar el servidor:
 <code> <code>
 # chmod 755 /etc/rc.d/rc.dnsmasq # chmod 755 /etc/rc.d/rc.dnsmasq
Línea 80: Línea 59:
 </code> </code>
  
-Entonces ahora tenemos nuestro servidor privado corriendo sobre tu red privada!+¡Entonces ahora tenemos nuestro servidor privado corriendo sobre tu red privada!
 Por el momento, nada puede verlo, pero si instalara otra máquina virtual y la conectara a esa red privada (slacknet), obtendría una dirección IP. Por el momento, nada puede verlo, pero si instalara otra máquina virtual y la conectara a esa red privada (slacknet), obtendría una dirección IP.
 Hemos hecho esto simplemente para demostrar que el tráfico que no es IP (es decir, DHCP) puede atravesar nuestro puente y DHCP es solo una forma conveniente de hacerlo. Hemos hecho esto simplemente para demostrar que el tráfico que no es IP (es decir, DHCP) puede atravesar nuestro puente y DHCP es solo una forma conveniente de hacerlo.
  
-<del>So now we have our private server running on our private network!  Nothing can see it for the moment but if you were to install another virtual machine and connect it to that private (slacknet) network it would get an IP address.  We have done this purely to demonstrate that non-IP (i.e. DHCP) traffic can get across our bridge and DHCP is just a convenient way of doing this.</del> 
  
 ===== Server Gateway ===== ===== Server Gateway =====
Línea 91: Línea 69:
  
 El servidor de puerta de enlace es otra máquina Slackware cuya configuración de memoria es la misma, disco duro y conjuntos de discos  como el 'Servidor privado' anterior. Se diferencia en que tiene un segundo NIC configurado en VirtualBox. El servidor de puerta de enlace es otra máquina Slackware cuya configuración de memoria es la misma, disco duro y conjuntos de discos  como el 'Servidor privado' anterior. Se diferencia en que tiene un segundo NIC configurado en VirtualBox.
-<del>The server gateway is another Slackware machine setup with the same memory, hard disk and disk sets as the 'Private Server' above.  It differs, however in that it has a second NIC configured in VirtualBox. 
-</del> 
  
-El primer NIC en VirtualBox acá 'adaptador 1' en la interfaz gráfica de VirtualBox +El primer NIC en VirtualBox también conocido como 'Adaptador 1' en la interfaz gráfica (GUI) de VirtualBox terminará siendo eth0 en la máquina virtual Slackware iniciadasolo tenga en cuenta esto 
-The first NIC in VirtualBox aka 'Adapter 1' in the VirtualBox GUI will end up being eth0 in the booted Slackware virtual machinejust bear this in mind I will set this as 'Bridged Adapterunder 'Attached to:' in the GUI.   Note that for all NICs I'm setting 'Promiscuous Modeto 'Allow All', although I've no idea if that's needed for all the NICs on all the machines in this guide.+Yo configuraré esto como 'Adaptador puenteadoen 'Adjunto a:' en la GUI. Note que para todas las NICs yo estoy configurando 'modo promiscuo'permitir todo', aunque no tengo idea si eso es necesario para todas las NICs en todas las máquinas de esta guía.
  
-'Adapter 2' will be connected to the 'slacknet' private network discussed in the 'Private Server' configuration above. 
  
-==== Network setup ====+El 'Adaptador 2' se conectará a la red privada 'slacknet' que se describe en la configuración de 'Servidor privado' más arriba.
  
-Now all the questions Slackware asks you during network setup apply to the public interface which is connected directly (via VirtualBox's bridge) to the switch in the middle of the diagram above. Chances are it is your home broadband router which will dish out an IP address and maybe (if you're lucky) an appropriate DNS name.  It matters not, so long as there is something you can use to identify this public interface on the network.  From here on I'm going to refer to this machine's ethernet interface as 'vpn', or we can say 'vpn.localnet', however if you only have an IP address just use that.  The good news is that it doesn't matter if it 'clashes' with the IP address range we talked about in 'Private Server' dnsmasq configuration because... well... it's really private.  Neat huh?  This would obviously be a big issue if we want to later add routing from 'Private Server' to the outside world, but that will be another howto. 
  
-==== tap0 device ====+==== Configuración de red ==== 
 +Ahora todas las preguntas que Slackware le hace durante la configuración de la red se aplican a la interfaz pública que está conectada directamente (a través del puente de VirtualBox) al conmutador (switch) en el centro del diagrama anterior.  
 +Lo más probable es que sea el enrutador de banda ancha de su hogar el que proporcionará una dirección IP y tal vez (si tiene suerte) un servidor de nombres (DNS) apropiado. 
 +No importa, siempre que haya algo que pueda usar para identificar está interfaz pública en la red. 
 +De aquí en adelante, me referiré a la interfaz ethernet de está maquina como 'vpn', o podemos decir 'vpn.localnet', aunque, si solo tiene una dirección IP, solo use esa.
  
-Having installed a nice shiny 2nd Slackware virtual machine with two ethernet cards, only one of which is active we need to do some extra stuff before we talk about OpenVPN. 
  
-The first step is to install [[https://slackbuilds.org/repository/14.2/network/tunctl/?search=tunctl | tunctl]].  I'm going to make the (possibly unfair) assumption that you know how to install Slackware packages from slackbuilds. 
  
-Once tunctl is installededit /etc/rc.d/rc.inet1, find the following lines:+Las buenas noticias es que no importa si esta 'choca' con el rango de direcciones IP de las que hablamos en la configuración de dnsmasq de el 'servidor privado' por que... bueno... esto es realmente privado. 
 +¿Limpio eh? Obviamente, esto sería un gran problema si queremos agregar más adelante el enrutamiento del 'Servidor privado' al mundo exterior, pero ese será otro ejemplo. 
 + 
 +==== dispositivo tap0 ==== 
 + 
 +Habiendo instalado una segunda máquina virtual Slackware con dos tarjetas ethernet, solo una de las cuales está activa, necesitamos hacer algunas cosas adicionales antes de hablar sobre OpenVPN. 
 + 
 + 
 + 
 +El primer paso es instalar [[https://slackbuilds.org/repository/14.2/network/tunctl/?search=tunctl | tunctl]]. 
 +Voy a hacer la suposición (posiblemente injusta) de que sabes cómo instalar paquetes de Slackware desde slackbuilds. 
 + 
 +Una vez instalado tunctl, edita el archivo /etc/rc.d/rc.inet1, busca las siguientes líneas: 
  
 <code> <code>
-Function to start the network:+Funciones para iniciar la red:
 start() { start() {
   lo_up   lo_up
Línea 118: Línea 107:
 </code> </code>
  
-Make them say:+Haz que digan:
  
 <code> <code>
-Function to start the network:+Funciones para iniciar la red:
 start() { start() {
   lo_up   lo_up
Línea 127: Línea 116:
 ... ...
 </code> </code>
 +Esto creará (en el arranque) un dispositivo tap0 con los permisos correctos de modo que OpenVPN pueda acceder a él y, más concretamente, lo  creará antes de que comience la configuración de puentes en los scripts de inicio de Slackware. También se podría crear en rc.local pero se iniciaría demasiado tarde.
  
-This will (on boot) create a tap0 device with the correct permissions such that OpenVPN can access it and, more to the point,  
-it will create it before any of the bridging configuration stuff in the Slackware init scripts kicks in.  rc.local would have it created way too late. 
  
-==== Bridging setup ====+==== configuración del puente ====
  
-OKso now we are talking about [[https://wiki.linuxfoundation.org/networking/bridge | kernel network bridging]], not the ethernet bridging that's the subject of this article.  It's a sad fact that even though we have a NIC purposely allocated to the task of talking to our private network, i.e. not shared with any other traffic, we still need to create a kernel bridge in order for OpenVPN to talk properly to the NIC, in other words we can't tell OpenVPN to just 'use eth1' (oh that it were so simple).  It wants a 'tap' And a tap can only talk to a NIC via a bridge.  So let's have a look at the network config in Slackware.+Okahora estamos hablando acerca de [[https://wiki.linuxfoundation.org/networking/bridge | kernel network bridging]], no del puente ethernet que es el tema de este artículo.
  
-For eth0 in /etc/rc.d/rc.inet1.conf you are going to now have a setup something like thiscourteously supplied by the Slackware netconfig script:+ 
 +Este es un hecho triste que a pesar de que tenemos una NIC asignada a propósito a la tarea de hablar con nuestra red privada, es decir, no se comparte con ningún otro tráfico, todavía necesitamos crear un puente del kernel para que OpenVPN pueda hablar correctamente con la NIC. En otras palabras, no podemos decirle a OpenVPN que simplemente 'use eth1' (o que sea tan simple).  
 +Esto requiere un dispositivo 'tap'. Y un tap puede solo hablar a un dispositivo NIC a través de un puente. 
 +Así que echemos un vistazo a la configuración de red en Slackware. 
 + 
 +Para el dispositivo eth0 en /etc/rc.d/rc.inet1.conf ahora tendrá una configuración como estasuministrado como cortesía por el script netconfig de Slackware:
  
 <code> <code>
Línea 143: Línea 136:
 ... ...
 </code> </code>
- +O puede tener una dirección IP estáticaDebes tener *algo*. Ahora desplácese hacia abajo a la sección sobre puentes:
-Or you may have a static IP address You should have *something*.  Now scroll down to the section on bridging:+
  
 <code> <code>
-Example of how to configure a bridge+Ejemplo de como configurar un puente
-# Note the added "BRNICS" variable which contains a space-separated list +# Note el agregado de la variable "BRNICS" la cual contiene un lista separada por espacios 
-of the physical network interfaces you want to add to the bridge.+de las interfaces de red físicas que tu quieres agregar a el puente.
 ... ...
 </code> </code>
  
-Just below that you want the following to appear:+Justo debajo se desea que aparezca lo siguiente: 
  
 <code> <code>
Línea 161: Línea 154:
 </code> </code>
  
-Be careful with the numbers It's the the square brackets which are telling Slackware this is the 2nd device we're configuring as bridgeand we want to add eth1 to the bridge along with the tap0 device Slackware doesn't configure the eth1 devicewe don't even need to bring it up or otherwise refer to it in the config files as it's slave to the bridge.+Se cuidadoso con los númerosLos corchetes son los que le dicen Slackware que este es el segundo dispositivo que configuramos como puentey nosotros queremos agregar el dispositivo eth1 a el puente junto con el dispositivo tap0. 
 +Slackware no configura el dispositivo eth1, ni siquiera necesitamos mencionarlo o referirlo de otra manera en los archivos de configuración como esclavo del puente. 
  
 <note> <note>
-Some people might configure br0 as br1 hereto indicate it's connected to the second NIC and keep them the same You can do that And you can change the name of tap0 as well if you wantexperience tells me it's best to always use the lowest numbers for everything regardless of what they do For meat leastit reduces the confusion.+Algunas personas pueden configurar aquí br0 como br1, para indicar que esta conectado al segundo NIC y mantenerlos igualUsted puede hacer estoTambién puedes cambiar el nombre de tap0 si tu lo deseasla experiencia me dice que es mejor usar siempre números bajos para todo independientemente de lo que haganPara míal menosreduce la confusión.
 </note> </note>
  
-You don't have to set the IP address to 0.0.0.0, but it's a handy way of making the bridge come 'up' without giving it an IP address, and something that is supposed to simply sit there forwarding ethernet frames has no business having an IP address of its own.  If you don't set any address at all you can do 'ifconfig br0 up' at some later point. 
  
-When you boot with this configurationyou should check that br0 is up with+No necesitas configurar la dirección IP a 0.0.0.0pero esto es una forma práctica de hacer que el puente sea levantado sin darle una dirección ip, y no es un problema. 
 +Si usted no configura alguna dirección ip, usted puede hacer 'ifconfig br0 up' posteriormente. 
 + 
 +Cuando se arranca con esta configuración, usted debé chequear que br0 esta arriba con:
  
 <code> <code>
Línea 175: Línea 172:
 </code> </code>
  
-And you can also check the bridge with 'brctl show br0' and it should show something like this:+y usted puede también chequear el puente con 'brctl show br0' y se debería mostrar algo como esto:
  
 <code> <code>
Línea 184: Línea 181:
 </code> </code>
  
-So that's done the bridging config Now OpenVPN (when it's eventually configuredwill talk nicely to the private network aka 'slacknet' without any troubleeven if it only has 'nobodyas a username.+Con esto ha finalizado la configuración del puenteAhora OpenVPN (cuando este eventualmente configuradopodrá comunicarse con la red privada, en este ejemplo, 'slacknet' sin problemasincluso si solo tiene 'nadiecomo nombre de usuario.
  
-==== OpenVPN setup ==== 
  
-So this is the part where I can just rest easy 'on the shoulders of giants' so to speak.  Please setup your the PKI stuff for an OpenVPN server by following the  +==== Configuración de OpenVPN ====
-[[howtos:network_services:openvpn#creating_a_public_key_infrastructure_pki_using_the_easy-rsa_scripts | guide in the OpenVPN howto]].  Follow all of section 5 so you have a set of public and private keys for the server.  Don't worry about creating the config file to reference them from though as we'll do that back here.+
  
-Ready?  Good.+Así que esta es la parte en la que puedo descansar tranquilamente 'sobre los hombros de gigantes' por así decirlo. Por favor, configure su PKI para un servidor OpenVPN siguiendo [[es:howtos:network_services:openvpn#creacion_de_una_infraestructura_de_clave_publica_pki_utilizando_los_scripts_easy-rsa | guía en los howto de OpenVPN]]. 
 +Siga toda la sección 5 para tener un conjunto de claves públicas y privadas para el servidor. 
 +No te preocupes por crear el archivo de configuración para hacer referencias a ellos, ya que lo haremos aquí.
  
-So my /etc/openvpn/server.conf is a little simpler than the one in the OpenVPN howto.  We don't care about any of the routing stuff, and I've removed all the comments for brevity You can always check options in the manual page for OpenVPN if you want but most are self-explanatory.+¿Estas preparado? bien. 
 + 
 +Mi /etc/openvpn/server.conf es un archivo pequeño y un poco más simple que el howto de OpenVPNSe han eliminado los comentario por brevedad y también la parte de enrutamientoUsted puede siempre chequear las opciones en la pagina del manual de OpenVPN si lo desea, pero la mayoría se explican por si misma.
  
 <code> <code>
 port 443 port 443
-proto udp      # or tcp +proto udp      # tcp 
-dev tap0     # or tun+dev tap0     # tun
 ca /etc/openvpn/certs/ca.crt ca /etc/openvpn/certs/ca.crt
 cert /etc/openvpn/certs/vpn.crt cert /etc/openvpn/certs/vpn.crt
Línea 210: Línea 209:
 </code> </code>
  
-I have removed the passphrase from vpn.key (remember that's the equivalent of 'server1.key' in the OpenVPN howto).  I've avoided giving up root as well You would run a more secure setup if this was a production system by understanding the options in the OpenVPN manual pagethis is just to get you working.+Yo removí la palabra clave para vpn.key (recuerda que es equivalente de 'server1.key' en el howto de OpenVPN). Eh evitado renunciar a root.  
 +Usted ejecutaría una configuración más segura si este fuera un sistema de producción al comprender las opciones en la página de manual de OpenVPN, esto es solo para que pueda trabajar.
  
-Now you can go back to the other article and look at [[howtos:network_services:openvpn#setting_up_the_server | Setting up the server]].  Skip forward to the stuff that talks about rc.openvpn, to ensure you have a script to start OpenVPN up.  Once you have that you should be able to startup without seeing errors in /var/log/openvpn.log. 
  
-===== Client Gateway =====+Ahora usted puede volver a atrás a los otros artículos y leer [[es:howtos:network_services:openvpn##configuracion_del_servidor | Configuración del servidor OpenVPN]]. Ahora usted puede saltar a los scripts que hablan son rc.openvpn, para asegurarte de tener un script que inicie OpenVPN.
  
-==== VirtualBox configuration ==== 
  
-Like the 'Private Gateway' machine, this machine will have two NICs.  'Adapter 1', however can be NAT instead of bridged, as nothing needs to be able to find it.  'Adapter 2' will be connected to a private 'slacknet' network.  I made the name the same as on the other server machine, as they will become connected together but it doesn't matter what you call it so long as 'Private Client' uses the same name.+===== Client Gateway ===== 
 + 
 +==== Configuración de VirtualBox ====
  
-==== Slackware Install ====+Al igual que la máquina 'puerta de enlace privado' ('Private Gateway'), esta máquina puede tener dos NICs. 'Adaptador 1', sin embargo, puede ser NAT en lugar de puenteado, ya que nada tiene que ser capaz de encontrarlo. 
 +El 'Adaptador 2' puede estar conectado a la red privada 'slacknet'. Yo hice le asigne el mismo nombre que en la otra máquina del servidor, ya que se conectarán entre sí, pero no importa como se llame, siempre que el 'Cliente Privado' use el mismo nombre.
  
-I'm afraid once again, you'll need to install tunctl, create a tap0 device and enable the bridging exactly as happened for the Server Gateway.  Once tap0, and br0 are created on boot you will be good to configure OpenVPN.+==== Instalación de Slackware ====
  
-==== OpenVPN configuration ====+Me temo que una vez más, necesitarás instalar tunctl, crear el dispositivo tap0 y habilitar el puente exactamente como sucedió con la puerta de enlace del servidor. Una vez que tap0, y br0 son creadas en el arranque usted puede configurar OpenVPN. 
 +==== Configuración de OpenVPN ====
  
-Once againI bring into play the [[howtos:network_services:openvpn#creating_a_public_key_infrastructure_pki_using_the_easy-rsa_scripts other howto]] +Una vez máspongo en juego el [[howtos:network_services:openvpn##creacion_de_una_infraestructura_de_clave_publica_pki_utilizando_los_scripts_easy-rsa otro howto]] para la configuración PKI del lado del cliente. 
-for the PKI config on the client side However you can skip the rc.openvpn creation as we won't be running as a daemon The client configuration (/etc/openvpn/client.conf) is a little simpler:+Sin embargo, usted puede saltar la creación del archivo rc.openvpn ya que no estaremos ejecutando OpenVPN como un demonio. 
 +El archivo de configuración del cliente es un simple archivo(/etc/openvpn/client.conf):
  
 <code> <code>
Línea 241: Línea 244:
 verb 3 verb 3
 </code> </code>
- +Ahora debería poder conectarse a la 'Server Gateway' con este comando como root:
-You should now be able to connect to the 'Server Gateway' with this command as root:+
  
 <code> <code>
Línea 248: Línea 250:
 </code> </code>
  
-===== Private Client =====+===== Cliente Privado =====
  
-Very much like the 'Private Serverthis machine will have similar VirtualBox setup It will have a single NIC connected to network called 'slacknet'.+Al igual que el 'Servidor privado', esta máquina tendrá una configuración similar de VirtualBox. Esta tendrá un solo NIC conectado una red llamada 'slacknet'.
  
-I was going to use Slackware for this, but I decided to cheat and use Slax (Bootable CD distro) to save time on the install.  Slax requests a DHCP address on boot, so it really has all you need to test the bridge out (DHCP request sent, DHCP response received).  If all goes well when you boot you'll get an IP address something like 10.0.0.50 ( or at least in the range of addresses provided by the Dnsmasq server we setup on 'Private Server') 
  
-===== End to End Testing =====+Iba a usar Slackware para esto, pero decidí hacer trampa y usar Slax (distribución de CD de inicio) para ahorrar tiempo en la instalación. 
 +Slax solicita una dirección IP mediante DHCP, por lo que realmente tiene todo lo que necesita para probar el puente (solicitud DHCP enviada, respuesta DHCP recibida). 
 +Si en el arranque va todo bien, obtendrás una dirección IP como 10.0.0.50 (o al menos en el rango de direcciones proporcionadas por el servidor Dnsmasq que configuramos en el 'Servidor privado').
  
-So once all four (yes!) virtual machines are up and runningit should be possible (if all is workingto boot the Private Client and get an IP address in the right rangei.e. between 10.0.0.50 and 10.0.0.70.  Pay close attention to /var/logs/openvpn.log on 'Server Gateway' and of course the messages displayed when running openvpn on 'Client Gateway' as they should tell you what's wrong OpenVPN is pretty good like that The paranoid will also want to check /var/state/dnsmasq/dnsmasq.leases on 'Private Serverto reassure themselves that all's well and we are actually talking across the bridge.+===== Pruebas de extremo a extremo ===== 
 +Entonces, una vez que las cuatro máquinas virtuales (¡sí!) estén en funcionamiento y corriendodebería ser posible (si todo funcionainiciar el Cliente privado y obtener una dirección IP en el rango correctoes decir, entre 10.0.0.50 10.0.0.70. 
 +Preste mucha atención a /var/logs/openvpn.log sobre la 'Server Gateway' y, por supuesto, los mensajes mostrados cuando se ejecuta OpenVPN en la 'Client Gateway', ya que deberían informarle lo que está mal. 
 +OpenVPN es bastante buena. 
 +El paranoico también querrá verificar /var/state/dnsmasq/dnsmasq.leases en el 'Servidor privadopara asegurarse de que todo está bien y que en realidad estamos hablando a través del puente.
  
-===== Consolidation ===== 
  
-As I explained in the introduction, it's possible to test all this out without the 'Private server', and combine the function of 'Private Server' and 'Server gateway' in a single machine.  Read on to discover how. 
  
-First thing to do is switch off (power down) the 'Private Server'.+===== Consolidación =====
  
-Nextwe need to assign an ip address to our ethernet bridge on the 'Server Gateway'.+Como explique en la introducciónes posible probar todo esto sin el 'Servidor privado', y combina la función de 'Servidor privado' y 'Servidor de puerta de enlace' en una simple máquina. Sigue leyendo para descubrir cómo. 
 + 
 +Lo primero que debe hacer es apagar el 'servidor privado'
 + 
 +A continuación, debemos asignar una dirección IP a nuestro puente Ethernet en el 'Servidor de puerta de enlace'.
  
 <code> <code>
Línea 270: Línea 279:
 </code> </code>
  
-<note>we assign an address to the bridge, not eth1!</note> +<note>¡Asignamos una dirección IP a el puente y no a eth1!</note> 
-Now we just need to run a dnsmasq instance on this br0 interfaceto serve requests up to the VPN.  Much like the 'Private Serverconfig, /etc/dnsmasq.conf should look like this:+Ahora solamente necesitamos correr una instancia de dnsmasq sobre la interfaz br0, para servir solicitudes a la VPN. Como la configuración del 'Servidor privado', /etc/dnsmasq.conf debería verse así
  
 <code> <code>
Línea 278: Línea 287:
 </code> </code>
  
-Then it's just a matter of running up dnsmasq:+Entonces es solo cuestión de ejecutar dnsmasq: 
  
 <code> <code>
Línea 285: Línea 295:
 </code> </code>
  
-At this pointrebooting the 'Private Clientshould now get an IP address from the consolidated serverand that's really it HoweverI also changed the **old** 'Private Serverto dhcp to confirm it could also get an IP address from 'Server Gateway'+En este puntorebooteando el 'Servidor privadodebería obtener una dirección IP del servidor consolidadoy eso es todo. 
 +Sin embargotambién cambié el **old** 'Servidor privadodhcp para confirmar que también podría obtener una dirección IP desde 'Server Gateway'.
  
  
 ====== Fuentes ====== ====== Fuentes ======
   * Escrito originalmente por [[wiki:user:bifferos | User bifferos]]   * Escrito originalmente por [[wiki:user:bifferos | User bifferos]]
 +  * Traducido por  --- //[[wiki:user:rramp|rramp]] 2019/02/18 01:03 (UTC)//
  
 {{tag>howtos ethernet bridging author_bifferos}} {{tag>howtos ethernet bridging author_bifferos}}
 es:howtos:network_services:ethernet_bridging_with_openvpn ()