How to setup a remote connection to OpenWrt and how to access it?

According to feedback here I cant install packages because it would be wiped on update and if this happens I will lose remote access, so I cant install ddns package or any other.

So I agree that remote updates are tricky, unless performed over an independent control channel (say a mobile data connection to a host internal to your network from which you can SSH into the router. which still is not fool proof).
That said, you can always build your own firmware images containing all the packages you need already built in. That way you might be able to log in after an update (but that still is risky, at least you should get a second router like the remote one so you can test uploading each new firmware before deploying it remotely).

2 Likes
  • Well you could do some cool trick to ensure that on update this wouldn't occur...
    • cron job a ping to your current location, so you can SSH the IP after :wink:
  • You could run a cron script to opkg update and opkg upgrade foo - please note you have to also use touch on a file in /etc - or you will cause a soft-brick :warning:

:warning: Please note remotely upgrading a router has [obvious] risks.

1 Like

You can use the image builder to add any packages you might need, and their configuration.

2 Likes

Is there a list of default packages on factory image?

That would make it easier to add to.

And does "save settings" in luci preserve configs for all installed packages or just default ones?

I would then need a server on the other side which I dont have yet.

Is there a way I could setup something online from which I can read pings?

Is it the same command for using sysupdate image?
Can you also explain further what exactly to do with touch? I didnt exactly get what you are saying, are you suggesting changing timestamps of any file in \etc?

If I remember correctly, there is a "manifest" file alongside every download, that contains the list of packages.

The files kept by the "preserve config" option are those included in the "/etc/sysupgrade.conf".

Yes there is a manifest, but it looks like its the one for snapshot because it doesn't show any luci packages.

I just need the full list of what default factory openwrt usually has.

Are configs for user installed packages added there or do I need to include them manually?

I really need the proto tcp option, and I dont think this works with wireguard.

depends on who wrote the package... some are...

they are added under /ib/upgrade/keep.d/

1 Like

I'm talking about configs of added vpn packages installed from openwrt official repo to make a custom image.

Now if I do an update remotely and the configs get wiped then I am back to square one.

and which packages would those be?

make a backup from luci an check they are inside the tar.gz ... openvpn should be covered by default...

1 Like

Then I would rely on openvpn.