Can't SSH when client IP has a different default gateway IP

Disco Starslayer

Honorable
Dec 6, 2013
14
0
10,510
Ok, so to clarify I would like to SSH from PuTTY on my Windows machine into a raspberry pi running raspbian. And yes, I already did a double check of all the obvious stuff like raspi-config blah blah blah... Normally, this would be trivial, but I am now in an apartment complex that provides WiFi and ethernet, so the networking situation is a little wack and I'm looking for some help.

Windows Machine (client):
IPv4 Address ...... 172.20.6.241
Subnet Mask ...... 255.255.0.0
Default Gateway .... 172.20.0.1

Raspberry Pi (host):
IPv4 Address ...... 172.20.6.220
Subnet Mask ...... 255.255.0.0
Default Gateway .... 172.20.0.1

Ok, so at first glance this doesn't seem like anything crazy. But I'm used to third set of numbers in the IP to be the same for both a machine's personal IP and the default gateway. i.e in this scenario 172.20.6.241 and 172.20.0.1. The 6 and 0 are usually the same on my home network.

At the end of the day I'd like to SSH from the windows to the pi. As of right now I can't even ping to the pi.

Thanks for the help, guys.
 
Can the Windows machine and the Pi ping or see the default gateway (guessing a router)? Can both see beyond the router, such as an Internet browser? Just checking that they seem properly setup.

On the face of it, both IP setups seem ok. The Class B private networks are 172.16.0.0 – 172.31.255.255, and your default gateway and subnet masks are set right so that any of the following IPs should be on the same subnet: 172.20.0.1-172.20.255.254, with 172.20.0.0 as network addy and 172.20.255.255 as broadcast.

 

Disco Starslayer

Honorable
Dec 6, 2013
14
0
10,510


yes, both the pi and the windows machine are able to use internet normally. Like I said, normally SSH isn't a big deal. I think the fact that I'm using my apartment complex provided internet service could be causing an issue that I'm unaware of. Or maybe its totally something else. But the apartment wifi/ethernet requires a provided username/password like you'd get at a hotel.

 

Disco Starslayer

Honorable
Dec 6, 2013
14
0
10,510
Heres the output from ifconfig:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.6.220 netmask 255.255.0.0 broadcast 172.20.255.255
inet6 fe80::d43a:9e44:9321:ab5a prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:e4:07:55 txqueuelen 1000 (Ethernet)
RX packets 186684 bytes 210887304 (201.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 131134 bytes 15382848 (14.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1832 bytes 133588 (130.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1832 bytes 133588 (130.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:b1:52:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
 

BuddhaSkoota

Admirable


Your apartment-provided wifi (much like a hotel or any other public wifi) likely has Client Isolation enabled, which prevents all connected devices from connecting directly to each other. This helps keep devices secure, but also prevents you from connecting to your own wifi-connected raspi.

A possible solution is to use your own router to create a private LAN with a wireless bridge to the apartment complex network for Internet access.