Fórum Ubuntu Linux - PT
19 de Junho de 2013, 16:49 *
Olá, Visitante. Faça o login ou registre-se.
Perdeu o seu e-mail de ativação?

Login com nome de usuário, senha e duração da sessão
Notícias: Informações da última versão: Ubuntu Linux 13.04 -Raring Ringtail
 
   Home   Ajuda Regras Pesquisa Login Registre-se  
Anúncios
Páginas: [1]   Ir para o fundo
  Imprimir  
Autor Tópico: Não consigo compartilhar internete na rede interna  (Lida 496 vezes)
paulofnet
Usuário Ubuntu
*
Deslogado Deslogado

Mensagens: 5


Ver Perfil
« em: 19 de Maio de 2012, 07:53 »

 Zangado

Ubuntu server 12.04.

- Modem ZTE está conectado a eth1
- Após rodar pppoeconf o servidor navega normalmente.
- No roteador wireless desabilitei o dhcp e coloqeui o ip 192.164.1.10 (está como ponto de acesso apenas)
- já retirei o proxy mas os clientes continuam a não navegar

Minha configuração está assim:

#/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider

auto eth1
iface eth1 inet static
address 192.168.1.7
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

###################################################

#/etc/dhcp/dhcpd.conf
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
#ption domain-name "lanpredio2
#ption domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;


#lanpredio2
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.50;
options routers 192.168.1.7;
option boadcast-address 192.168.1.255;
}

###################################################
#/etc/NetworkManager$
[main]
plugins=ifupdown,keyfile
dns=dnsmasq

[ifupdown]
managed=true

===================================================

#/etc/default/isc-dhcp-server
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

===================================================

#firewall compartilha

# Firewall compatilha
#
#!/bin/bash -e
#
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

#
#não responde a ping
#

echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all

# habilita forward
echo 1 > /proc/sys/net/ipv4/ip_forward

# Abre algumas portas (opcional)

iptables -t nat -A PREROUTING -i eth0 -p udp --dport 7777:7779 -j DNAT --to-dest 192.168.1.7
iptables -A FORWARD -p udp -i eth1 --dport 7777:7779 -d 192.168.1.7 -j ACCEP

iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1021 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1080 -j ACCEPT

# Abre para a rede local

iptables -A INPUT -p tcp --syn -s 192.168.1.0/255.255.255.0 -j ACCEPT

# Fecha o resto
iptables -A INPUT -p tcp --syn -j DROP


#foward da porta. Neste caso estou direcionando a porta 22 (do SSH) na conexão com a internet (eth1) para o eth1 192.168.1.7 da rede local:

iptables -t nat -A PREROUTING -i etho -p tcp --dport 22 -j DNAT --to-dest 192.168.1.7
iptables -A FORWARD -p tcp -i eth0 --dport 22 -d 192.168.1.7 -j ACCEPT


#No bittorrent, que usa as portas tcp de 6881 a 6889 (ele tenta uma a uma até achar uma disponível) a regra seria:

# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 6881:6889 -j DNAT --to-dest 192.168.0.2
# iptables -A FORWARD -p tcp -i eth0 --dport 6881:6889 -d 192.168.1.7 -j ACCEPT

================================================



Desde já agradeço qq. ajuda...
Registrado
EdvaldoSCruz
Usuário Ubuntu
*
Deslogado Deslogado

Mensagens: 2.083


Viva o Ubuntu !!! (imac e macbook pro - Apple)


Ver Perfil WWW
« Responder #1 em: 19 de Maio de 2012, 08:59 »

Veja se esse tópico lhe ajuda: BR-linux
Registrado

Jesus Cristo está voltando. PREPARE-SE !!!!!!! Meu JESUS CRISTO, tenhas misericórdia dessas Almas Viventes também *IPDA*
Para os Iniciantes, como eu, links de solucionar problemas rapidamente.
zekkerj
Usuário Ubuntu
*
Deslogado Deslogado

Mensagens: 14.243


Sua imensa torcida é bem feliz...


Ver Perfil
« Responder #2 em: 19 de Maio de 2012, 11:38 »

Correções em vermelho.

Arquivo /etc/network/interfaces:

Citar
#/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet manual

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth1 up # line maintained by pppoeconf
provider dsl-provider

auto eth0
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

Arquivo /etc/dhcp/dhcpd.conf:
Citar
#/etc/dhcp/dhcpd.conf
#

default-lease-time 600;
max-lease-time 7200;

authoritative;

log-facility local7;

#lanpredio2
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.2 192.168.1.50;
    options routers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    option domain-name-servers 8.8.8.8, 8.8.4.4;
}

Veja que eu estou mudando teu endereço de "192,168.1.7" pra "192.168.1.1". Vc está fazendo o papel de gateway da rede, assuma essa posição, rapaz!!! O primeiro endereço tradicionalmente é do gateway.

Sobre o teu firewall, cara, tá todo errado. Os redirecionamentos não vão funcionar, estão na cadeia errada, e usando os targets errados.
Registrado

Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? Sem Graça
paulofnet
Usuário Ubuntu
*
Deslogado Deslogado

Mensagens: 5


Ver Perfil
« Responder #3 em: 19 de Maio de 2012, 18:47 »

Zangado

Ubuntu server 12.04.

- Modem ZTE está conectado a eth1
- Após rodar pppoeconf o servidor navega normalmente.
- No roteador wireless desabilitei o dhcp e coloqeui o ip 192.164.1.10 (está como ponto de acesso apenas)
- já retirei o proxy mas os clientes continuam a não navegar

Minha configuração está assim:

#/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider

auto eth1
iface eth1 inet static
address 192.168.1.7
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

###################################################

#/etc/dhcp/dhcpd.conf
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
#ption domain-name "lanpredio2
#ption domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;


#lanpredio2
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.50;
options routers 192.168.1.7;
option boadcast-address 192.168.1.255;
}

###################################################
#/etc/NetworkManager$
[main]
plugins=ifupdown,keyfile
dns=dnsmasq

[ifupdown]
managed=true

===================================================

#/etc/default/isc-dhcp-server
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/isc-dhcp-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="eth0"

===================================================

#firewall compartilha

# Firewall compatilha
#
#!/bin/bash -e
#
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

#
#não responde a ping
#

echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all

# habilita forward
echo 1 > /proc/sys/net/ipv4/ip_forward

# Abre algumas portas (opcional)

iptables -t nat -A PREROUTING -i eth0 -p udp --dport 7777:7779 -j DNAT --to-dest 192.168.1.7
iptables -A FORWARD -p udp -i eth1 --dport 7777:7779 -d 192.168.1.7 -j ACCEP

iptables -A INPUT -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1021 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 1080 -j ACCEPT

# Abre para a rede local

iptables -A INPUT -p tcp --syn -s 192.168.1.0/255.255.255.0 -j ACCEPT

# Fecha o resto
iptables -A INPUT -p tcp --syn -j DROP


#foward da porta. Neste caso estou direcionando a porta 22 (do SSH) na conexão com a internet (eth1) para o eth1 192.168.1.7 da rede local:

iptables -t nat -A PREROUTING -i etho -p tcp --dport 22 -j DNAT --to-dest 192.168.1.7
iptables -A FORWARD -p tcp -i eth0 --dport 22 -d 192.168.1.7 -j ACCEPT


#No bittorrent, que usa as portas tcp de 6881 a 6889 (ele tenta uma a uma até achar uma disponível) a regra seria:

# iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 6881:6889 -j DNAT --to-dest 192.168.0.2
# iptables -A FORWARD -p tcp -i eth0 --dport 6881:6889 -d 192.168.1.7 -j ACCEPT

================================================



Desde já agradeço qq. ajuda...

Valeu vou providenciar as mudanças e retorno. Bom final de semana.
Registrado
Páginas: [1]   Ir para o topo
  Imprimir  
 
Ir para:  

Powered by MySQL Powered by PHP Tema desenvolvido por FaBMak e n3t0
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines
© 2013 Canonical Ltd. Ubuntu e Canonical são marcas registradas da Canonical Ltd.
XHTML 1.0 válido! CSS válido!