# sshfs hangs when eth0 is unplugged and wlan0 is plugged

## kipibenkipod

Hi all,

I have eth0 and wlan0 working. 

I'm mounting sshfs when eth0 is plugged. 

When unplugging eth0, I would like that the sshfs mount will continue working via wlan0. 

For now the mount point is just hanging, and I need to 'kill -9' on sshfs process. 

Then again mount it on the wireless link.

Is there a solution for this problem?

Thanks,

Kfir

----------

## NeddySeagoon

kipibenkipod,

You probably need to donate your network interfaces to a bond ans assign the IP address to the bond, not the underlying interfaces.

Please post the output of route -n and ifconfig, taken when both interfaces are operating.

----------

## kipibenkipod

NeddySeagoon,

Here is the output of ifconfig and route -n.

```

legolas kfir # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0a:e4:cc:63:48  

          inet addr:192.168.2.21  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::20a:e4ff:fecc:6348/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:23127624 errors:2 dropped:0 overruns:0 frame:2

          TX packets:16084949 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:1331475072 (1.2 GiB)  TX bytes:1190595951 (1.1 GiB)

          Memory:ee000000-ee020000 

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:1668973 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1668973 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:94012871 (89.6 MiB)  TX bytes:94012871 (89.6 MiB)

wlan0     Link encap:Ethernet  HWaddr 00:19:d2:97:7c:d2  

          inet addr:192.168.2.29  Bcast:192.168.2.255  Mask:255.255.255.0

          inet6 addr: fe80::219:d2ff:fe97:7cd2/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1261957 errors:0 dropped:0 overruns:0 frame:0

          TX packets:749901 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1851374391 (1.7 GiB)  TX bytes:71229590 (67.9 MiB)

legolas kfir # route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

192.168.2.0     0.0.0.0         255.255.255.0   U     2000   0        0 wlan0

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.2.63    0.0.0.0         UG    0      0        0 eth0

0.0.0.0         192.168.2.63    0.0.0.0         UG    2000   0        0 wlan0

```

I'm using ifmetric to make eth0 used when possible, by using the commands in /etc/conf.d/net:

```

modules=( "ifmetric" )

config_wlan0=( "1" )

```

Regards,

Kfir

----------

## krinn

like neddyseaggon says...

routing from eth0 then wlan0, so if your eth0 is unplug the routing will fail for eth0 and wlan0 now wait for eth0 to timeout.

look here : http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap6

----------

## NeddySeagoon

kipibenkipod,

When you have more than one interface in a subnet, only the first interface in the routing table is used.

Unpluging eth0 does not put the interface down, so packets are still sent to eth0 and sshfs does nothing.

If bonding doesn't work, you can try ifplug, which will stop and start a wired interface depending on the link status.

----------

## kipibenkipod

Hi,

I have set bonding eth0+wlan0 but there is a strange thing:

When i restart bond0 it will start wlan0, then associate with AP, then it will drop association.

Then I need to start wlan0 again. 

In syslog I get this line:

 kernel: wlan0: deauthenticating from 00:30:bd:c7:8a:86 by local choice (reason=3)

This is the line responsible for droping the ap association.

Here is the iwconfig after this:

```

iwconfig

lo        no wireless extensions.

sit0      no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bg  Mode:Managed  Frequency:2.462 GHz

          Access Point: Not-Associated   Tx-Power=15 dBm

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:BCFD-5D81-39

          Power Management:off

bond0     no wireless extensions.

```

After I restart wlan0 I get:

```
 iwconfig

lo        no wireless extensions.

sit0      no wireless extensions.

               

eth0      no wireless extensions.

               

wlan0     IEEE 802.11bg  ESSID:"bolt"

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:30:BD:C7:8A:86

          Bit Rate=1 Mb/s   Tx-Power=15 dBm

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:BCFD-5D81-39

          Power Management:off

          Link Quality=53/70  Signal level=-57 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

               

bond0     no wireless extensions.

               

```

What is the problem?

Thanks,

Kfir

----------

