I've a SSH server on my raspberry pi running on ubuntu. For a while I've used normally, then for some reason it stopped working with the public ip and when try to connect get this error:
ssh: connect to host: Network is unreachable
Recently I tried to create a bruteforce script for ssh and used that as a target. I think the two things are related, but I can't figure out how to fix it. On my desktop where another openssh server is activated, ssh works fine with public IP. Only with raspberry pi I've this problem (pc and raspberry use different port), i tried uninstalling openssh-server
and reinstalling it but it didn't work.
I don't have any kind of firewall on my RPi and left default ssd_config settings except for Port and Gateway Ports (switched to yes).
EDIT:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether dc:a6:32:90:6b:58 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether dc:a6:32:90:6b:5a brd ff:ff:ff:ff:ff:ff
inet 192.168.0.198/24 brd 192.168.0.255 scope global dynamic noprefixroute wlan0
valid_lft 150759sec preferred_lft 150759sec
inet6 fdd7:21:9a00:9833:dad:b3f6:5ff6:baa4/64 scope global dynamic noprefixroute
valid_lft 2590904sec preferred_lft 603704sec
inet6 2a0e:410:7b5:0:1515:b934:3d2f:a8d/64 scope global dynamic noprefixroute
valid_lft 2566sec preferred_lft 2504sec
inet6 fe80::78b:7170:f144:1663/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether c2:94:3b:10:8a:e7 brd ff:ff:ff:ff:ff:ff permaddr c4:6e:1f:18:70:28