[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: due schede di rete. Assieme non vanno!



On Sun, 2004-09-19 at 12:12 +0200, Leonardo Boselli wrote:

> L'unica possibilità e che ci sia a giro qualche nodo che si incazza se 
> qualche pacchetto viene da una scheda e altri da un altra.
> prova altrimenti a fare questo esperimento: dai alla eth1 un indirizzo 
> oltre il 129 e metti una netmask 255.255.255.128 e dicci che succede ...
> route che dice ?

alüra... sono a casa e in rete ci sono veramente pochi nodi... un beige
con linux che fa da dns e altri servizi con ip 192.168.3.2, un router
adsl con ip 192.168.3.254 e un AP wireless con ip 192.168.3.253... oltre
al mio tibook con ethernet e wireless collegati.

Primo esperimento

# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:03:93:44:C0:4A
          inet addr:192.168.3.19  Bcast:192.168.3.255
Mask:255.255.255.0
          inet6 addr: fe80::203:93ff:fe44:c04a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14905 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7878 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22177257 (21.1 MiB)  TX bytes:534678 (522.1 KiB)
          Interrupt:41 Base address:0xa400

eth1      Link encap:Ethernet  HWaddr 00:30:65:02:02:06
          inet addr:192.168.3.119  Bcast:192.168.3.255
Mask:255.255.255.0
          inet6 addr: fe80::230:65ff:fe02:206/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:97245 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54423 errors:589 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:143338099 (136.6 MiB)  TX bytes:6611372 (6.3 MiB)
          Interrupt:57

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:713360 errors:0 dropped:0 overruns:0 frame:0
          TX packets:713360 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:53004646 (50.5 MiB)  TX bytes:53004646 (50.5 MiB)


# ping 192.168.3.254   (il router adsl)
PING 192.168.3.254 (192.168.3.254) 56(84) bytes of data.
64 bytes from 192.168.3.254: icmp_seq=1 ttl=64 time=1.31 ms
64 bytes from 192.168.3.254: icmp_seq=2 ttl=64 time=0.749 ms
64 bytes from 192.168.3.254: icmp_seq=3 ttl=64 time=0.745 ms
funziona!

ora stacco il cavo a eth0 e mi assicuro che eth1 abbia una connessione
attiva con dmesg:

....
eth1: New link status: Connected (0001)
eth0: Link down
PHY ID: 1410c62, addr: 0
eth1: New link status: Disconnected (0002)
eth1: New link status: Connected (0001)

# ping 192.168.3.254
PING 192.168.3.254 (192.168.3.254) 56(84) bytes of data.
--- 192.168.3.254 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms

nada!  :-(

la configurazione è la seguente:
-----------------------------------------------------
% cat interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.3.19
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
        gateway 192.168.3.254
        dns-nameservers 192.168.3.2


auto eth1
iface eth1 inet static
        address 192.168.3.119
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
        wireless-mode managed
        wireless-essid WLAN
        wireless-key xxxxxxxxxxxxxxxxx
        gateway 192.168.3.254
        dns-nameservers 192.168.3.2
-------------------------------------------------

Qui il risultato di route:

# route
Kernel IP routing table
Destination     Gateway    Genmask         Flags Metric Ref    Use Iface
localnet        *          255.255.255.0   U     0      0        0 eth0
localnet        *          255.255.255.0   U     0      0        0 eth1
default    192.168.3.254   0.0.0.0         UG    0      0        0 eth1
default    192.168.3.254   0.0.0.0         UG    0      0        0 eth0

--------------------------------------------------------------------------



Secondo esperimento  (suggerito da Leonardo)

mettere il gateway solo su una scheda:

...provo a metterlo solo su eth0
niente...  se collego il cavo di eth0 la rete va, ma se lo scollego non
va più neppure a riavviare la rete con 
# /etc/init.d/networking restart

provo a scambiare il gateway con le due schede, gioè ad attivarlo solo
su eth1 (la scheda wireless)

SI!!!  funziona! anche a scollegare e ricollegare la rete da eth0!

questo il risultato di route:

# route
Kernel IP routing table
Destination     Gateway   Genmask         Flags Metric Ref    Use Iface
localnet        *         255.255.255.0   U     0      0        0 eth1
localnet        *         255.255.255.0   U     0      0        0 eth0
default   192.168.3.254   0.0.0.0         UG    0      0        0 eth1
-----------------------------------------------------------------------

ma che succede se spengo l'access point wireless?

:-( quello che immaginavo... la rete funzionava si ma solo attraverso
eth1, quindi non molto utile.


------------------------------------


Terzo esperimento (sempre di leonardo)

metto a eth1 l'ip 192.168.3.130 con netmask 255.255.255.128 e attivo il
gateway per entrambe le schede
---------------------------------------
auto eth0
iface eth0 inet static
        address 192.168.3.19
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255
        gateway 192.168.3.254
        dns-nameservers 192.168.3.2
auto eth1
iface eth1 inet static
        address 192.168.3.130
        netmask 255.255.255.128
        network 192.168.3.0
        broadcast 192.168.3.255
        wireless-mode managed
        wireless-essid WLAN
        wireless-key xxxxxxxxxxxxxxxxxxxx
        gateway 192.168.3.254
        dns-nameservers 192.168.3.2
-------------------------------------------
peggio che andare di notte... :(

...provo a disattivare il gateway per eth0

niente la rete va solo se il cavo è collegato a eth0

.... provo a scollegare il cavo ad eth0 e attivare il gateway solo su
eth0

uguale... la rete non va se il cavo è sollegato da eth0

-----------------------------


a questo punto non so più che provare. per il momento mi sono fatto uno
script che fa da switch tra una configurazione e l'altra, ma non è il
massimo della vita.

forse attivare un bridge tra una scheda e l'altra? mai fatto, ma ho
letto un articolo e non sembra difficile, potrebbe essere una buona via?

ciao
MaX













Reply to: