Bom Dia!
Meu nome é Gabriel, sou novo no linux, assumi um servidor de internet na empresa onde eu trabalho. Deu pau no squid e formatei a maquina, instalei o ubuntu 10.10 e voltei o backup do squid e firewall. A internet está funcionando e os usuários conseguem autenticação normalmente com suas regras e bloqueios. Acontece que prestamos suporte remoto para nossos clientes e usamos o vnc reverso para isso. Temos quatro maquinas que fazem esse serviço, cada uma com seu ip, direcionei as portas 5500 a 5510 no modem para o ip 192.168.254.1 (ip internet) que é o ETH0.
O meu problema é o seguinte, quando o usuário abre o programa com o vnc reverso abre a lista com os funcionarios que prestam suporte aqui na empresa só que nem sempre estamos online, fica oscilando, as vezes um aqui dentro fica online e tres ficam offline, tres online e um offline, todos offline, todos online... A conexão funciona normal quando um se conecta com alguem daqui de dentro.
Valeu a todos do forum, tem sido muito util esse site!
ETH1: 192.168.0.1
ETH0: 192.168.254.1#!/bin/bash
iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_REJECT
/sbin/modprobe ipt_MASQUERADE
#echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
iptables -t mangle -A FORWARD -o eth1 -j TTL --ttl-set 128
iptables -N VALID_CHECK
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL ALL -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP
iptables -A VALID_CHECK -p tcp --tcp-flags ALL NONE -j DROP
iptables -A INPUT -p ipv6 -j DROP
iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 6/s -j ACCEPT #Protege contra os "Ping of Death"
iptables -A FORWARD -p tcp -m limit --limit 1/s -j ACCEPT #Protege contra os ataques do tipo "Syn-flood, DoS, etc"
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT #Permitir repassamento (NAT,DNAT,SNAT) de pacotes estabilizados e os relatados
iptables -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG #Logar os pacotes mortos por inatividade
iptables -A FORWARD --protocol tcp --tcp-flags ALL SYN,ACK -j DROP #Protege contra pacotes que podem procurar e obter informaçs da rede interna
iptables -t filter -A INPUT -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT #Protege contra ataques
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i eth1 -d cvsoft.com.br -j ACCEPT
iptables -t filter -A FORWARD -i eth1 -d cvsoft.com.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -d interno.cvsoft.com.br -j ACCEPT
iptables -t filter -A FORWARD -i eth1 -d interno.cvsoft.com.br -j ACCEPT
iptables -t nat -A PREROUTING -s 200.234.196.148 -p tcp -i eth1 --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 5017 --source 192.168.0.0/24 -i eth1 -j ACCEPT
iptables -I FORWARD -p tcp --dport 5017 -j ACCEPT
iptables -I FORWARD -p tcp --sport 5017 -j ACCEPT
iptables -I FORWARD -p all -s cafe.dataprev.gov.br -j ACCEPT
iptables -I FORWARD -p all -d cafe.dataprev.gov.br -j ACCEPT
iptables -I FORWARD -p all -s 192.168.0.0/24 -d cafe.dataprev.gov.br -j ACCEPT
iptables -I FORWARD -p all -d 192.168.0.0/24 -s cafe.dataprev.gov.br -j ACCEPT
#iptables -A INPUT -s 192.168.0.3/24 -j ACCEPT
#iptables -A FORWARD -s 192.168.0.3/24 -j ACCEPT
#iptables -A OUTPUT -s 192.168.0.3/24 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp --dport 443 -s 192.168.0.0 -d 200.241.32.196 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 200.241.32.196 -j ACCEPT
iptables -A FORWARD -p tcp -d 200.241.32.196 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp --dport 443 -s 192.168.0.0 -d 189.31.180.195 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 189.31.180.195 -j ACCEPT
iptables -A FORWARD -p tcp -d 189.31.180.195 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp --dport 443 -s 192.168.0.0 -d 200.241.32.197 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 200.241.32.197 -j ACCEPT
iptables -A FORWARD -p tcp -d 200.241.32.197 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp --dport 443 -s 192.168.0.0 -d 201.49.164.105 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -d 201.49.164.105 -j ACCEPT
iptables -A FORWARD -p tcp -d 201.49.164.105 -j ACCEPT
iptables -A FORWARD -s 192.168.1.0/24 -d
www.sefaz.mt.gov.br -j ACCEPT
iptables -I FORWARD -d 200.203.106.0/32 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -d extranet.migrate.com.br -j ACCEPT
iptables -t filter -A FORWARD -i eth1 -d extranet.migrate.com.br -j ACCEPT
iptables -t nat -A PREROUTING -s 200.203.106.114 -p tcp -i eth0 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -d nfe.sefaz.rs.gov.br -j ACCEPT
iptables -t filter -A FORWARD -i eth1 -d nfe.sefaz.rs.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -s 200.203.106.114 -p tcp -i eth1 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -d homologacao.nfe.ms.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -d homologacao.nfe.ms.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -d producao.nfe.ms.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -d producao.nfe.ms.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -d
www.nfe.fazenda.gov.br -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -d
www.nfe.fazenda.gov.br -j ACCEPT
iptables -I FORWARD -d 200.201.160/20 -p tcp --dport 80 -j ACCEPT
iptables -t nat -I PREROUTING -d 200.201.160/20 -p tcp --dport 80 -j ACCEPT
iptables -t nat -I POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
iptables -I FORWARD -d 200.201.173.0/32 -p tcp --dport 80 -j ACCEPT
iptables -t nat -I PREROUTING -d 200.201.173.0/32 -p tcp --dport 80 -j ACCEPT
iptables -t nat -I POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -d 200.198.128.51 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -d 200.198.128.51 -j ACCEPT
iptables -t nat -A PREROUTING -i eth1 -p tcp -d 200.201.174.207 --dport 80 -j REDIRECT --to-port 3128
iptables -A FORWARD -s 192.168.0.11 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 192.168.0.11 -d loginnet.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.11 -d 64.4.13.0/24 -j ACCEPT
iptables -A FORWARD -s 192.168.0.11 -d login.live.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.11 -d login.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.11 -d gateway.messenger.hotmail.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -d loginnet.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -d 64.4.13.0/24 -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -d login.live.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -d login.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.3 -d gateway.messenger.hotmail.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -d loginnet.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -d 64.4.13.0/24 -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -d login.live.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -d login.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -d gateway.messenger.hotmail.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -p tcp --dport 1863 -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -d loginnet.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -d 64.4.13.0/24 -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -d login.live.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -d login.passport.com -j ACCEPT
iptables -A FORWARD -s 192.168.0.5 -d gateway.messenger.hotmail.com -j ACCEPT
iptables -t nat -A PREROUTING -p TCP --dport 80 -j REDIRECT --to-port 3128
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5505 -d 192.168.254.1 -j DNAT --to 192.168.0.5
iptables -A POSTROUTING -t nat -p tcp --dport 5505 -d 192.168.0.5 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5900 -d 192.168.254.1 -j DNAT --to 192.168.0.1
iptables -A POSTROUTING -t nat -p tcp --dport 5900 -d 192.168.0.1 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5507 -d 192.168.254.1 -j DNAT --to 192.168.0.16
iptables -A POSTROUTING -t nat -p tcp --dport 5507 -d 192.168.0.16 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5508 -d 192.168.254.1 -j DNAT --to 192.168.0.2
iptables -A POSTROUTING -t nat -p tcp --dport 5508 -d 192.168.0.2 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5506 -d 192.168.254.1 -j DNAT --to 192.168.0.3
iptables -A POSTROUTING -t nat -p tcp --dport 5506 -d 192.168.0.3 -j MASQUERADE
iptables -A PREROUTING -t nat -p tcp --dport 5509 -d 192.168.254.1 -j DNAT --to 192.168.0.4
iptables -A POSTROUTING -t nat -p tcp --dport 5509 -d 192.168.0.4 -j MASQUERADEiptables -A INPUT -p tcp -s 0/0 --dport 3389 --syn -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 3389 -i eth0 -j DNAT --to 192.168.0.100