Amigos, tenho um servidor Debian com acesso a Internet que não consigo
compartilhar com uma estação, a rede funciona normal, a estação pinga
no servidor, monto meu diretório /home na estação via NFS sem
problemas, mas não consigo acessar a internet a partir da estação, a
rede é DHCP:

No servidor:
# ifconfig

eth1       Encapsulamento do Link: Ethernet  Endereço de HW 00:08:54:28:42:90
          inet end.: 192.168.2.1  Bcast:192.168.2.255  Masc:255.255.255.0
          endereço inet6: fe80::208:54ff:fe28:4290/64 Escopo:Link
          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
          RX packets:1996 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1846 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:1000
          RX bytes:235763 (230.2 KiB)  TX bytes:455403 (444.7 KiB)
          IRQ:217 Endereço de E/S:0xa000

eth2       Encapsulamento do Link: Ethernet  Endereço de HW 00:0F:EA:B3:69:8C
          inet end.: 10.1.1.2  Bcast:10.255.255.255  Masc:255.0.0.0
          endereço inet6: fe80::20f:eaff:feb3:698c/64 Escopo:Link
          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
          RX packets:34960 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30139 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:1000
          RX bytes:35406669 (33.7 MiB)  TX bytes:3800459 (3.6 MiB)
          IRQ:209 Endereço de E/S:0x2000

lo         Encapsulamento do Link: Loopback Local
          inet end.: 127.0.0.1  Masc:255.0.0.0
          endereço inet6: ::1/128 Escopo:Máquina
          UP LOOPBACKRUNNING  MTU:16436  Métrica:1
          RX packets:3447 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3447 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:0
          RX bytes:976188 (953.3 KiB)  TX bytes:976188 (953.3 KiB)

ppp0       Encapsulamento do Link: Protocolo Ponto-a-Ponto
          inet end.: 189.41.156.40  P-a-P:200.225.196.100  Masc:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Métrica:1
          RX packets:425 errors:0 dropped:0 overruns:0 frame:0
          TX packets:419 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:3
          RX bytes:33908 (33.1 KiB)  TX bytes:38455 (37.5 KiB)

Um detalhe , não sei porque na minha maquina não aparece eth0, mas o
Debian configurou assim na instalação.

#route
Tabela de Roteamento IP do Kernel
Destino         Roteador        MáscaraGen.    Opções Métrica Ref   Uso Iface
cl-smar-stz.ctb *               255.255.255.255 UH    0      0        0 ppp0
192.168.2.0     *               255.255.255.0   U     0      0        0 eth1
10.0.0.0        *               255.0.0.0       U     0      0        0 eth2
default         *               0.0.0.0         U     0      0        0 ppp0
default         10.1.1.1        0.0.0.0         UG    0      0        0 eth2

/etc/network/interfaces

auto lo eth1
iface lo inet loopback

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

auto eth2

#iface eth2 inet manual

iface eth1 inet static
  address 192.168.2.1
  netmask 255.255.255.0
  network 192.168.2.0
  broadcast 192.168.2.255
  gateway 192.168.2.0

iface eth2 inet dhcp

/etc/dhcp3/dhcpd.conf

ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "Programador.localdomain";
option domain-name-servers 192.168.2.1, 200.225.197.37, 200.225.197.34;

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
#option broadcast-address 255.255.255.255;
option broadcast-address 192.168.2.0;
option routers 192.168.2.0;
option domain-name-servers 192.168.2.1;
option domain-name "Programador";

# 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;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.1 192.168.2.100;
}

Mesmo com os comandos:
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE ou

iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE não funciona.
---------------------------------------------------------------------------
Esta lista é patrocinada pela Conectiva S.A. Visite http://www.conectiva.com.br

Arquivo: http://bazar2.conectiva.com.br/mailman/listinfo/linux-br
Regras de utilização da lista: http://linux-br.conectiva.com.br
FAQ: http://www.zago.eti.br/menu.html

Responder a