Setting up on new network

Hi,

I recently got a new internet plan and along with it a new modem! However, this new modem using the same default ip address as the default lan address for OpenWrt. I have tried setting up the wireless connection in OpenWrt and then diagnosing the connection but I receive 'Bad ping address: openwrt.org' but the Protocol is set to DHCP and even when I set it to static I double check the custom DNS setting to make sure they are those of the gateway router address. One thing I noticed when do an ifconfig:

wlan0     Link encap:Ethernet  HWaddr 4A:A7:7F:0D:BA:DB  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1356 (1.3 KiB)  TX bytes:1860 (1.8 KiB)

Both the ipv4 and ipv6 addresses are missing, I can not remember encountering this problem before. What should I check for?

Thanks,

Aaron

you you want the openwrt device to act as a router, or just an AP ?

1 Like

I am doing to same as I did here except that time the main router ip address was 10.1.1.1 and the wlan0 didn't have any problems assigning ipv4 or ipv6.

wlan0 does not have an IP address because it is in a bridge. Functionally it "inherits" the IP address held by br-lan.

For routing to the Internet to work, the LAN IP must be changed so that it doesn't overlap the WAN. Using the CLI you can edit /etc/config/network and change the lan IP to 192.168.2.1 then restart the network. You will have to disconnect and reconnect your PC to acquire the new DHCP address.

1 Like

So I need to set the LAN to 192.168.2.1 even though I am not using ip address forwarding?

I keep receiving "ssh: Could not resolve hostname openwrt: Name or service not known" when trying to connect to the access point.

Edit:

Disregard the above comment I was on my desktop trying to access the access point although from my lap I am receiving a different error:

`ssh: connect to host openwrt port 22: Connection refused

Edit 2:

Think this was because I was trying to connect when the wifi on my pi was turned off.

I have managed to get the network set up but without internet had to change the main router ip address then login to the pi, set up the wifi, ssh in the wifi of the pi, change the lan ip address of the pi then change the main router back to original ip address. However, while I can access the pi over the network OpenWrt is still not accessing the internet such as opkg update, browsing, etc.

Edit:

This some ping test I preform while logged in the pi via ssh.

root@OpenWrt:~# echo "nameserver 192.168.1.1" > /etc/resolv.conf
root@OpenWrt:~# cat /etc/resolv.conf
nameserver 192.168.1.1
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz, wget returned 5.
root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=54 time=174.441 ms
64 bytes from 8.8.8.8: seq=1 ttl=54 time=39.183 ms
64 bytes from 8.8.8.8: seq=2 ttl=54 time=54.436 ms
64 bytes from 8.8.8.8: seq=3 ttl=54 time=48.876 ms
64 bytes from 8.8.8.8: seq=4 ttl=54 time=48.590 ms
64 bytes from 8.8.8.8: seq=5 ttl=54 time=46.880 ms
64 bytes from 8.8.8.8: seq=6 ttl=54 time=38.670 ms
64 bytes from 8.8.8.8: seq=7 ttl=54 time=53.955 ms
^X^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 38.670/63.128/174.441 ms
root@OpenWrt:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=2.267 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=3.651 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=1.979 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=2.009 ms
64 bytes from 192.168.1.1: seq=4 ttl=64 time=2.055 ms
64 bytes from 192.168.1.1: seq=5 ttl=64 time=2.089 ms
64 bytes from 192.168.1.1: seq=6 ttl=64 time=1.987 ms
^C
--- 192.168.1.1 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 1.979/2.291/3.651 msroot@OpenWrt:~# echo "nameserver 192.168.1.1" > /etc/resolv.conf
root@OpenWrt:~# cat /etc/resolv.conf
nameserver 192.168.1.1
root@OpenWrt:~# opkg update
Downloading https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz

Downloading https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz
*** Failed to download the package list from https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/targets/mediatek/mt7622/packages/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/base/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/luci/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/packages/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/routing/Packages.gz, wget returned 5.
 * opkg_download: Failed to download https://downloads.openwrt.org/releases/22.03.3/packages/aarch64_cortex-a53/telephony/Packages.gz, wget returned 5.
root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=54 time=174.441 ms
64 bytes from 8.8.8.8: seq=1 ttl=54 time=39.183 ms
64 bytes from 8.8.8.8: seq=2 ttl=54 time=54.436 ms
64 bytes from 8.8.8.8: seq=3 ttl=54 time=48.876 ms
64 bytes from 8.8.8.8: seq=4 ttl=54 time=48.590 ms
64 bytes from 8.8.8.8: seq=5 ttl=54 time=46.880 ms
64 bytes from 8.8.8.8: seq=6 ttl=54 time=38.670 ms
64 bytes from 8.8.8.8: seq=7 ttl=54 time=53.955 ms
^X^C
--- 8.8.8.8 ping statistics ---
8 packets transmitted, 8 packets received, 0% packet loss
round-trip min/avg/max = 38.670/63.128/174.441 ms
root@OpenWrt:~# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=2.267 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=3.651 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=1.979 ms
64 bytes from 192.168.1.1: seq=3 ttl=64 time=2.009 ms
64 bytes from 192.168.1.1: seq=4 ttl=64 time=2.055 ms
64 bytes from 192.168.1.1: seq=5 ttl=64 time=2.089 ms
64 bytes from 192.168.1.1: seq=6 ttl=64 time=1.987 ms
^C
--- 192.168.1.1 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 1.979/2.291/3.651 ms

You can see both ping the Google server and my main router work successfully but downloading of updates fails.

ping != dns resolution

your isp modem? router? client facing address is 192.168.1.1? do you have a DNS server running on isp device? if not you should rather pick a public DNS server (1.1.1.1 , 8.8.8.8 or whatever you like) and add to /etc/resolv.conf instead of 192.168.1.1.

if i understand correctly you already changed your owrt lan network to 192.168.2.0/24, right? thus 192.168.1.1 is not your br-lan interface's address?

Well, I checked the custom dns and had accidentally put the ip address of the wwan interface itself. Although, after changing it still did not work and reported ip/32 while the Lan, was /48. I deleted the interface and repeated it and updating, and accessing the internet from my pc and well as accessing the pi from my phone and laptop also worked.

so you are ok? then please mark this topic as solved.

1 Like

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