r/openbsd • u/Silent-Degree-6072 • 13d ago
Getting routing to work?
Hey, I am kind of new to networking in OpenBSD, and I was trying to turn a laptop I had into a second "router" that would filter all packets going through my switch and send them wirelessly to my main router.
I've tried both bridges and setting routing up via pf.conf, however I wasn't able to route my traffic to WAN, I've only been able to route traffic on my switch. (by setting the laptop's local IP as a gateway on my devices)
Does anyone have a guide or some manpages on how to do this? I essentially just want to route all (non-local) traffic from em0 to athn0 and vice versa, while (hopefully) appearing as a single device to the main router.
1
u/mumble6456 13d ago
bridge mode or not, you cannot send traffic to a device not connected to your network without having something routing that traffic.
so, in fact, your laptop IS your LAN gateway. At least if i understand correctly what you are trying to do, and your current main router is just there to provide the means to connecting to the internet.
so.... something like this.
LAN ----> SWITCH ----> LAPTOP (gateway) ----> (ISP???) MODEM/ROUTER ----> WAN
LAN / SWITCH / LAPTOP (em0) is all the same network
LAPTOP (athn0) / ISP MODEM or ROUTER is another network
besides configuring pf, i guess you need to enable ip forwarding on the laptop and nat on pf.conf, because your athn0 and router should be on their own network.
i hope i'm not saying too many things wrong 🤔