Temporarily connect to internet as regular client on OpenWrt installed on Raspberry Pi 4

TLDR

My OpenWrt Raspberry Pi 4 is not connected to the internet when connected as a regular client.

I am trying to use my Raspberry Pi 4 as a home router, and I am trying to temporarily connect the Pi to the internet as a regular client so we could install necessary packages.

After I flashed OpenWrt to the Pi, I powered and connected it to my Ethernet port on my PC, and I connected to it using SSH. I edited /boot/config.txt and added

dtparam=i2c1=on
dtparam=spi=on
dtparam=i2s=on

as per the OpenWrt documentation page. I then edited option ipaddr '192.168.1.1' under config interface 'lan' at /etc/config/network to option ipaddr 192.168.1.254 so DHCP and I will be able to find it when I connect it as a regular client.

But when I connected the Pi as a regular client through an Ethernet port, I was able to SSH into it on 192.168.1.254, but when I did opkg update or opkg install anything, it told me that it failed to download the package list, which obviously means that it couldn't connect to the internet.

How do I connect my Pi to the Internet? What did I do wrong?

the /etc/config/network file

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd01:117e:e158::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.254'
        option netmask '255.255.255.0'
        option ip6assign '60'

For reference, I am using this guide to try to use my Pi as a home router.

You need to add DNS servers and a gateway to your IP configuration.

What are the config directives for that?

Option gateway and option DNS

Thank you so much! The guide I referenced never mentioned that I have to do it. It just said that I have to change the IP.

I think it assumes you'll be using it as the main router rather than just connecting it to the LAN as a normal device. Or that you'd use DHCP if you did do that.

You also have to disable the internal DHCP server or it will disrupt your network.

Another approach is to enable the wifi as a client of your home wifi and attach it to the wan network. This lets the Pi download from the Internet as a user but doesn't fully merge it with your existing home network.

The guide assumes that I will connect the Pi between the ISP router and switch, since the ISP doesn't allow different routers. I enabled DMZ to my Pi and disabled Wi-Fi on the ISP router. Do I still disable the DHCP server on the ISP router?

The guide is actually really confusing. They seem to be mixing up between the modem and "ISP router." As far as I'm concerned, I disabled DHCP and Wi-Fi on my ISP router, set up the Pi according to the guide, and set up DMZ to the Pi's IP address. Am I supposed to connect the Pi's Ethernet port to my switch and connect the USB-Ethernet dongle to my ISP router's WAN port?

Does your ISP router have any options for a bridge or modem only mode?


This one?

Nope, not a wireless bridge. You ideally want a modem mode or wired bridge that means the ISP router connects to the internet but passes the public IP address onto your openwrt router.


How about this one?

It'll do at a push, but ideally you want a proper modem/bridge mode.

I looked for something like that, and DMZ seems to be the closest option available. I'm not sure if there's something on the GigaCenter 844E-2 manual, though.

Anyway, I did DMZ on the Pi and disabled DHCP and Wi-Fi on the ISP router, connected the Pi's Ethernet to my switch and connected the Pi to a LAN port on my ISP router using a USB-Ethernet dongle, and it's now finally working. The new DHCP has been updated and now I'm able to connect to LuCI.

However, just when I thought it was all finally good, whenever I try to connect to a website, it doesn't connect. It just stops respnding. How can I diagnose and fix this issue?

Also, do I flash the upgrade build on the UI? Any precautions?

Edit: Also, how can I access the ISP router gateway now?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.