Jump to content

Use a rpi as a wireless router?

Helpful Tech Witch

I have a raspberry pi as a wireless router but I can t figure out how. Itll be plugged into my pc when needed and then only one thing will be connected to the network it provides

 My rpi is a pi4 8gb with arch
Ive seen a couple things in the arch documentation for how to do it, but it doesnt make sense to me tbh. 
It seems simple but idk how to do it...

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's not particularly hard to do, but I wouldn't recommend it, the wireless is pretty meh.

You'll need:

  • hostapd provides "Wireless access point" functionality (easy to set up)
  • dhcpd will hand out IP addresses on the wireless lan (or dnsmasq if you like)
  • iptables will do the firewalling and NAT* (probably the most reading to understand and get it right)
  • some general networking stuff (nothing out of the ordinary, turn on packet forwarding, make sure the routes are right etc)

*There is a way to do it with bonding, but it's not something that works properly with systemd-networkd without post boot fondling (plus the documentation is both wrong and shitty).

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, Ralphred said:
  • iptables will do the firewalling and NAT* (probably the most reading to understand and get it right)
  •  

without outside network access, i shouldn't need either of these right?

I could use some help with this!

please, pm me if you would like to contribute to my gpu bios database (includes overclocking bios, stock bios, and upgrades to gpus via modding)

Bios database

My beautiful, but not that powerful, main PC:

prior build:

Spoiler

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

You'll need NAT (without bonding) but it's one line to make it work.

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

assuming your PI's NIC is called eth0. The rest of the default policies are ACCEPT anyway, so there is nothing to do unless you want to.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×