[Solved] Snapshot + ssh + no internet

Classic problem: I flashed openwrt snapshot to my TP-LINK RE450 v2 (192.168.1.20). Worked great. ssh and ping lan machine works. But I have no internet connection. (needed because I love Luci).
My "mainrouter" 192.168.1.1 has on it's wan side a static route (192.168.8.100).
My usb-dongle (192.168.8.1) is connected to to my "mainrouter" via DMZ.
I tried to set a default route on my machine TP-LINK RE450 v2 (192.168.1.20), but that does not help.
Please help, thx.

So that it is clearer, would you post the output of ip route from your main router?

It is probably the case that your RE450v2 needs a default route of 192.168.1.1

Here we go:

default via 192.168.8.1 dev eth2 proto static 
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.1 
192.168.3.0/24 dev wlan1-1 proto kernel scope link src 192.168.3.1 
192.168.8.0/24 dev eth2 proto kernel scope link src 192.168.8.100 

Your "main router" knows how to reach "TP-LINK RE450 v2 (192.168.1.20)" as well as having a route to your other segments and a default route.

A default route on your RE450v2 of 192.168.1.1 (and confirming that it is connected to your "LAN" ports) should resolve the issue.

Question remains: How do I set a default route on my RE 450v2.
I tried:

ip route add default via 192.168.8.1 dev br-lan

results in ip: RTNETLINK answers: Network unreachable

Rather than using ip commands that will be lost after an interface flap, better use uci or edit the /etc/config/network directly.
option gateway '192.168.X.Y'
or
uci set network.LOGICAL_INTERFACE_NAME.gateway='your-gateway-address'
uci commit && service network restart

1 Like

I add option gateway '192.168.8.1 to my config interface 'lan'?
like this?

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

Update: ping: sendto: Network unreachable

Not 192.168.8.1

1 Like

Thank you Jeff.
I changed it to 192.168.1.1. Now I can ping 8.8.8.8 (I had to fill in custom dns server as well).
Unfortunately opkg update is still not working.

option dns '192.168.1.1'
2 Likes

Okay thank you guys, now I am online.
I am trying to describe what's necessary to gain internet connectivity with a freshly installed Snapshot-image.

  1. I am assuming we need to flash a factory image. Log-in to the web-interface. In my case it is a TP-link device. Usually it is 192.168.0.239. Default user/PW is admin/admin.
  2. Flash from openWRT webpage downloaded image file.
  3. After successful flash we are done with the browser because snap-images come without Luci-interface. (and that is needed to use a web-interface).
  4. Log-in to your TP-link device via ssh. (now your device has a new IP, so ssh root@192.168.1.1 does the trick.
  5. Now check-out your /etc/config/network file.
config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option ipaddr '192.168.1.20' ##IP from my IP-Link Device, I changed it from 192.168.1.1
	option netmask '255.255.255.0'
	option ip6assign '60'
	option gateway '192.168.1.1'##IP from my "main-router"
	option dns '192.168.1.1'
  1. The last 2 entries from my config interface 'lan' are necessary to establish internet connectivity. You have to add them manually with a text editor. I used vim.
  2. Now type reboot in your console window and after rebooting your device you will be able to use opkg update and install luci consequently (opkg install luci).

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