1

I have a strange problem. The szenario is the following: I have two Wifi dongle1 and dongle2. One is used to connect with the internet, and the other shell be used as AP.

When I only had dongle1 plugged, I configured my wifi connection, this means I modified the /eth/network/interfaces like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wp-ap-scan 1
wpa-scan-ssid 1
wpa-ssid "****"
wpa-psk "****"

Then I was able to connect from remote via ssh. Just for testing I unplugged dongle1 and plugged dongle2 and restarted the pi. I checked ifconfig on the pi, for the IP and then try to connect via ssh. It didn't work. I checked if the pi is connected with the internet, by sending a ping to google, and it is!

My /etc/ssh/sshd_config looks like this:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

So with short words:

dongle1: internet connection, ssh possible

dongle2: internet connection, ssh not possible.

4
  • you are using hostapd for the ap functionality? maybe only one of your two dongles is compatible? lookup: elinux.org/RPi_USB_Wi-Fi_Adapters
    – Alex Tape
    Feb 9, 2014 at 19:49
  • The AP information is just an additional information why I experiment with two dongles. The problem is, that I get a ssh connection if ONLY dongle1 is plugged, but I don't get a ssh connection (although I can ping to the www) if ONLY dongle2 is plugged. With :/
    – Sneek
    Feb 9, 2014 at 20:59
  • you have done anything like "service sshd restart" to bind/adapt the service to the (new) device/dongle?
    – Alex Tape
    Feb 9, 2014 at 21:06
  • I used sudo service networking restart and sudo service ssh restart. Both with no success. Even if I perform a full restart with dongle2
    – Sneek
    Feb 9, 2014 at 21:20

2 Answers 2

2

my approaches would be:

  1. use only one mac address (maybe your router uses static routes? external netmask, gateway and IP are assignet by DHCP from the ISP).
  2. check for duplicate mac address on your subnet/lan

IMHO a sneaky trick could be to change the external NIC from one of your dongles so that both got the same..

0

This post provides a workaround for this problem: http://www.raspberrypi.org/phpBB3/viewtopic.php?p=457395#p457395

I send a ping to my router if only dongle2 was connected and now I can connect via ssh.

1
  • even if you ping a gateway, the router´s arp table will be queried. if the router finds an (incorrect) entry he will replie to the wrong host (or even himself). if you ping the other hosts, they will arp and your server will respond. arp table gets a refresh/update and all fit together.. some thing if you ping the router. arp will get updated with you as a registered client on LAN/WLAN.
    – Alex Tape
    Feb 9, 2014 at 23:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.