
saitam
(usa Slackware)
Enviado em 12/12/2012 - 08:54h
fabinhotdb escreveu:
root@debian:~# uname -a
Linux debian 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.32-1~bpo60+1 x86_64 GNU/Linux
root@debian:~# whereis iptables
iptables: /sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz
root@debian:~# iptables
iptables v1.4.8: no command specified
Try `iptables -h' or 'iptables --help' for more information.
iptables -t nat -nvL
Chain PREROUTING (policy ACCEPT 4174 packets, 249K bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 4174 packets, 249K bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 8108 packets, 553K bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 8019 packets, 532K bytes)
pkts bytes target prot opt in out source destination
89 20860 MASQUERADE all -- * eth0 0.0.0.0/0 0.0.0.0/0
route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.254.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
200.164.176.133 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
Descoberto agora o motivo de não fazer o compartilhamento de conexão.
Sua interface externa é ppp0, que liga para internet (rua), então a regra iptables que faz NAT compartilhando conexão deve alterar de eth0 para ppp0.