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
23 Comments
INeedMana@piefed.zip · 24 pts · 189d
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 · 2 pts · 189d
If you just run dhcpd on eth0 would that be enough? I'm assuming no based on your answer.
osaerisxero@kbin.melroy.org · 8 pts · 189d
No, because there wouldn't be anything connecting the two ports together. In your scenario, all each side would be able to do would be to talk to 'cpu', there would be no mechanism to forward traffic upstream without iptables or something similar handling that function.
INeedMana@piefed.zip · 3 pts · 188d
Ah, that link did not go into details, I'm sorry. Take a look here. It might look daunting but effectively it was just a few lines AFAIR
rouxdoo@lemmy.world · 17 pts · 189d
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 · 4 pts · 189d
I have a spare router so this'll be better if it works out. Thanks for the suggestion
user28282912@piefed.social · 13 pts · 188d
Assuming that:
On the Linux laptop:
add this line to /etc/ufw/before.rules file right after the "*nat" line
On the mac:
FauxLiving@lemmy.world · 10 pts · 188d
Those do not enable forwarding. One prints the value of forwarding and the other loads the config file.
To set it temporarily
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'
user28282912@piefed.social · 2 pts · 188d
Thanks for noticing that. I certainly missed the '=1' bit.
plateee@piefed.social · 11 pts · 188d
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 · 9 pts · 188d
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
plateee@piefed.social · 7 pts · 188d
In that case, grab one of these: GL-iNet Opal Travel Router.
They're sub $40 on Amazon (in the states), will do bridging for you, and are rock solid. I've used one for the past three years whenever I've traveled to conferences/for work.
TypFaffke@feddit.org · 5 pts · 188d
So I knew about the concept behind XY problems. They come up in my job quite frequently. I didn't know the phenomenon had a name. And I have to say, that's one of the least helpful names for things like that.
INeedMana@piefed.zip · 4 pts · 188d
Unfortunately not every company has a reasonable Head of IT and/or policies
db2@lemmy.world · 8 pts · 189d
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 · 8 pts · 189d
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 pts · 189d
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 pts · 189d
Great point.
StrawberryPigtails@lemmy.sdf.org · 7 pts · 189d
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.
MagnificentSteiner@lemmy.zip · 6 pts · 188d
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.
smeg@feddit.uk · 2 pts · 187d
dr_jekell@lemmy.world · 5 pts · 188d
Rather than trying to get your idea to work you would be better off getting a cheep WiFi access point as they often allow you to connect it to a wifi network and pass it through to wired devices via ethernet (bridging).
Some Wifi routers have a setting to allow it to be used in bridge mode as well.
elmicha@feddit.org · 3 pts · 189d
https://askubuntu.com/a/1547100/16134 should work.
sorrybookbroke@sh.itjust.works · 3 pts · 189d
Wow that looks promising thank you for that