I'm pretty new to net stuff, and I'm very lost in the OpenWrt docs. It's kind of a nightmare trying to navigate them.
What I am trying to do is set up a Pi4 (2gb, 64bit) as a router with OpenWrt by bridging the router/modem Xfinity gives you, entirely cutting out Xfinity's routing. They lock down the DNS resolver to their own DNS server, which is insane to me that they're legally allowed to do so. Regardless, I want to be freed of that spying.
This is where I'm at:
I flashed OpenWrt onto the pi
I have it plugged into my computer's ethernet port via the gigabit eth port
I have logged in to 192.168.1.1 and changed pw
Enabled 'bind to interface' and chose lan interface, per docs
I'm not super sure how to proceed. The end goal is to bridge my "gateway" and have the pi exclusively as my router. WAN would be coming in from the modem thru the eth port on the pi, and LAN exiting via a USB 3.0 port using a WIFI antenna (Raspberry Pi Dual-Band 5GHz/2.4GHZ USB WiFi Adapter with Antenna).
Do I now just enable bridge mode on my router/modem, connect WAN from that router/modem to gigabit eth, connect the wifi antenna to one of the USB 3.0 ports, and tell my LAN to exit through that port?
If this has been done before, pls point me to whatever post is explaining how to do it. There are just literally a million ways to configure OpenWrt and it's making my brain hurt.
With other ISPs you need to switch their provided device into bridge mode as you stated. It's been years since I had to mess with this so I cannot help. My thought is that it will be more straightforward for you to just ditch their device all together and use your own modem. If xfinity is charging you "rent" for their device, the payback for a good modem is likely to be <1 year.
Thankfully, when I got this thing almost a year ago now, the whole subscription for everything craze wasn't quite here yet, so it was just a deposit that I'll be refunded once the gateway is returned.
I would highly recommend that you consider using purpose built APs instead of a USB connected wifi stick.
The Pi4 itself is a perfectly reasonable wired router, but the onboard wifi is so limited as to be useless. Further, USB wifi adapters most often don't provide particularly good performance (range, speed, number of clients supported, etc.), and not all dongles actually support AP mode.
With that said, the recommended path would be to use either a "plastic" all-in-one wifi router or to use dedicated APs connected via ethernet.
Now that I've stated all of the above for general/performance coniderations, if you still want to move foward with the pi as your router, the key thing to know is if your devices are wireless only or if you also need ethernet connectivity for your lan?
You also need to find out what chipset the USB wifi adapter uses in order to download the drivers for it -- your best bet is to pre-build them into your image.
I suggest getting your own modem since Xfinity gateways broadcast three to four hidden SSID networks at 40MHz wide at times even during bridge mode. Horrible company
I agree with getting your own modem -- I did, too, when I used Comcast. But the Pi as a router isn't always the best option... I asked a few questions above (which you might be answering as I write this)... let's use those questions to help form the best solution for your needs.
I think that can be turned off but not on the gateway's local configuration. You have to log into your Xfinity customer account and do it there then they will push it to your gateway.
Anyway returning to the original question, here is a summary of how to set up a Pi4 for basic routing. As noted this is not optimal since though the Pi has a lot of CPU, it is really constrained at networking. But it is a way to learn OpenWrt while you shop for more appropriate hardware.
Make sure to start from the default configuration. Connect your PC to the Ethernet port and log in to OpenWrt.
Enable a wifi AP on the built-in wifi radio, make sure it is attached to the existing network lan. Be sure to click the Advanced tab and set the radio Country to your actual country code.
Disconnect the Ethernet cable then connect your computer's wifi to the new AP and log into OpenWrt on wifi.
In OpenWrt, edit the network Device br-lan and remove eth0 (which is the built-in Ethernet port) from its list of ports.
Create a new Interface named exactly wan (in lower case, as this name is already set up in the default firewall). Cable Internet uses protocol DHCP Client. Set the Device to eth0.
Connect the Pi built-in Ethernet port to your cable modem or gateway.
The main status page should show an IPv4 Upstream address, and your Pi and PC should both be able to reach the Internet (v4).
Since Xfinity has some IPv6 support, create a wan6 Interface of proto DHCPv6 Client and Device @wan.
For your USB WiFi dongle, identify its chipset and install the appropriate kmod packages. Reboot the Pi with the dongle plugged in(*) and you should find it available as another WiFi Device. Set up an AP on this device then you can stop using the built-in wifi.
(WiFi dongles should always be plugged into the same physical USB port on the Pi, or they will be enumerated as a new radio.)
So I already have all the stuff for the dongle setup, so I may as well go ahead and do that temporarily. For one thing, my apartment is super super small, so I don't need much range at all, and usually 2, max 3 clients at any given time, plus load will usually be low unless streaming something. I also don't need (and won't get, I only have a low-ish speed plan w/ Xfinity) high speeds, so based on what I understand about the pi setup, it is well within its capabilities to do what I need it to.
If the dongle isn't working well, it'll be pretty easy to replace the dongle with an AP, correct? And for your wired/wireless question, every device in my apartment is currently wireless.
Thank you thank you! The biggest confusion I'd been having was how to delegate specific ports to specific functions. Still learning the UI but I will figure it out.
Well, yes and no. It's pretty easy, but it will require the purchase of a USB ethernet dongle or a managed ethernet switch (critically, avoid the entry level managed switches from TP-Link and Netgear as they are not suitable for this type of setup).
Ok... if there is any reasonable chance that you may add ethernet connected devices, you will want an ethernet switch (possibly along with an ethernet dongle).
For reference, most "plastic" all-in-one wifi routers include wifi (better than what you'll get with the USB adapter) as well as a built-in ethernet switch so you have additional ports for connecting any wired devices you may have. That's why these are often better options than the Pi + USB dongles, and this can be had for the same or less cost in most cases. This is often a consideration for many users, so consider this angle if the stuff you have now is still returnable and/or before you buy anything else for this setup.
Gotcha. I still want to avoid AIO because I really want to have control over the system, which is why I opted for openwrt over an AIO option in the first place. I don't see myself needing wired connections in the reasonably near future, so I'll dink around with this setup and see if it works for me.
Thank you so much for the advice! I know I'm definitely doing this in a really dumb and clunky way and that there are better implementations lol. I'll figure it out once I learn more.
Just to be completely clear, there are tons of AiO wifi routers that are supported by OpenWrt, spanning many brands, models, and price points. You just have to choose a model that is supported and you can flash OpenWrt for the same experience but with more suitable hardware.
Flint 2 can run openwrt. You have more ports, more "newbie" friendly, and OOTB works. Like I said before, sell what you have and buy something off the shelf that supports openwrt. Learn to swim before you jump into the deep end.
You will learn about DSA vlans and demand them in a few months. You can run your Pi4 as a Pi-hole, NAS, etc which works best with a wired connection.
Exactly. Just select one that has 16MB flash + 128MB RAM (or more) if you're buying something. You also don't need to buy something that is new... used market will probably have lots of options that are suitable for your needs, too -- you can probably get something in the range of $20 USD.
I will definitely look into those options! I'm having a lot of fun figuring this out, everything is up, I'm just trying to figure out the chipset drivers for the dongle right now.
Seems like I got a weird one that isn't recommended, but no surprises there.