<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://doc.ubuntu-es.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
		<id>http://doc.ubuntu-es.org/index.php?title=Servidor_VPN&amp;feed=atom&amp;action=history</id>
		<title>Servidor VPN - Historial de revisiones</title>
		<link rel="self" type="application/atom+xml" href="http://doc.ubuntu-es.org/index.php?title=Servidor_VPN&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://doc.ubuntu-es.org/index.php?title=Servidor_VPN&amp;action=history"/>
		<updated>2013-05-23T22:58:24Z</updated>
		<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://doc.ubuntu-es.org/index.php?title=Servidor_VPN&amp;diff=7463&amp;oldid=prev</id>
		<title>Kelp: creo página</title>
		<link rel="alternate" type="text/html" href="http://doc.ubuntu-es.org/index.php?title=Servidor_VPN&amp;diff=7463&amp;oldid=prev"/>
				<updated>2008-02-18T12:13:24Z</updated>
		
		<summary type="html">&lt;p&gt;creo página&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Asegurando en una pequeña red inalámbrica utilizando VPN&lt;br /&gt;
&lt;br /&gt;
== Resumen ==&lt;br /&gt;
&lt;br /&gt;
Aunque el cifrado Wifi generalmente proporciona una primera capa de protección para una red wireless, está lejos de ser perfecta:&lt;br /&gt;
* WEP aun se utiliza ampliamente y debe ser considerada como muy insegura&lt;br /&gt;
* WPA puede romperse también (aunque requiere más esfuerzo), y muchos dispositivos no tiene aun el WPA habilitado&lt;br /&gt;
&lt;br /&gt;
Este documento pretende proporcionar un enfoque complementario para asegurar una red inalámbrica con un nivel adicional de cifrado usando Virtual Private Network (VPN). Se asume que el lector tiene conocimientos básicos de enrutamiento de redes IP y de administración del sistema linux. Sin embargo, en un intento por ampliar la audiencia a los no expertos, este documento no cubrirá muchos aspectos técnicos de la VPN.&lt;br /&gt;
&lt;br /&gt;
Este documento contiene instrucciones para configurar un VPN usando una clave estática, la cual funcionara con un solo cliente. La configuración para múltiples clientes requiere una infraestructura para clave pública (PKI), lo cual es más complejo y no se describe aquí.&lt;br /&gt;
&lt;br /&gt;
== Enrutamiento ==&lt;br /&gt;
&lt;br /&gt;
Idealmente, el punto de acceso wireless, al igual que la máquina wifi, no tiene acceso directo a Internet. Debería estar conectado al servidor VPN, y así todo el enrutamiento pueda ser manejado por el router. En la práctica, el servidor VPN estaría conectado a la LAN_SUBNET con un interfaz de red, y al punto de acceso wireless con otro interfaz de red. Es altamente recomendado configurar diferentes subredes para cada uno de los interfaces.&lt;br /&gt;
&lt;br /&gt;
En el documento, la topología de la red debe tener un aspecto parecido a esto:&lt;br /&gt;
&lt;br /&gt;
 [WIFI_MACHINE]----(WIFI)----&amp;gt;[WIRELESS_ACCESS_POINT]----(LAN)----&amp;gt;[VPN_SERVER]-----&amp;gt;INTERNET (potentially via a local gateway)&lt;br /&gt;
&lt;br /&gt;
''Ejemplo:''&lt;br /&gt;
* La dirección de puerta de enlace: &amp;lt;tt&amp;gt;eth0 inet adr:192.168.0.10  bcast:192.168.0.255 (LAN_SUBNET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* El servidor VPN: &amp;lt;tt&amp;gt;eth0 inet adr:192.168.0.1  bcast:192.168.0.255 (LAN_SUBNET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* El servidor VPN: &amp;lt;tt&amp;gt;eth1 inet adr:192.168.1.1  bcast:192.168.1.255 (WIFI_SUBNET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* El punto de acceso wireless: &amp;lt;tt&amp;gt;eth0 inet adr:192.168.1.2 bcast:192.168.1.255 (WIFI_SUBNET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Wifi del equipo (SYSTEM): &amp;lt;tt&amp;gt;eth0 inet adr:192.168.1.3  bcast:192.168.1.255 (WIFI_SUBNET)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
La siguiente configuración de [[iptables]] debe ser instalada en el servidor VPN para enrutar el tráfico:&lt;br /&gt;
&lt;br /&gt;
 # Default declaration, with DROP as a default INPUT policy&lt;br /&gt;
 *filter&lt;br /&gt;
 :INPUT DROP [0:0]&lt;br /&gt;
 :FORWARD ACCEPT [0:0]&lt;br /&gt;
 :OUTPUT ACCEPT [0:0]&lt;br /&gt;
 &lt;br /&gt;
 # Enable full access from localhost&lt;br /&gt;
 -A INPUT -i lo -p all -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Allow connections initiated from this machine&lt;br /&gt;
 -A INPUT -p all -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 #######################################################&lt;br /&gt;
 # WIFI --&amp;gt; LAN&lt;br /&gt;
 #######################################################&lt;br /&gt;
 &lt;br /&gt;
 # Preventing Wifi to reach LAN_SUBNET&lt;br /&gt;
 # LAN_SUBNET: Ethernet LAN subnet. Ex: 192.168.0.0/24&lt;br /&gt;
 -A FORWARD -d LAN_SUBNET -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # Enable VPN&lt;br /&gt;
 -A INPUT -i tun+ -j ACCEPT&lt;br /&gt;
 -A FORWARD -i tun+ -j ACCEPT &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # Force the machine(s) identified as SYSTEM to use VPN.&lt;br /&gt;
 # This means that without using VPN, SYSTEM will NOT access the Internet&lt;br /&gt;
 # SYSTEM: A Wifi machine, or the whole Wifi subnet. Ex: 192.168.1.3&lt;br /&gt;
 #&lt;br /&gt;
 # -A FORWARD -s SYSTEM -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # Allow access to the VPN service&lt;br /&gt;
 -A INPUT -p udp --dport 1194 -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #######################################################&lt;br /&gt;
 # INTERNET/WIFI -&amp;gt; LAN services&lt;br /&gt;
 #######################################################&lt;br /&gt;
 &lt;br /&gt;
 # Internal services on the VPN server can potentially&lt;br /&gt;
 # be made available to LAN_SUBNET&lt;br /&gt;
 # LAN_SUBNET: Ethernet LAN subnet. Ex: 192.168.0.0/24&lt;br /&gt;
 -A INPUT -s LAN_SUBNET -p all -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Allow SSH from the Internet AND from the Wifi&lt;br /&gt;
 -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # DHCP may also be useful&lt;br /&gt;
 # -A INPUT -p udp --dport 137:138 -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 # Log all rejected packets to syslog (useful for debugging)&lt;br /&gt;
 # -A INPUT -j LOG --log-level warn --log-prefix &amp;quot;[DENIED] &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 COMMIT&lt;br /&gt;
&lt;br /&gt;
== Configurar OpenVPN ==&lt;br /&gt;
&lt;br /&gt;
=== Montando el servidor ===&lt;br /&gt;
&lt;br /&gt;
* Instalar OpenVPN&lt;br /&gt;
&lt;br /&gt;
Instala el siguiente paquete: &amp;lt;tt&amp;gt;openvpn&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Genera una clave estática compartida&lt;br /&gt;
&lt;br /&gt;
 cd /etc/openvpn/ &amp;amp;&amp;amp; /usr/sbin/openvpn --genkey --secret static.key&lt;br /&gt;
&lt;br /&gt;
* Comenta todas las lineas de &amp;lt;tt&amp;gt;/etc/default/openvpn&amp;lt;/tt&amp;gt; y añade:&lt;br /&gt;
&lt;br /&gt;
 AUTOSTART=&amp;quot;openvpn&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Rellena el archivo de configuración &amp;lt;tt&amp;gt;/etc/openvpn/openvpn.conf&amp;lt;/tt&amp;gt; con:&lt;br /&gt;
&lt;br /&gt;
 dev tun&lt;br /&gt;
 # Network interface used by the VPN server on WIFI_SUBNET&lt;br /&gt;
 # eth1 (192.168.1.1) in the previous example&lt;br /&gt;
 local 192.168.1.1&lt;br /&gt;
 # The following line defines two new VPN interfaces&lt;br /&gt;
 # ifconfig VPN_SERVER VPN_CLIENT&lt;br /&gt;
 ifconfig 10.1.0.1 10.1.0.2&lt;br /&gt;
 up ./office.up&lt;br /&gt;
 secret static.key&lt;br /&gt;
 ping 15&lt;br /&gt;
 tun-mtu 1200&lt;br /&gt;
 mssfix 1400&lt;br /&gt;
 verb 3&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;/etc/openvpn/office.up&amp;lt;/tt&amp;gt; debe ser ejecutable y contener:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 route add -net 10.0.1.0 netmask 255.255.255.0 gw $5&lt;br /&gt;
&lt;br /&gt;
* Finalmente, podemos completar el enrutamiento para la red wireless en la configuración de [[iptables]]:&lt;br /&gt;
&lt;br /&gt;
 #######################################################&lt;br /&gt;
 # ROUTING WIFI -&amp;gt; LAN/INTERNET&lt;br /&gt;
 # Route the Wifi traffic to the Internet&lt;br /&gt;
 #######################################################&lt;br /&gt;
 *nat&lt;br /&gt;
 :PREROUTING ACCEPT [0:0]&lt;br /&gt;
 :POSTROUTING ACCEPT [0:0]&lt;br /&gt;
 :OUTPUT ACCEPT [0:0]&lt;br /&gt;
 &lt;br /&gt;
 # Route all the Wifi traffic -even without VPN!- to the Internet&lt;br /&gt;
 # WIFI_SUBNET: Wifi subnet. Ex: 192.168.1.0/24&lt;br /&gt;
 # -A POSTROUTING -s WIFI_SUBNET -o eth0 -j MASQUERADE&lt;br /&gt;
 &lt;br /&gt;
 # Route traffic from VPN_HOST to the LAN/Internet&lt;br /&gt;
 # VPN_CLIENT: VPN host (or VPN subnet for multiple-clients setups). Ex: 10.1.0.2&lt;br /&gt;
 -A POSTROUTING -s VPN_CLIENT -o eth0 -j MASQUERADE&lt;br /&gt;
     &lt;br /&gt;
 COMMIT&lt;br /&gt;
&lt;br /&gt;
* Inicia el servicio OpenVPN:&lt;br /&gt;
 /etc/init.d/openvpn start &lt;br /&gt;
&lt;br /&gt;
=== Configurar el cliente ===&lt;br /&gt;
&lt;br /&gt;
* Instala OpenVPN&lt;br /&gt;
&lt;br /&gt;
 apt-get install openvpn&lt;br /&gt;
&lt;br /&gt;
* Copia la clave estática &amp;lt;tt&amp;gt;/etc/openvpn/static.key&amp;lt;/tt&amp;gt; al sistema cliente en &amp;lt;tt&amp;gt;/etc/openvpn&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Comenta todas las líneas de &amp;lt;tt&amp;gt;/etc/default/openvpn&amp;lt;/tt&amp;gt; y añade:&lt;br /&gt;
&lt;br /&gt;
 AUTOSTART=&amp;quot;openvpn&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Rellena el fichero de configuración &amp;lt;tt&amp;gt;/etc/openvpn/openvpn.conf&amp;lt;/tt&amp;gt; con:&lt;br /&gt;
&lt;br /&gt;
 dev tun&lt;br /&gt;
 &lt;br /&gt;
 # Network interface used by the VPN client (SYSTEM) on WIFI_SUBNET&lt;br /&gt;
 # eth0 (192.168.1.3) in the previous example&lt;br /&gt;
 local 192.168.1.3&lt;br /&gt;
 # Network interface used by the VPN server on WIFI_SUBNET&lt;br /&gt;
 # eth1 (192.168.1.1) in the previous example&lt;br /&gt;
 remote 192.168.1.1&lt;br /&gt;
 nobind&lt;br /&gt;
 # The following line defines two new VPN interfaces&lt;br /&gt;
 # ifconfig VPN_CLIENT VPN_SERVER&lt;br /&gt;
 ifconfig 10.1.0.2 10.1.0.1&lt;br /&gt;
 up ./home.up&lt;br /&gt;
 down ./home.down&lt;br /&gt;
 secret static.key&lt;br /&gt;
 ping 15&lt;br /&gt;
 tun-mtu 1200&lt;br /&gt;
 mssfix 1400&lt;br /&gt;
 verb 3&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;/etc/openvpn/home.up&amp;lt;/tt&amp;gt; debe ser ejecutable y contener:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 route add -net 10.0.0.0 netmask 255.255.255.0 gw $5&lt;br /&gt;
 route add -net 0.0.0.0 netmask 0.0.0.0 dev tun0&lt;br /&gt;
 # In the following, eth0 is the network interface &lt;br /&gt;
 # used by the VPN client (SYSTEM) on WIFI_SUBNET&lt;br /&gt;
 route del -net 0.0.0.0 netmask 0.0.0.0 dev eth0&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;/etc/openvpn/home.down&amp;lt;/tt&amp;gt; debe ser ejecutable y contener:&lt;br /&gt;
&lt;br /&gt;
 # In the following, eth0 is the network interface &lt;br /&gt;
 # used by the VPN client (SYSTEM) on WIFI_SUBNET&lt;br /&gt;
 route add -net 0.0.0.0 netmask 0.0.0.0 dev eth0&lt;br /&gt;
&lt;br /&gt;
* Inicia el servicio OpenVPN:&lt;br /&gt;
 /etc/init.d/openvpn start&lt;br /&gt;
* Si el siguiente comando de ping no devuelve un error, es que funciona&lt;br /&gt;
&lt;br /&gt;
 ping 10.1.0.1&lt;br /&gt;
 ping 10.1.0.2&lt;br /&gt;
&lt;br /&gt;
CategoryDocumentação&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Fuentes ==&lt;br /&gt;
* https://help.ubuntu.com/community/VPNServer&lt;br /&gt;
&lt;br /&gt;
[[Categoría:servidores]]&lt;/div&gt;</summary>
		<author><name>Kelp</name></author>	</entry>

	</feed>