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
Cirurgia para acelerar o openSUSE em HD externo via USB
Void Server como Domain Control
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Como automatizar sua instalação do Ubuntu para desenvolvimento de software.
Consertando o áudio com som ruim no Pipewire
Como implementar Raid (0, 1, 5, 6, 10 e 50)
fusermount3 no Ubuntu 25.10 - mantenha o perfil do AppArmor
[Resolvido] dlopen(): error loading libfuse.so.2 AppImages require FUSE to run.
Como programar um sistema de controle para distribuições linux em c? (4)
Servidor Ubuntu 24.04 HD 500 não tenho espaço na \home\adminis... (2)









