Enviado em 05/05/2014 - 11:24h
Olá amigos primeiramente gostaria de dizer que sou grato a comunidade Viva o Linux por esse conteúdo rico disponível a todos!#!/bin/bash
ifconfig eth0 192.168.1.101 netmask 255.255.255.0 up
# Carrega os módulos
modprobe iptable_nat
# Compartilha a conexão
modprobe iptable_nat
# Esse comando não especifica a interface de rede para compartilhar a conexão
iptables -v -t nat -A POSTROUTING -j MASQUERADE -s 192.168.0.0/16
echo 1 > /proc/sys/net/ipv4/ip_forward
# Abre algumas portas
iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 25 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1021 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 8080 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2427 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2257 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2300 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2400 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2600 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2900 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 2950 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3391 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3392 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3393 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3389 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 8081 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 5900 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 5484 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 5932 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 3128 -j ACCEPT
iptables -A FORWARD -p tcp -s 192.168.1.14 --dport 80 -j ACCEPT
iptables -v -t nat -I PREROUTING -s 192.168.1.14 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -p tcp -s 192.168.1.24 --dport 80 -j ACCEPT
iptables -v -t nat -I PREROUTING -s 192.168.1.24 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -p tcp -s 192.168.1.4 --dport 80 -j ACCEPT
iptables -v -t nat -I PREROUTING -s 192.168.1.4 -p tcp --dport 80 -j ACCEPT
# Fecha o resto
iptables -A INPUT -p tcp --syn -j ACCEPT
# Abre para a rede local
iptables -A INPUT -p tcp --syn -s 192.168.1.0/255.255.255.0 -j ACCEPT
#Redirecionamento para proxy sem especificar a interface:
iptables -t nat -v -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 3128 -s 192.168.0.0/16
# Outros redirecionamentos
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.3:8080
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 7357 -j DNAT --to-destination 192.168.1.90:8080
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 7367 -j DNAT --to-destination 192.168.1.91:8080
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 7377 -j DNAT --to-destination 192.168.1.92:8080
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 8181 -j DNAT --to-destination 192.168.1.15:80
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 8282 -j DNAT --to-destination 192.168.1.1:8282
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 8383 -j DNAT --to-destination 192.168.1.105:82
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 3391 -j DNAT --to-destination 192.168.1.1:3389
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 8484 -j DNAT --to-destination 192.168.1.1:8484
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 5991 -j DNAT --to-destination 192.168.1.1:5900
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 1111 -j DNAT --to-destination 192.168.1.42:3389
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 3393 -j DNAT --to-destination 192.168.1.3:3389
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 5993 -j DNAT --to-destination 192.168.1.3:5900
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 5996 -j DNAT --to-destination 192.168.1.6:5900
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 5915 -j DNAT --to-destination 192.168.1.15:5900
iptables -v -t nat -A PREROUTING -d xxx.dyndns.org -p tcp --dport 3394 -j DNAT --to-destination 192.168.1.20:3389
tux-gpt - Assistente de IA para o Terminal
Instalação e configuração do Chrony
Programa IRPF - Guia de Instalação e Resolução de alguns Problemas
Instalando o Team Viewer no Debian Trixie - problema no Policykit
O Que Fazer Após Instalar Ubuntu 25.04
O Que Fazer Após Instalar Fedora 42
Debian 12 -- Errata - Correções de segurança
Instalando o Pi-Hole versão v5.18.4 depois do lançamento da versão v6.0
Linux iniciando sem interface gráfica (13)
Não consigo acessar servidores a partir da LAN (0)
Pra quem contribui com artigos e dicas (7)
Alguém poderia me ajudar a escolher peças pra montar um desktop? (27)