|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Sep 2001
Città: Roma
Messaggi: 1944
|
Devo fare da router per il portatile: dove sbaglio?
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) Codice:
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
Codice:
[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 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] Codice:
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)
.....
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... ![]() Qualcuno ha qualche idea? Spero di aver fornito abbastanza elementi
__________________
"Oggi è una di quelle giornate in cui il sole sorge veramente per umiliarti" Chuck Palahniuk Io c'ero |
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Jul 2003
Messaggi: 207
|
Prova questo script
Con questo il nat funziona (sotto Gentoo)
__________________
------------------------------------- Fletto i muscoli e sono nel vuoto ------------------------------------ |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Sep 2001
Città: Roma
Messaggi: 1944
|
grazie mille, con quello script funziona tutto
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
__________________
"Oggi è una di quelle giornate in cui il sole sorge veramente per umiliarti" Chuck Palahniuk Io c'ero |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:41.




















