this post was submitted on 06 Mar 2024
25 points (93.1% liked)

Linux

48216 readers
1097 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Not sure if that title is accurate, this field is not my strong point. Basically I'm about to move homes. And in my new (temporary) home I wont have access to ethernet, plus my server doesn't have a network card. I was therefore wondering if it was possible to bridge a connection between my laptop to my server with an ethernet cable. This would obviously be a short term solution, but I'm wondering if it's possible and if so, how? Or is it better to buy a cheap network card?

My laptop is running NixOS and my server Unraid, if it should be to any help.

top 20 comments
sorted by: hot top controversial new old
[–] axzxc1236@lemm.ee 9 points 8 months ago* (last edited 8 months ago) (1 children)

In NetworkManager you can setup network sharing using Ethernet port on the laptop, then connect cable to your server.

Downside of that is you need to setup port forwarding in your laptop if you want to open port.

[–] LunchEnjoyer@lemmy.world 1 points 8 months ago (1 children)

Thanks I'll try this, don't need to open ports, as I use Tailscale 🙌

[–] tacostrange@lemmy.ml 1 points 8 months ago (1 children)

Found a listener of Jupiter Broadcasting

[–] LunchEnjoyer@lemmy.world 1 points 8 months ago (1 children)

Member* of JupiterBroadcasting 🤗 But I was using Tailscale before I found their show haha

[–] tacostrange@lemmy.ml 2 points 8 months ago (1 children)

It was the combination of Nixos btw and tail scale that gave it away

[–] LunchEnjoyer@lemmy.world 1 points 8 months ago

Hahaha yeah fair point, I'm also quite new to Linux so Nix is a lot at once, but really love it so far!

[–] cyborganism@lemmy.ca 5 points 8 months ago (3 children)

Of course you can.

However, my networking knowledge is not super fresh. I believe you need a special ethernet cable for this. A crossover ethernet cable. Then you have to manually set the IP address on both ends for that interface to something kind 192.168.0.1 and 192.168.0.2 Here's a quick how-to that shows an example.

Or... You don't have an individual router? Couldn't you just plug it in the router by ethernet cable?

[–] redcalcium@lemmy.institute 12 points 8 months ago (1 children)

I believe a crossover cable is no longer needed these days as most ethernet adapters implements Auto-MDIX .

[–] cyborganism@lemmy.ca 3 points 8 months ago

Ah ok.

I was born in the 1900's so... You know, things have changed in the 21st century.

[–] axzxc1236@lemm.ee 6 points 8 months ago

If both Ethernet NIC is over 1gbps, you are fine with using normal cable.

[–] LunchEnjoyer@lemmy.world 1 points 8 months ago

Thanks I'll try this!

[–] anamethatisnt@lemmy.world 4 points 8 months ago

An option is to buy a router that supports openwrt and install the travelmate package:
Quick Start Guide:
https://openwrt.org/docs/guide-quick-start/start
Travelmate Readme:
https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md
Supported hardware:
https://openwrt.org/toh/start?toh.filter.supportedcurrentrel=22.03%7C23.05

Then you could setup Wireless WAN (Connect to existing WiFi) + Wireless LAN (for laptop/phone) + Ethernet LAN (for server) in that router.

[–] SpicyAnt@mander.xyz 4 points 8 months ago* (last edited 8 months ago)

One way is to use iptables to forward the connection from the wireless interface through the ethernet interface. But I am not sure whether this is better than using the NetworkManager or a more specialized solution. I have used iptables for configuring WireGuard VPNs, but not for this specific use case.

[–] mvirts@lemmy.world 3 points 8 months ago (2 children)

I have a raspi 3b dedicated to being my wifi to ethernet bridge, the config is old and it runs rpi os but if your interested i can dig up how it works 🙃

[–] LunchEnjoyer@lemmy.world 2 points 8 months ago

I actually do have a spear rpi actually! However I was planning on running HomeassistantOS on it. But could do what you do as a temporary solution. If you wouldn't mind and have the time to look up your solution I would highly appreciate it 🙌

[–] towerful@programming.dev 2 points 8 months ago

You can do the same with $25 mikrotik device.
Infact, a lot of cheap wireless APs can connect to a wifi and bridge to ethernet, especially if they are running an openWRT fork (most cheapo wifi APs do)

[–] possiblylinux127@lemmy.zip 2 points 8 months ago* (last edited 8 months ago) (1 children)

How does your laptop have internet?

Depending on what's on the server it might be simpler to run a VM and a temporary solution.

[–] LunchEnjoyer@lemmy.world 1 points 8 months ago (1 children)

Via WiFi, sry if that wasn't clear. I simply don't have access to the router as that belongs to the landlord. He has a separate network for me, but it's on his side of the house 😅

[–] possiblylinux127@lemmy.zip 2 points 8 months ago

I think moving what you can to your laptop is the simplest approach depending on what you need. You will likely be without some stuff but it will be simpler to setup than a direct connection.

Of course if you have a ton of data that may not work.

[–] Nollij@sopuli.xyz 1 points 8 months ago

Your description isn't very clear on what exactly you have, or what you need.

It sounds like you have wired NICs in both server and laptop, which will be physically close to each other, but your only connection to the Internet will be WiFi that you don't control. How accurate is that?

Next question is how do you want them to connect to each other? You can do a P2P wired connection, which is more complicated but fully isolates your traffic. It also means that, unless each device has a separate connection and an appropriate routing config, it won't be online to the Internet (unless you set up some form of connection sharing). You can also connect them to a router that has no Internet. Simpler than the above, but the same limitations.

You could easily and cheaply get a USB Wi-Fi NIC. The major downside is that all traffic will be going across the wireless connection, both ways. This makes it slow and unreliable.

You can also connect them to a modified router configured as a wireless bridge. DD-WRT and others can be configured in a different way than usual. The wireless router will provide wired LAN ports to your local network, but then use the wireless connection to connect to an upstream WiFi.

None of this has anything to do with Linux, BTW. Once you choose a path, you should be able to implement it in whatever OS (or multiple OSes) you would like. None of it is new or special. You might get more options if you post in the Homelab, Data Hoarder, or Self Hosted communities.