Cfg rete
Gabriele Villi
gvilli a iol.it
Mer 31 Lug 2002 13:26:16 UTC
Qualche giorno fa un amico mi ha chiesto una mano con un problema di rete;
io ho fatto quel che ho potuto, ma proprio non riesco a capire cosa sta
succedendo. Riassumo la situazione
rete1(192.168.0.0/24)------- adslbackup (192.168.0.254)
|
|
gwlinux(eth0 192.168.0.100, eth1 192.168.1.100)
|
|
rete2 ( 192.168.1.0/24 )
|
|
pix (192.168.1.1 )
|
|
router
|
|
internet
rete1 e rete2 devono vedersi senza restrizioni ed entrambe devono poter
uscire verso internet; adslbackup andra' rimosso ma per ora c'e' (per
questo lo vedremo citato nelle tabelle di routing)
Il problema e' (cito testualmente)
"Per ora sono obbligato a effettuare il MASQUERADING dei pacchetti dalla
rete 192.168.0.1 alla rete 192.168.1.1 altrimenti non รจ possibile pingare
da una sull'altra e viceversa ne tantomeno uscire su internet passando dal
firewall pix."
Mi sono fatto spedire un po' di cosette per capire la config del suo gw linux
[root a masterlinux /home/stamba]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:04:76:1C:80:F1
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:419008 errors:1 dropped:0 overruns:1060 frame:1
TX packets:325801 errors:0 dropped:0 overruns:0 carrier:0
collisions:591 txqueuelen:100
RX bytes:62177907 (59.2 Mb) TX bytes:99781683 (95.1 Mb)
Interrupt:5 Base address:0xc800
eth1 Link encap:Ethernet HWaddr 00:04:76:1C:80:67
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:354203 errors:0 dropped:0 overruns:2816 frame:0
TX packets:268586 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:59519071 (56.7 Mb) TX bytes:40086366 (38.2 Mb)
Interrupt:5 Base address:0xc400
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:320 errors:0 dropped:0 overruns:0 frame:0
TX packets:320 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:33254 (32.4 Kb) TX bytes:33254 (32.4 Kb)
[root a masterlinux /home/stamba]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0
[root a masterlinux /home/stamba]# ipchains -L -n
Chain input (policy ACCEPT):
target prot opt source destination ports
out-mlin all ------ 192.168.1.0/24 192.168.1.100 n/a
Chain forward (policy DENY):
target prot opt source destination ports
MASQ all ------ 192.168.0.0/24 192.168.1.0/24 n/a
Chain output (policy ACCEPT):
Chain out-mlin (1 references):
target prot opt source destination ports
ACCEPT tcp ------ 0.0.0.0/0 192.168.1.100 * -> 23
DENY tcp -y--l- 0.0.0.0/0 0.0.0.0/0 * -> *
REJECT tcp ----l- 0.0.0.0/0 192.168.1.100 *
-> 137:139
[root a masterlinux /home/stamba]# uname -a
Linux masterlinux 2.4.18-3 #1 Thu Apr 18 07:32:41 EDT 2002 i686 unknown
[root a masterlinux /home/stamba]# cat /proc/sys/net/ipv4/ip_forward
1
Poi gli ho fatto "aprire" completamente ipchains e cambiare la tabella di
routing; mi ha rispedito l'out di route -n ma non quello di ipchains -L, me
ne sto accorgendo adesso... poi lo picchio :)
192.168.1.0 192.168.1.100 255.255.255.0 UG 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 192.168.0.100 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.0.254 0.0.0.0 UG 0 0 0 eth0
e l'amico fritz mi dice
SENZA IL MASQERADING
E:\Documents and Settings\Administrator.ALDO>ping 192.168.1.1
Esecuzione di Ping 192.168.1.1 con 32 byte di dati:
Richiesta scaduta.
Richiesta scaduta.
[%< snip %< ]
CON IL MASQERADING
E:\Documents and Settings\Administrator.ALDO>ping 192.168.1.1
Esecuzione di Ping 192.168.1.1 con 32 byte di dati:
Risposta da 192.168.1.1: byte=32 durata<10ms TTL=127
Risposta da 192.168.1.1: byte=32 durata<10ms TTL=127
[%< snip %< ]
Mi son fatto mandare anche la cfg della mcchina win
E:\Documents and Settings\Administrator.ALDO>route print
===========================================================================
Elenco interfacce
0x1 ........................... MS TCP Loopback interface
0x2 ...00 01 02 f4 ce bb ...... 3Com EtherLink PCI
===========================================================================
===========================================================================
Route attive:
Indirizzo rete Mask Gateway Interfac. Metric
0.0.0.0 0.0.0.0 192.168.0.100 192.168.0.24 1
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.24 192.168.0.24 1
192.168.0.24 255.255.255.255 127.0.0.1 127.0.0.1 1
192.168.0.255 255.255.255.255 192.168.0.24 192.168.0.24 1
193.70.192.70 255.255.255.255 192.168.0.254 192.168.0.24 1
194.183.64.10 255.255.255.255 192.168.0.254 192.168.0.24 1
194.183.64.11 255.255.255.255 192.168.0.254 192.168.0.24 1
224.0.0.0 224.0.0.0 192.168.0.24 192.168.0.24 1
255.255.255.255 255.255.255.255 192.168.0.24 192.168.0.24 1
Gateway predefinito: 192.168.0.100
===========================================================================
Dal gw linux mi dice che pinga ovunque, con e senza masq.
Qui, almeno per me, termina il mondo conosciuto ed inizia il regno del
mistero. C'e' qualche anima pia che mi sa dare qualche dritta?
Grazie
gv
Maggiori informazioni sulla lista
Lug
|