this post was submitted on 23 Feb 2026
34 points (100.0% liked)

Linux

63165 readers
645 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 6 years ago
MODERATORS
 

I suddenly need a wired connection for a job starting very soon but it won't be hooked up for quite some time. I have my neighborswifi password though. Iknow this is a longshot, but would I be able to use my laptop to change a wireless connection into a wired connection?

It's an older desktop Mac managed by the company. My laptop is an HP omen 15 with arch Linux on it

top 17 comments
sorted by: hot top controversial new old
[–] plateee@piefed.social 4 points 4 hours ago* (last edited 3 hours ago) (1 children)

Wait, why are you doing this? Is there some network throughput requirement? Just bridging wifi to Ethernet won't get you Ethernet speed, latency, or stability (since the back haul to the internet is WiFi).

This feels a bit like an XY Problem.

Edit: Wait, I'm guessing the company doesn't allow wifi? (That seems weird, if they're using a mandatory VPN, it shouldn't matter how the laptop gets to the internet). Leaving this in case anyone doesn't know about XY Problems. They've bitten me several times over the years.

[–] sorrybookbroke@sh.itjust.works 4 points 3 hours ago* (last edited 3 hours ago)

Yup, company requirement. I'm hoping that this will make it seem like I have a wired connection when I actually don't. Though it is a bit of an XY problem as there are other solutions like using a router in bridge mode as others have stated

[–] user28282912@piefed.social 8 points 6 hours ago* (last edited 6 hours ago) (1 children)

Assuming that:

  • your Linux Laptop uses wlan0 for its wireless connection and your home network uses 192.168.1.x for IP space.

On the Linux laptop:

  • as root or with sudo -- enable IP forwarding and load the change with sysctl -p.

sudo sysctl net.ipv4.ip_forward
sudo sysctl -p

  • if you have ufw installed and running -- setup a NAT masquerading rule for any hosts forwarding IPv4 traffic to it.
    add this line to /etc/ufw/before.rules file right after the "*nat" line

:POSTROUTING ACCEPT [0:0]

-A POSTROUTING -s 192.168.1.1/24 -o wlan0 -j MASQUERADE

On the mac:

  • set your IP address manually to be on the same LAN as the Linux laptop, but for the gateway address... point that at the IP for the Linux Laptop.
[–] FauxLiving@lemmy.world 3 points 1 hour ago* (last edited 1 hour ago)

sudo sysctl net.ipv4.ip_forward

sudo sysctl -p

Those do not enable forwarding. One prints the value of forwarding and the other loads the config file.

To set it temporarily

sudo sysctl net.ipv4.ip_forward=1

To set it permanantly, edit /etc/sysctl.conf (or add a config file to /etc/sysctl.d/). You only need to add one line that reads 'net.ipv4.ip_forward=1'

[–] INeedMana@piefed.zip 20 points 9 hours ago (1 children)

Yes, it's called IP Forwarding. I don't have iptables lines ready, it's been a long while since I've done it

[–] pageflight@piefed.social 1 points 9 hours ago

If you just run dhcpd on eth0 would that be enough? I'm assuming no based on your answer.

[–] rouxdoo@lemmy.world 13 points 9 hours ago (1 children)

Get a cheap travel router that can use "bridge mode" to receive the wifi and pass along the connection through it's ethernet port to your computer.

[–] sorrybookbroke@sh.itjust.works 3 points 9 hours ago

I have a spare router so this'll be better if it works out. Thanks for the suggestion

[–] MagnificentSteiner@lemmy.zip 4 points 7 hours ago

If you have a mobile phone you just just connect it to your laptop via USB and turn on tethering to use your mobile data.

[–] db2@lemmy.world 7 points 9 hours ago* (last edited 9 hours ago)

Don't do it the hard way. Get a GL.iNet GL-SFT1200 (or any but that one is inexpensive) and set it up as an extender for the neighbor WiFi. It's a basic function of the router and the Mac shouldn't know the difference.

[–] just_another_person@lemmy.world 7 points 9 hours ago (1 children)

You can, but you need to basically completely turn that laptop into a router. A cheap WiFi bridge would be more flexible.

[–] yaroto98@lemmy.world 8 points 9 hours ago (1 children)

A lot of wifi routers have a bridge mode you can put them in too. Just grab an old or cheap one, would likely draw less power and be quieter.

[–] just_another_person@lemmy.world 4 points 9 hours ago

Great point.

Basically what you want is to turn the linux laptop into a router. Thats doable. I believe Ars did an article on a similar build a couple years ago.

And here it is: https://arstechnica.com/gadgets/2016/04/the-ars-guide-to-building-a-linux-router-from-scratch/

It's an old build based on an almost 10 year old version of Ubuntu, but quickly glancing through it, I didn't see anything completely out of date. Version numbers will have changed and perhaps some package names will have changed but it will give you a starting point for further research. You won't want to cargo cult this build.

I think the main difference is that your internet would be coming in from the wifi interface and going out the ethernet interface rather than the other way around.

[–] elmicha@feddit.org 2 points 9 hours ago (1 children)
[–] sorrybookbroke@sh.itjust.works 2 points 9 hours ago

Wow that looks promising thank you for that

[–] mattesilver@101010.pl 1 points 9 hours ago

@sorrybookbroke sure, you just need $99.99 apple-compatible cross-over ethernet cable