PDA

View Full Version : Devo fare da router per il portatile: dove sbaglio?


Scoperchiatore
21-10-2005, 20:59
Salve a tutti, ho rimesso Fedora 4 sul fisso, e vorrei permettere al portatile di andare su internet (portatile con Fedora 3).

Mi sono fatto i (soliti) scriptini, che in ordine fanno (sottolineo le parti importanti, perchè il resto sono solo echo e comunicazioni per me)


echo 1 > /proc/sys/net/ipv4/ip_forward
if [ $? -eq 0 ]
then
echo " Routing Enabled"
fi

iptables -t nat -A POSTROUTING -j MASQUERADE
if [ $? -eq 0 ]
then
echo " Nat Enabled"
fi

iptables -A FORWARD -i eth2 -j ACCEPT
iptables -A FORWARD -i eth0 -j ACCEPT
if [ $? -eq 0 ]
then
echo " Forwarding over eth0 and eth2: ACCEPT"
fi

iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
if [ $? -eq 0 ]
then
echo " State over forward: ESTABLISHED,RELATED"
fi

iptables -I INPUT -s 192.168.0.0/24 -j ACCEPT


questa è la iptables dopo ave eseguito i comandi (ed aver aperto le porte ad amule)


[root@Scoperchiatore ~]# iptables -L
Chain FORWARD (policy DROP)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:4672
ACCEPT tcp -- anywhere anywhere tcp dpt:4662
ACCEPT all -- 192.168.0.0/24 anywhere
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited


Non mi sembra che ci sia nulla di sbagliato nei comandi che faccio, mi sembra anche di aprire tutte le porte necessarie, eppure il computer non forwarda per nulla. I due si pingano, SAMBA funziona senza problemi, ma oltre non si va.
Ovviamente ho anche provato a resettare la iptable, con -F ma non è cambiato nulla.

A questo punto ho sniffato i pacchetti: il mio PC risponde sempre al portatile:
Destination Unreachable "Host administratively prohibited"
[192.168.0.1 è il fisso, quello che dovrebbe fare da router, 0.15 è il portatile]

1 0.000000 192.168.0.15 85.37.17.17 DNS Standard query A www.google.it
2 0.000181 SunrichT_0b:de:6a Broadcast ARP Who has 192.168.0.15? Tell 192.168.0.1
3 0.000266 Wistron_a6:df:23 SunrichT_0b:de:6a ARP 192.168.0.15 is at 00:0a:e4:a6:df:23
4 0.000304 192.168.0.1 192.168.0.15 ICMP Destination unreachable (Host administratively prohibited)
5 0.000023 192.168.0.15 85.37.17.17 DNS Standard query A www.google.it
6 0.000039 192.168.0.1 192.168.0.15 ICMP Destination unreachable (Host administratively prohibited)
7 0.000132 192.168.0.15 85.37.17.17 DNS Standard query A www.google.it
8 0.000147 192.168.0.1 192.168.0.15 ICMP Destination unreachable (Host administratively prohibited)
.....


e continua così finchè non si stanca.

Non è un problema di resolving DNS, succede la stessa cosa anche se faccio un ping ad un IP (ad esempio quel 85.37.17.17 che è il DNS-serve di Alice dalle mie parti) oppure ai server di google.

Sembra che lui proibisca al mio PC di mandare pacchetti fuori, eppure dovrei essere nattato... :what:

Qualcuno ha qualche idea? Spero di aver fornito abbastanza elementi

r.
21-10-2005, 21:06
Con questo il nat funziona (sotto Gentoo)

Scoperchiatore
24-10-2005, 19:58
grazie mille, con quello script funziona tutto :D

Voglio solo testarlo, non ho letto tutto quel che fa, e probabilmente lo posso potare, in quanto accetta cose che probabilmente non mi servono. Però in un test che ho fatto

http://probe.hackerwatch.org/probe/probe.asp

dice che le porte principali sono tutte a posto. Ora cerco qualche altro test e vedo che dice....
Grazie :mano: