0

I've just opened the pi for the first time, with Raspbian Buster Lite. When I type route -n I get:

Destination Gateway Genmask Flags Metric Ref Use Iface

I would expect to see the gateway ip here.

If if try sudo route add default gw 192.168.1.1 I get SIOCADDRT: Network is unreachable.

Some context: I'm trying to ssh into the pi, without success so far even though ssh is enabled. (getting a ssh: connect to host xxx.xxx.x.xxx port 22: Connection refused)

1
  • 1
    Routing table can only be empty if you have no network interfaces that are up. How do you plan to connect to the network anyway? WiFi? Jul 19, 2019 at 8:16

1 Answer 1

0

After a lot of trials to setup the pi with wifi, I gave up on solving this with wifi alone and ended up connecting the pi via ethernet cable. Just plug the cable and that's it!

Now route -n returns two rows.

(I will not mark my answer as accepted, as perhaps there are better ways to solve this)

7
  • Do you had a problem with wifi? It wasn't clear from the question. So your solution is to use the wired connection instead of wifi?
    – Ingo
    Jul 18, 2019 at 18:37
  • The pi was never connected to the internet in any way. And I was trying to setup it up for the first time using wifi. I didn't manage, while with ethernet is automatic, just plug the cable and the pi gets the default gateway.
    – Rexcirus
    Jul 18, 2019 at 18:43
  • Something confusing in my question (which now I edited) is that I was initially thinking to have the pi connected, but this was not true.
    – Rexcirus
    Jul 18, 2019 at 18:46
  • @Rexcirus, I have EXACTLY the same output to those commands, except I'm running CentOS in a virtualbox VM (not rasp pi). No way to plug a physical ethernet in. Any guess what's wrong in this case?
    – 208_man
    Dec 2, 2020 at 17:58
  • @Ingo I have EXACTLY the same output to those commands as Rexcirus, except I'm running CentOS in a virtualbox VM (not rasp pi). No way to plug a physical ethernet in. Any guess what's wrong in this case?
    – 208_man
    Dec 2, 2020 at 17:58

Your Answer

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

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