Hi! I hope this is the right community to ask.

Next week I will be on the road for 5 Days for work. I have quite some spare time, so I thought I would dig up my raspberry project again and hopefully finish it.

I need it with me, because it controls some hardware, so a VPN to home does not work. So only option I could think of, is to connect the pi directly to my laptop via an ethernet cable. As far as I understood from some research is that I would need to install and run an DHCP server on my laptop, which they did not recommend. Alternatively they suggested to just take a router and plug both devices in there. I don’t really have a spare router, so that’s not an option either.

To be hones it confuses me a little, that there does not seem to be a standard for connecting to a device directly over a single cable and login with a user account.

Any recommendations how I can work on the pi like with ssh?

Thanks a lot!

  • rtxn@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    8 months ago

    Give each device a static address, and set the default gateway to whatever’s on the other end of the cable. You might need a crossover cable, but most NICs can work using a straight-through.

    E.g. set the laptop’s address to 169.254.1.1/16 and default gateway to 169.254.1.2, and the RPi’s address to 169.254.1.2/16 and default gateway to 169.254.1.1. They should be able to talk to each other then.

    If those addresses seem familiar - Windows uses the 169.254.0.0/16 subnet to automatically assign random addresses if DHCP fails, so that if there are several computers in the subnet, they’ll at least have addresses that can talk to each other. It’s called APIPA in Windows, and Zeroconf in the Unixverse.

    • AbidanYre@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      8 months ago

      You jump between 196 and 169 in your comment.

      It’s not just Windows that uses 169.254. That’s a special block used for self assigned link-local addresses.

    • WasPentalive@lemmy.one
      link
      fedilink
      English
      arrow-up
      1
      ·
      8 months ago

      Would the Pi automatically set an APIPA address if DHCP was not available? If so he need only connect the cable, and ask each machine what their address is.

      • rtxn@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 months ago

        No idea. It depends on what software it uses for network configuration, and how that software handles DHCP failure. I use NetworkManager and I’ve never gotten an APIPA address.