Solving the network conflict of Google wifi and Fritz!Box
... or the network conflict if you use google wifi and an internet Router
2024-07-29 13:44 CESTIf you not have already bought Google Wifi STOP DON'T DO IT!. If you already have, welcome to this mess!
The problem: I have a Fritz!Box 7590 as router and modem, everything is and was fine for many years. My wife and I bought a house and the Fritz!Box couldn't provide a reliable WiFi-Connection in the complete house.
AVM provide a solution for that by offering a few AccessPoints, but every AP from AVM is a wallplug or a device which is not mountable on the wall. We have in the ground and upper floor a LAN cable coming out the wall which provides a connection to the Fritz!Box and gets power via POE. So therefore the AVM APs would look ugly. I bought Google WiFi because they had adapters for POE and would look good on the wall with a wall mount and some colleagues recommended me the APs.
Oh boy, I should had read more into it, because we now have a real mess.
I installed everything and everything was right for a few weeks, until I needed to print something. My epson app on my smartphone couldn't find the printer. It wasn't much of a problem. Simply typing in the IP address, click on connect and the printer was setup. No big deal.
The real problem comes, when I needed to access my phone from my computer... I could reach from my phone (via wifi 192.168.86.0/24) my pc (via ethernet 192.168.178.0/24) but not the other way around.
They are many threads on forums or posts on reddit and so on about this problem. But nearly all of them are suggesting to buy other APs. Which is... a valid point. But you can fix it easily, if you already have an raspberry pi or a device which is permanently running and can connect via ethernet AND WiFi.
Enough of the intro, as follows I explain how you setup your raspberry to forward traffic from the ethernet network to the wifi network, to solve the issue.
Log into to your raspberry pi via SSH, make sure, that you plugged in the lan cable and connect your raspberry pi to wifi. After it, you should have to network interfaces (probably more) eth0 for the ethernet and wlan0 for wifi. Execute the following commands on your raspberry pi:
sudo sysctl net.ipv4.ip_forward=1
sudo iptables -A FORWARD -i eth0 -o wlan0 -s 192.168.178.0/24 -d 192.168.86.0/24 -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -s 192.168.86.0/24 -d 192.168.178.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -s 192.168.178.0/24 -o wlan0 -j MASQUERADE
We need to add now a new route, so that every device in the fritzbox networks uses the raspberry pi as gateway to connect to the Google wifi network:
- Log in to the webinterface of the fritzbox http://192.168.178.1
- My interface is in german, but I try to translate it into english. Click in the sidebar on homenetwork, than network.
- Click on the tab network settings.
- Scroll down to the bottom of the page and click on IPV4-Routes.
- Click on new IPV4-Route.
- Create a new route with the following settings:
- IPV4-Network: 192.168.86.0
- Subnetmask: 255.255.255.0
- Gateway: 192.168.178.X Insert here the IP of the raspberry in your fritzbox network.
Now every thing is setup. You can now access every device in your google wifi network and fritzbox network from every device.