Hello

I got a banana pi r3, and I want to connect some devices to it and have them accessible to my home network as well. The devices will be connected to the ethernet ports the system identifies as lan0 to lan3. Th e wan port is connected t my router.

I want to be able to connect to the banana pi from my network using a static ip, and I also want that any device connected to it in the lan ports gets an ip from my router’s dhcp and be accessible to the network as well. Is it possible? What would be the simplest way to do it?

The system image I’m running in the banana pi is a debian image that used systemd-networkd. So far, I’ve been a coupe of days trying everyhting in that /etc/systemd/network directory, trying to bridge the lan0 and the wan networks (I don’t even know if that’s what I really need, but it’s the closest I found), but I only manage to lock me out from ssh access messing it up. The information on the internet seems to be growing scarce, and I found nothing helpful.

    • morto@piefed.socialOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      9 days ago

      That one uses nmtui, which uses network manager, but I only have systemd-networkd. I could install networkmanager, but I’m a bit afraid messing it even more

  • just_another_person@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    9 days ago

    I’m super confused here…

    Can you detail all the devices involved here, the ports they have, and where you want them connected to?

    In general, there’s zero reason a single machine would have two ports connected to the same network. If they were part of DIFFERENT networks like a WAN/LAN split, then it would make sense.

    Edit: Was unfamiliar with this board. Honestly, I’d bootstrap it with OpenWRT and skip the manual Debian route if you intend to use this as a gateway router. If you’re not familiar with the networking side of things as it is, you’re going to introduce some serious lapses in security most likely.

    • morto@piefed.socialOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 days ago

      Sorry, I’m really bad at explaining things, and I’m also confused with this.

      I’m using this device (a banana pi r3):

      image

      The 4 ports marked as 4x GigE LAN are shown in ip addr as lan0@eth0 up to lan3@eth0. The GigE WAN/LAN port is shown as wan in the ip addr output. (I will post the full ip addr output soon, because I locked myself out from ssh access >.<)

      The wan port is connected to my home router, and in the lan ports, I have 4 other devices connected. I want to have all devices connected to the banana pi lan ports available for accessing from any device connected from my home router. I also want the banana pi board to be accessible via ssh from some static ip

      • just_another_person@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        9 days ago

        Okay…so you’re kind of using this as a switch then? Any reason you want these devices plugged directly into this board instead of all of them directly to your router or just a regular switch?

        In your use case, I’d still default to OpenWRT, regardless. It’s going to be a LOT easier for you manage.

        • morto@piefed.socialOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          9 days ago

          I tried openwrt first, and indeed, the network configuration was much easier, but then everything else was much more difficult and time consuming. Even system updates seemed overly complicated. I plan on running a few things on it, like zoneminder and syncthing, that will be much easier to maintain on debian

          As for the reason, I got no more free ports in my router, and If I added another regular router, I wouldn’t be able to run software on it, and would need an additional device, so this one allows me to add just one more device to the network. Well, considering that I manage to properly configure it…

          • just_another_person@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            9 days ago

            The main issue here is that you essentially just want it to be a switch and not a router, which is going to be problematic if you intend to pass traffic amongst them in different ways.

            The way you’re describing this working would be routing traffic on the uplink port to your router from the other interfaces. You’ll need this because a stock Debian install runs network interfaces as clients and not routed interfaces that pass traffic. You’re basically building another router and making certain other ports switch interfaces.

            This is a bit more complex than just getting a $10 cheap unmanaged switch and hanging that off your router for extra ports, but if you’re determined to go this route, you basically just need to look up routing traffic in Debian and you’ll find some guides.

  • CrackedLinuxISO@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 days ago

    Seconding the other user’s recommendation of an unmanaged switch.

    If your goal is to add more ethernet devices to your network, adding an unmanaged switch to your router is the simplest way to do it. Anything plugged into the switch will operate on the same network as your router and, as a pure hardware solution, it will never need software maintenance.

    If your goal is to learn how to build a router-oriented linux install from scratch, then go ahead with your original plan.

    • morto@piefed.socialOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 days ago

      Thanks for the answer

      Routers aren’t cheap around here, and I got this board for free as a prize from a contest, and I plan on running some things on it, so I find it t be the best option. Also, it will end up with fewer devices and less energy consumption. Having to learn a few things isn’t really a problem.

      • just_another_person@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        9 days ago

        You want a switch, not a router though. Any old one will do. You just need extra ports to plug things into, not route traffic. Even if you’re somewhere where they might be more expensive than average, they are thrown away regularly. Check eBay or the equivalent in your area and see if anything pops up dirt cheap.