Wan is not working with direct connection to modem

I have a wierd problem. recently I bought a Linksys WRT3200. here is the issue with it:
with original factory firmware I can connect my modem to wan port and access the internet but with OpenWRT firmware my router cannot access the internet nor see my modem.
the wired part is that when I connect my modem to another openwrt router and connect that router lan port to wan port of this WRT3200 everything works fine (I can acces the internet)

I have updated all of my installed packages but it didn't helped with fixing the issue.

I don't think my modem have any issues because I can connect it directly to my motherbaord and my other openWRT router. can you please guide me how can I fix this issue?

Maybe both routers have the same IP address (192.168.1.1)?

So as a quick fix set the linksys address to something else e.g. 192.168.2.1

Note change the cipher between the second and third dots

modem IP address is 192.168.1.1 and I can't change it. and I have already changed my linksys router IP to 192.168.20.1 and it still not working

/etc/config/network

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

config globals 'globals'
        option ula_prefix 'fd04:b301:91aa::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '192.168.1.1'
        option ipaddr '192.168.20.1'

config device
        option name 'wan'
        option macaddr '62:38:e0:bf:6a:28'

config interface 'wan'
        option proto 'dhcp'
        option device 'wan'
        option peerdns '0'
        list dns '1.1.1.1'
        list dns '1.0.0.1'
        option hostname 'Noury-PC'

config interface 'OpenVPN'
        option proto 'none'
        option device 'tun0'

Do you have any VPN active?

1 Like

Remove this from lan interface.

2 Likes

I just removed that but I still have the issue. and I don't think It does have anything with the OpenVPN becuase I tested with both on of off vpn state.

you know I think the wan interface cannot start because when the router is connected to my modem directly the "Stop" button next to wan interface in luci is grayed out and when I click "Restart" the "Stop" button is not coming out of grey state. but when I connect wan port to a different openwrt router the "Stop" button comes out of grey state and I can stop the interface. I have tested with different cables and it didn't helped.

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; \
uci export dhcp; uci export firewall; \
ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
1 Like

I have built firmware from latest version but it behave the same as openwrt original firmware (same issue exist) so I reinstalled the original OpenWRT firmware back (the one provided in the device page).
after that I run the commands and here is output:

{
        "kernel": "5.10.146",
        "hostname": "OpenWrt",
        "system": "ARMv7 Processor rev 1 (v7l)",
        "model": "Linksys WRT3200ACM",
        "board_name": "linksys,wrt3200acm",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.2",
                "revision": "r19803-9a599fee93",
                "target": "mvebu/cortexa9",
                "description": "OpenWrt 22.03.2 r19803-9a599fee93"
        }
}
package network

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

config globals 'globals'
        option ula_prefix 'fde7:e5b0:558b::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.20.1'

config device
        option name 'wan'
        option macaddr '****'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

package dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

package firewall

config defaults
        option syn_flood '1'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
12: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.20.1/24 brd 192.168.20.255 scope global br-lan
       valid_lft forever preferred_lft forever
192.168.20.0/24 dev br-lan scope link  src 192.168.20.1
broadcast 127.0.0.0 dev lo table local scope link  src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1
broadcast 192.168.20.0 dev br-lan table local scope link  src 192.168.20.1
local 192.168.20.1 dev br-lan table local scope host  src 192.168.20.1
broadcast 192.168.20.255 dev br-lan table local scope link  src 192.168.20.1
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
lrwxrwxrwx    1 root     root            16 Oct 14 22:44 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            47 Oct 14 22:46 /tmp/resolv.conf
-rw-r--r--    1 root     root             0 Oct 14 22:44 /tmp/resolv.conf.d/resolv.conf.auto

/tmp/resolv.conf.d:
-rw-r--r--    1 root     root             0 Oct 14 22:44 resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1
nameserver ::1

==> /tmp/resolv.conf.d <==
head: /tmp/resolv.conf.d: I/O error

==> /tmp/resolv.conf.d/resolv.conf.auto <==

What does ip link report?

1 Like
root@OpenWrt:~# ip link
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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1508 qdisc mq state UP qlen 1024
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
3: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
4: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
5: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN qlen 1000
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
7: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN qlen 1000
    link/ether 62:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
10: mlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
    link/ether 60:38:e0:bf:6a:2b brd ff:ff:ff:ff:ff:ff
11: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 60:38:e0:bf:6a:28 brd ff:ff:ff:ff:ff:ff
12: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br-lan state UP qlen 1000
    link/ether 60:38:e0:bf:6a:29 brd ff:ff:ff:ff:ff:ff
13: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br-lan state DOWN qlen 1000
    link/ether 60:38:e0:bf:6a:2a brd ff:ff:ff:ff:ff:ff

Silly idea, in the past I had issues with energy efficient ethernet (EEE), in that two devices did not connect until I disabled EEE...

Was the WAN port connected to the modem when you ran that command?

Compare the contents of /etc/config/network on both devices. That may shed some light on why one configuration works but the other does not.

Yes all of the posted outputs are printed when my router was connected to modem directly

This might sound silly, but are you sure that the cable you use to connect roter and modem is working and that the RJ45 "plugs" are looking okay and "snap-in" when you insert them (so you need to press down the plastic "tongue" to remove the plug from the socket?

NO-CARRIER and LOWERLAYERDOWN might denote that something is not connected well (or that some incompatibility makes the router's ethernet NIC fail to establish a link).

I have tested it with different cables but I know the issue does not have anything with the cables because with linksys factory firmware I can connect to my modem and everything works fine. It's really confusing

Have you tried with the complete default configuration of OpenWrt (as compared to your fully configured state)?

2 Likes

Power cycle the modem?

If that doesn't work then maybe the modem has black listed the wrt3200's MAC address.

Try changing the wrt3200's wan MAC.

Or....

Call your ISP and confirm you can hit the reset button on the modem without having to re-enter credentials. (Most cable modems work like that).

Reassign one of the lan ports to be the wan.

If your modem has a gigabit port, make sure you're using full 8-wire cable. Old DSL modems were supplied with 4 wire cable which is only good for 100 Mb. It may or may not link at all between two gigabit ports.

I have tried with default configuration and changed my wan mac address but none of them helped.
I wanted to change a lan port to wan port but I don't have "Switch" option in "Network" menu

I dont know maybe these two devices are not compatible with each other

That is not needed to have it to convert a port.

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'

config device
        option name 'br-lan4'
        option type 'bridge'
        list ports 'lan4'

config interface 'wanb'
        option device 'br-lan4'
        option proto 'dhcp'

config interface 'wanb6'
        option device 'br-lan4'
        option proto 'dhcpv6'