Issue with Internet connectivity

Hello all

I have just installed the newest openwrt firmware version 19.07.1 on my router TP-link TL-WR841n.

The router is configured with a static ipv4 address 192.168.15.2 on the WAN port.
The gateway address for the WAN port is set to 192.168.15.1, as this port is connected to another gateway router with Internet connectivity (192.168.15.1).

The problem is, when I try to ping for example openwrt.org, using either the diagnostic tool in Luci or from command line, it fails with the message: "ping: bad address 'openwrt.org'".

Even pinging 192.168.15.1, the message is "Network unreachable". I have tested that the gateway router has internet connectivity.

Additionally, on the LAN side, I have a network with ip address 192.168.1.1/24

The output below shows the ip address configuration. As I am new to openwrt I humbly ask for advice and help to solve this. In case you need any more information please let me know.

Regards

Vinh

root@OpenWrt:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether c4:71:54:48:b9:ea brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c671:54ff:fe48:b9ea/64 scope link
       valid_lft forever preferred_lft forever
6: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-wan state UP qlen 1000
    link/ether c4:71:54:48:b9:eb brd ff:ff:ff:ff:ff:ff
    inet6 fde0:890:9b80:0:c671:54ff:fe48:b9eb/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fde0:890:9b80::12a/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::c671:54ff:fe48:b9eb/64 scope link
       valid_lft forever preferred_lft forever
9: br-wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c4:71:54:48:b9:eb brd ff:ff:ff:ff:ff:ff
    inet 192.168.15.2/32 brd 255.255.255.255 scope global br-wan
       valid_lft forever preferred_lft forever
    inet6 fe80::c671:54ff:fe48:b9eb/64 scope link
       valid_lft forever preferred_lft forever
10: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether c4:71:54:48:b9:ea brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd5c:24a2:e0a::1/60 scope global
       valid_lft forever preferred_lft forever
    inet6 fde0:890:9b80:4::1/62 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::c671:54ff:fe48:b9ea/64 scope link
       valid_lft forever preferred_lft forever
11: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether c4:71:54:48:b9:ea brd ff:ff:ff:ff:ff:ff
14: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether c4:71:54:48:b9:ea brd ff:ff:ff:ff:ff:ff
    inet6 fe80::c671:54ff:fe48:b9ea/64 scope link
       valid_lft forever preferred_lft forever

set your dns to 192.168.15.1 or 8.8.8.8 ... etc... no valid nameserver... no resolution.

Thanks for your fast response. I have also tried as you suggested but unfortunately it did not work. My config for the wan interface is shown in the attached picture.

The default router configuration should work out of the box.
If you cannot ping the gateway, the DNS is the least of your problems.
The /32 mask won't get you anywhere, so fix that first.
Second I am not sure what have you bridged and you got a br-wan interface, but it should not be like that.

4 Likes

I second second. My best guess is that you bridged your WAN with the LAN and that messed things up.

I am quite new to this, but what I found out is that the netmask
of the static interface WAN was wrong, i.e. 192.168.15.2/32, like Trendy pointed out.

Somehow, when you configure static IP address in Luci, you cannot set the netmask yourself. It is done behind the scene, to the value 32.

Even though you manually change the netmask to 24 or 255.255.255.0, the netmask is changed back to 32, if you happen to have made any changes and saved in Luci afterwards.

About bridging, are you not supposed to bridge WAN and LAN together?
What is the correct way to do it?
How is traffic between LAN and WAN (internet side) forwarded behind the scene? Is that through routing table?

I hope you can help me clarify these questions.

Regards

Pham

What have you done with wan interface, why is it of type bridge?

I very much doubt this is the case, or otherwise it would have been reported many times. My guess is that you didn't apply the settings. It could also happen if you, for example do some changes in LuCI and concurrently do some other changes to the config files or through UCI commands so one version overwrites the other.

Of course not, unless you are a router yourself! It's the main job of the router to do the routing between WAN and LAN using the firewall rules, doing NAT where applicable etc.

The default configuration of OpenWrt should work out of the box for mouse use cases; all you need to do after fresh installation is

  • enable WiFi and set password (etc),
  • configure WAN if you want to use a static IP or setup PPPoE etc (or otherwise you can just leave it as DHCP client).
  • change LAN IP if you have to (e.g. if the upstream router is on 129.168.1.0 or if you want to use different IPs for any reason).

Initially, I did not bridge the WAN interface. But since things did not work out, I did various experimentations with the settings, such as bridging the WAN interface, to see if it made any difference.
Of course it did not resolve the issue.

Better reset the router to defaults.
If the gateway is giving settings with dhcp it will work immediately.
If not, then ask the adminstrator of the gateway for the proper settings. All you'll have to do is to change the protocol of the wan interface from dhcp client to static and add address (e.g 192.168.15.2/24) gateway (e.g 192.168.15.1) and DNS.

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