<div>Les saludo y la vez les comento una configuracion de una vpn lan to lan, me falta una parte, pero no encuentro la falla, puede que alguien conozca la solucion le agradecere el aporte.</div>
<div> </div>
<div>TENGO DOS REDES REMOTAS </div>
<div>RED1 CON UNA CONEXION DE SPEEDY BUSSINESS E IP PUBLICA</div>
<div>esta red tiene un server con firewall + proxy transparente</div>
<div>eth0 :: 192.168.1.100</div>
<div>eth1 :: <a href="http://192.168.10.0/24">192.168.10.0/24</a></div>
<div>esta red cuenta con una ip publica, ademas en el mismo router le puse la regla de nat para desde afuera llegar al server que tiene la vpn, osea:</div>
<div>direccione el pto. 1194 hacia el ip de la eth0 de mi server </div>
<div> </div>
<div>en el mismo server firewall + proxy, tambien configure el openvpn</div>
<div> </div>
<div>la configuracion del openvpn la lleve a cabo sin problemas siguiendo muchos manuales comunes que hay en internet</div>
<div> </div>
<div>el proxy transparente trabaja OK y las estaciones entran a internet sin problemas</div>
<div> </div>
<div>por ejemplo una pc cliente seria: <a href="http://192.168.10.2/255.255.255.0">192.168.10.2/255.255.255.0</a>     gateway 192.168.10.1</div>
<div> </div>
<div>AQUI LES COLOCO EL MODELO DE MI ARCHIVO DE CONFIGURACION DEL SERVIDOR VPN, los archivos crt y key del server funcionan sin problemas</div>
<div> </div>
<div>###### ARCHIVO /etc/openvpn/vpn1.conf --- ARCHIVO DE CONFIGURACION DEL SERVER VPN</div>
<div>port 1194<br>proto udp<br>dev tun<br>ca ca.crt<br>cert vpn1.crt<br>key vpn1.key<br>dh dh1024.pem</div>
<div><br>###### Direcciones que se asignaran a los clientes, el server es .1<br>server 10.8.0.0 255.255.255.0</div>
<div>ifconfig-pool-persist ipp.txt</div>
<div>#Ruta para que los clientes alcancen la red local del server (10.0/24)<br>push &quot;route 192.168.10.0 255.255.255.0&quot;</div>
<div>client-config-dir ccd<br>route 192.168.20.0 255.255.255.0<br>client-to-client<br>push &quot;route 192.168.20.0 255.255.255.0&quot;</div>
<div>keepalive 10 120<br>comp-lzo<br>user nobody<br>group nobody<br>persist-key<br>persist-tun<br>status openvpn-status.log<br>verb 4<br></div>
<div>ADEMAS TAMBIEN EN EL ARCHIVO </div>
<div>/etc/openvpn/ccd/vpn2</div>
<div> </div>
<div>LE AGREGYE ESTE COMANDO --- NECESITO LLEGAR A LA RED <a href="http://192.168.20.0/24">192.168.20.0/24</a> EN EL OTRO LADO</div>
<div>iroute 192.168.20.0 255.255.255.0<br></div>
<div> </div>
<div>TAMBIEN LE AGREGUE UN SCRIPT PARA CREAR RUTAS</div>
<div> </div>
<div>/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.10.1<br>/sbin/route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.10.1<br>/sbin/route add -net 10.8.0.0 netmask 255.255.255.255 gw 192.168.10.1<br>
</div>
<div>Y EL SCRIPT DE MIS REGLAS DE IPTABLES EN ESTE SERVIDOR ES</div>
<div> </div>
<div> </div>
<div> </div>
<div>echo -n Aplicando Reglas de Firewall...</div>
<div>iptables=/sbin/iptables</div>
<div>## LIMPIEZA TOTAL DE LAS REGLAS ACTUALES<br>#### PARA QUE SE CARGUEN ESTAS NUEVAS REGLAS<br>############################################<br>iptables -F<br>iptables -X<br>iptables -Z<br>iptables -t nat -F</div>
<div>#### DECLARACION DE VARIABLES<br>#### LO HACEMOS PARA TENER ORDEN Y CLARIDAD<br>LAN=<a href="http://192.168.10.0/24">192.168.10.0/24</a><br>NUBE=<a href="http://0.0.0.0/0">0.0.0.0/0</a><br>WAN=&quot;192.168.1.100&quot;</div>

<div>## DECLARANDO LAS POLITICAS PRINCIPALES DEL FIREWALL<br>#### AQUI SE DECIDE SI SERA ABIERTO Y CERRADO<br>#### YA DEPENDE DEL ADMINISTRADOR<br>#### EN ESTE CASO ESTAMOS ABRIENDO TODOS LOS PUERTOS Y CERRAMOS LOS QUE DESEAMOS<br>
iptables -P INPUT ACCEPT<br>iptables -P OUTPUT ACCEPT<br>iptables -P FORWARD ACCEPT<br>iptables -t nat -P PREROUTING ACCEPT<br>iptables -t nat -P POSTROUTING ACCEPT</div>
<div>## CARGA FORZADA DE MODULOS IMPORTANTES<br>### A VECES EN ALGUNOS SISTEMAS NO ESTAN CARGADOS<br>modprobe iptable_nat<br>modprobe ip_nat_ftp<br>modprobe ip_conntrack_ftp</div>
<div>## POLITICAS POR DEFECTO POR LA VPN<br>iptables -F FORWARD<br></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>iptables -P FORWARD ACCEPT</div>
<div><br>iptables -A INPUT -i tun0 -j ACCEPT<br>iptables -A FORWARD -i tun0 -j ACCEPT<br>iptables -A FORWARD -o tun0 -j ACCEPT<br>iptables -A OUTPUT -o tun0 -j ACCEPT<br>iptables -A INPUT -i tap0 -j ACCEPT<br>iptables -A FORWARD -i tap0 -j ACCEPT<br>
iptables -A INPUT -p udp --dport 1194 -j ACCEPT</div>
<div>iptables -A FORWARD -s <a href="http://10.8.0.0/24">10.8.0.0/24</a> -j ACCEPT<br>iptables -t nat -A POSTROUTING -s <a href="http://10.8.0.0/24">10.8.0.0/24</a> -o eth0 -j MASQUERADE</div>
<div>iptables -A FORWARD -s <a href="http://192.168.20.0/24">192.168.20.0/24</a> -j ACCEPT<br>iptables -t nat -A POSTROUTING -s <a href="http://192.168.20.0/24">192.168.20.0/24</a> -o eth0 -j MASQUERADE</div>
<div>## SE AUMENTAN EL NUMERO DE CONEXIONES SEGUIDAS<br>echo 65535 &gt; /proc/sys/net/ipv4/ip_conntrack_max</div>
<div>## SE IGNORAN LOS ERRORES DEL ICMP<br>echo 1 &gt; /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses</div>
<div>## SE HABILITA EL FORWARD DE LOS PAQUETES<br>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</div>
<div>## SE HABILITA LA PROTECCION CONTRA LOS SYN FLOODS<br>echo 1 &gt; /proc/sys/net/ipv4/tcp_syncookies</div>
<div>## SE QUITAN LOS REGISTROS DE BROADCAST EN /var/log/messages<br>iptables -t mangle -I PREROUTING -j DROP -d <a href="http://224.0.0.0/8">224.0.0.0/8</a></div>
<div>## SE CONECTA LA LAN CON EL PROXY TRANSPARENTE<br>#### YA NO ES NECESARIO COLOCAR EN LOS NAVEGADORES LO DEL PROXY<br>iptables -t nat -A PREROUTING -i eth1 -p tcp -s $LAN -d $NUBE --dport 80 -j REDIRECT --to-port 3128</div>

<div>###### MANEJO DE PUERTO ESPECIAL PARA LAS VPNS - OPENVPN<br>iptables -A INPUT -i eth0 -p tcp --dport 1194 -j ACCEPT<br></div>
<div>##### ENMASCARAMOS LAS CONEXIONES DE LOS DNS ENTERNOS, MSN Y OTROS PARA TODAS </div>
<div>iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 53 -j MASQUERADE<br>iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 53 -j MASQUERADE<br>iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 5190 -j MASQUERADE<br>
iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 5190 -j MASQUERADE<br>iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 1863 -j MASQUERADE<br>iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 1863 -j MASQUERADE<br>
iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 1024:65535 -j MASQUERADE<br>iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 1024:65535 -j MASQUERADE</div>
<div>#### YA HACIENDO EL NAT EN LA V<br>iptables -t nat -A POSTROUTING -s $LAN -d $NUBE -j SNAT --to-source $WAN</div>
<div># /root/cbq.init stats | more<br>iptables -t nat -L -n<br></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>######################################################################################################</div>
<div>######################################################################################################</div>
<div> </div>
<div>CONFIGURACION DEL SERVER2 EN EL OTRO LOCAL</div>
<div> </div>
<div>
<div>RED2 CON UNA CONEXION DE SPEEDY CLASS SIN IP PUBLICA</div>
<div>esta red tiene un server con firewall + proxy transparente</div>
<div>eth0 :: 192.168.1.101</div>
<div>eth1 :: <a href="http://192.168.20.0/24">192.168.20.0/24</a></div>
<div> </div>
<div>en el mismo server firewall + proxy, tambien configure el openvpn</div>
<div> </div>
<div>el proxy transparente trabaja OK y las estaciones entran a internet sin problemas</div>
<div> </div>
<div>por ejemplo una pc cliente seria: <a href="http://192.168.20.2/255.255.255.0">192.168.20.2/255.255.255.0</a>     gateway 192.168.20.1</div>
<div> </div>
<div>AQUI LES COLOCO EL MODELO DE MI ARCHIVO DE CONFIGURACION DEL SERVIDOR VPN2, los archivos crt y key del server funcionan sin problemas --   <span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">vim /etc/openvpn/vpn2.conf</font></font></span></div>
</div>
<div>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">client</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">dev tun</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">proto udp</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">remote 190.41.110.99 1194</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">resolv-retry infinite</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">nobind   ####### PARA QUE ME SIRVE ESTE COMANDO ALGUIEN LO PUEDE ACLARAR</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#Las dos siguientes opciones no van en windows</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">user nobody</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">group nobody</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">persist-key</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">persist-tun</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">ca ca.crt</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">cert vpn2.crt</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">key vpn2.key</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">comp-lzo</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">verb 4</font></font></span></p></div>
<div> </div>
<div> </div>
<div>TAMBIEN CREE UN SCRIPT DE RUTAS</div>
<div> </div>
<div><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">/sbin/route add -net 10.8.0.0 netmask 255.255.255.255 gw 192.168.20.1</font></font></span></div>
<div>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">/sbin/route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.20.1</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">/sbin/route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.20.1</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> MI SCRIPT DE FIREWALL DE ESTA RED</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">echo -n Aplicando Reglas de Firewall...</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">iptables=/sbin/iptables</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## LIMPIEZA TOTAL DE LAS REGLAS ACTUALES</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### PARA QUE SE CARGUEN ESTAS NUEVAS REGLAS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">############################################</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">iptables -F</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">iptables -X</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">iptables -Z</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">iptables -t nat -F</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### DECLARACION DE VARIABLES</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### LO HACEMOS PARA TENER ORDEN Y CLARIDAD</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">LAN=<a href="http://192.168.20.0/24">192.168.20.0/24</a></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">NUBE=<a href="http://0.0.0.0/0">0.0.0.0/0</a></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">WAN=&quot;192.168.1.101&quot;</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## DECLARANDO LAS POLITICAS PRINCIPALES DEL FIREWALL</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### AQUI SE DECIDE SI SERA ABIERTO Y CERRADO</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### YA DEPENDE DEL ADMINISTRADOR</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### EN ESTE CASO ESTAMOS ABRIENDO TODOS LOS PUERTOS Y CERRAMOS LOS QUE DESEAMOS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -P INPUT ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -P OUTPUT ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -P FORWARD ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -P PREROUTING ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -P POSTROUTING ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## CARGA FORZADA DE MODULOS IMPORTANTES</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">### A VECES EN ALGUNOS SISTEMAS NO ESTAN CARGADOS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">modprobe iptable_nat</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">modprobe ip_nat_ftp</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">modprobe ip_conntrack_ftp</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3"><font face="Times New Roman">## POLITICAS POR DEFECTO POR LA VPN</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -F FORWARD</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -P FORWARD ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A INPUT -i tun0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A FORWARD -i tun0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A FORWARD -o tun0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A OUTPUT -o tun0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A INPUT -i tap0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A FORWARD -i tap0 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A INPUT -p udp --dport 1194 -j ACCEPT</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A FORWARD -s <a href="http://10.8.0.0/24">10.8.0.0/24</a> -j ACCEPT</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -s <a href="http://10.8.0.0/24">10.8.0.0/24</a> -o eth0 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A FORWARD -s <a href="http://192.168.10.0/24">192.168.10.0/24</a> -j ACCEPT</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -s <a href="http://192.168.10.0/24">192.168.10.0/24</a> -o eth0 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE AUMENTAN EL NUMERO DE CONEXIONES SEGUIDAS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">echo 65535 &gt; /proc/sys/net/ipv4/ip_conntrack_max</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE IGNORAN LOS ERRORES DEL ICMP</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">echo 1 &gt; /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE HABILITA EL FORWARD DE LOS PAQUETES</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">echo 1 &gt; /proc/sys/net/ipv4/ip_forward</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE HABILITA LA PROTECCION CONTRA LOS SYN FLOODS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">echo 1 &gt; /proc/sys/net/ipv4/tcp_syncookies</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE QUITAN LOS REGISTROS DE BROADCAST EN /var/log/messages</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t mangle -I PREROUTING -j DROP -d <a href="http://224.0.0.0/8">224.0.0.0/8</a></font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">## SE CONECTA LA LAN CON EL PROXY TRANSPARENTE</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">#### YA NO ES NECESARIO COLOCAR EN LOS NAVEGADORES LO DEL PROXY</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A PREROUTING -i eth1 -p tcp -s $LAN -d $NUBE --dport 80 -j REDIRECT --to-port 3128</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">###### MANEJO DE PUERTO ESPECIAL PARA LAS VPNS - OPENVPN</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -A INPUT -i eth0 -p tcp --dport 1194 -j ACCEPT</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3" face="Times New Roman">##### ENMASCARAMOS LAS CONEXIONES DE LOS DNS ENTERNOS, MSN Y OTROS PARA TODAS LAS VES Y VLANS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 53 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 53 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 5190 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 5190 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 1863 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 1863 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p tcp -s $LAN -d $NUBE --dport 1024:65535 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -p udp -s $LAN -d $NUBE --dport 1024:65535 -j MASQUERADE</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span lang="ES"><font size="3"><font face="Times New Roman">#### YA HACIENDO EL NAT EN LA V</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -A POSTROUTING -s $LAN -d $NUBE -j SNAT --to-source $WAN</font></font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman"># /root/cbq.init stats | more</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3"><font face="Times New Roman">iptables -t nat -L –n</font></font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> EN CADA SERVER LEVANTA el dev tun0 sin problemas</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">EN EL SERVER2 SE LE ASIGNA UNA IP 10.8.0.6 en el dev tun0</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">YA QUE EL dev tun0 DEL SERVER1 tiene asignado 10.8.0.1</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">entre la red <a href="http://10.8.0.0/24">10.8.0.0/24</a> puedo hacer ping sin problemas, PERO ENTRE LOS SERVERS NO PUEDO HACER PING NI A LA 192.168.10.1 NI A LA 192.168.20.1, COMO CONSECUENCIA UNA ESTACION DE LA RED1 NO PUEDE HACER PING A UNA PC DE LA RED2 Y VICEVERSA</font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">DONDE ESTA LA FALLA</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">HAY QUE HACER ALGO EN EL ROUTER DEL SPEEDY CLASS DE LA RED2 O NO</font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">DESDE LA RED2 QUIERO ACCEDER A UN SISTEMA QUE LO RTIENE UNA PC DE LA RED1, ESE ES MI OBJETIVO PERO NO LOGRO.</font></span></p>

<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">ESPERO SUS COMENTARIOS</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">ATT.</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman">PAUL CRIOLLO</font></span></p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"></font></span> </p>
<p style="MARGIN: 0cm 0cm 0pt" class="MsoNormal"><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span><span style="mso-ansi-language: EN-US" lang="EN-US"><font size="3" face="Times New Roman"> </font></span></p>
</div>