El 14/12/2020 a las 13:10, Alexis Verano Glez escribió:
Hola amigos,
Alguien por aca podría ayudarme en este scritp de iptables, el tema es
que no esta redireccionando el trafico del puerto 80 hacia el servidor
de hosting.
S.O: Debian 9 (Virtualizado por Container en Proxmox)
********************************************************************************************
#!/bin/sh
## FLUSH de reglas
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
## ESTABLECEMOS POLITICAS POR DEFECTO
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
## VARIABLES
## Nota: eth0 es el interfaz conectado al ROUTER (WAN) y eth1 a la LAN
EXTERNAL=eth0
INTERNAL=eth1
RED_WAN=172.16.0.0/16
IP_WAN=172.16.14.4
RED_LAN=192.168.100.0/24
IP_LAN=192.168.100.244
IP_ADMINRED=192.168.100.20
SRV_HTTP=192.168.100.7
#########################
## EMPEZAMOS A FILTRAR ##
######################################
## POLITICIAS INTERNAS DEL FIREWALL ##
######################################
# Activar el BIT DE FORWARDING
echo 1 > /proc/sys/net/ipv4/ip_forward
# Acceso total desde el localhost
iptables -A INPUT -i lo -j ACCEPT
# Aceptamos paquetes que tienen estado relacionados y establecidos
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Enmascaramiento de la red local
iptables -t nat -A POSTROUTING -s $IP_ADMINRED -o $IP_WAN -j SNAT --to
$IP_WAN
###############################################
## ACCESO DE LOS ADMINISTRADORES AL FIREWALL ##
###############################################
iptables -A INPUT -s $IP_ADMINRED -j ACCEPT
###########################
### REDIRECCIONAMIENTOS ###
###########################
# Accesos desde la red externa al servidor hosting
iptables -t nat -A PREROUTING -i $IP_WAN -p tcp --dport 80 -j DNAT
--to $SRV_HTTP:80
[...]
********************************************************************************************
--
Lic. Alexis Verano González
Esp. A Ciencias Informáticas | Administrador de RED
Grupo Empresarial de Servicios de Transporte Automotor "GEA"
Ministerio de Transporte
Correo-e: alexis.ver...@gea.transnet.cu
<mailto:alexis.ver...@gea.transnet.cu>
Web: https://www.gea.transnet.cu <https://www.gea.transnet.cu>
Tel: (+53) 7881-9057 | (+53) 5 994-6579
---
Somos el GEA, Grupo Empresarial de Servicios de Transporte Automotor
perfeccionado.
Visítenos en: https://www.gea.transnet.cu <https://www.gea.transnet.cu>
_______________________________________________
Gutl-l mailing list -- gutl-l@listas.jovenclub.cu
To unsubscribe send an email to gutl-l-le...@listas.jovenclub.cu
creo que el pve tienes que habilitar algo para que eso funcione!!
--
Juan Carlos Hernández Gallardo
Esp. C en Ciencias Informáticas
UPI Pedraplén Sur Ciego de Ávila
Email: jua...@psurcav.co.cu
_______________________________________________
Gutl-l mailing list -- gutl-l@listas.jovenclub.cu
To unsubscribe send an email to gutl-l-le...@listas.jovenclub.cu