Cant make my Asus RT-N53 work with OpenWrt

Hi,
I was trying to install openwrt and it works to some extent, but I cant connect to the ethernet ports so I can access the web GUI.

So I teared down the router, connected to the serial interface and I can interface with the router, but what should I check so I can make openwrt work on that router?

root@OpenWrt:/# cat /etc/config/network
config/firewall
ubus call system board
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 'fd38:8714:f019::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

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

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 1 2 3 5t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '4 5t'

root@OpenWrt:/# cat /etc/config/firewall
config defaults
        option syn_flood        1
        option input                    ACCEPT
        option output                   ACCEPT
        option forward                  REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

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

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name                     Allow-DHCP-Renew
        option src                      wan
        option proto                    udp
        option dest_port        68
        option target                   ACCEPT
        option family                   ipv4

# Allow IPv4 ping
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

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
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

# Allow essential incoming IPv6 ICMP traffic
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

# Allow essential forwarded IPv6 ICMP traffic
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


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src                      lan
#       option src_ip           192.168.45.2
#       option dest                     wan
#       option proto            tcp
#       option target           REJECT

# block a specific mac on wan
#config rule
#       option dest                     wan
#       option src_mac          00:11:22:33:44:66
#       option target           REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src                      lan
#       option proto            ICMP
#       option target           DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                              wan
#       option src_dport        80
#       option dest                             lan
#       option dest_ip                  192.168.16.235
#       option dest_port        80
#       option proto                    tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src                      wan
#       option src_dport        22001
#       option dest                     lan
#       option dest_port        22
#       option proto                    tcp

### FULL CONFIG SECTIONS
#config rule
#       option src                      lan
#       option src_ip           192.168.45.2
#       option src_mac          00:11:22:33:44:55
#       option src_port         80
#       option dest                     wan
#       option dest_ip          194.25.2.129
#       option dest_port        120
#       option proto            tcp
#       option target           REJECT

#config redirect
#       option src                      lan
#       option src_ip           192.168.45.2
#       option src_mac          00:11:22:33:44:55
#       option src_port                 1024
#       option src_dport        80
#       option dest_ip          194.25.2.129
#       option dest_port        120
#       option proto            tcp

What happens if you connect via the ports ?

Run logread -f on the console, while doing so.

What do you mean by this? Are you saying that the ethernet ports are not working, or that you cannot conenect because you don't have a device with an ethernet connection that can be phyiscally connected?

Everhything you showed in your config file looks fine. Perhaps more context is necessary... what is the specific problem you are having?

And what is the output of:

ubus call system board
ifconfig

Thanks for pointing my mistake.
What i wanted to say is that the ethernet ports doesn't work (wan , lan1 to lan4) if I connect them to my laptop.
WIth one cable I couldn't connect at all,I was just getting the ubuntu default cant connect error notification, and with the other cable it was detected as a 100mbps connection (weird) , but I wasn't assigned a ipv4 IP and also I couldn't connect to the web GUI
Ill come with the results of the commands in a few hours since ill have to redo the setup I had earlier

root@OpenWrt:/# ubus call system board
{
        "kernel": "5.10.161",
        "hostname": "OpenWrt",
        "system": "Broadcom BCM5357",
        "model": "Asus RT-N53",
        "board_name": "0x0550:45",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "22.03.3",
                "revision": "r20028-43d71ad93e",
                "target": "bcm47xx/mips74k",
                "description": "OpenWrt 22.03.3 r20028-43d71ad93e"
        }
}
root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 60:A4:4C:26:45:87  
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd38:8714:f019::1/60 Scope:Global
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10912 (10.6 KiB)  TX bytes:10912 (10.6 KiB)

Nothing appears when i connect the port , but I get this regulatley:

Tue Jan  3 00:27:49 2023 daemon.err odhcpd[1179]: Failed to send to ff02::1%lan@br-lan (Address not available)
Tue Jan  3 00:28:05 2023 daemon.err odhcpd[1179]: Failed to send to ff02::1%lan@br-lan (Address not available)
Tue Jan  3 00:28:21 2023 daemon.err odhcpd[1179]: Failed to send to ff02::1%lan@br-lan (Address not available)
Tue Jan  3 00:28:37 2023 daemon.err odhcpd[1179]: Failed to send to ff02::1%lan@br-lan (Address not available)
Tue Jan  3 00:28:53 2023 daemon.err odhcpd[1179]: Failed to send to ff02::1%lan@br-lan (Address not available)


Are you positive that the cable is good? If you use that same cable to connect to another router, does the Ubuntu box get an IP as expected?

Your config looks completely standard... did you make any changes to the default configuration after you installed OpenWrt?

Ill try again with another cable that i trust tomorrow.
Also after installing i didn't made any config changes. The only changes that i have now is that i removed the ipv6 and the ula_prefix ,as someone suggested, but i don't see any change.

The errors you are seeing are problably related to an incomplete disabling of the IPv6 functions... but those are not critical and should not impact IPv4 connectivity.

Nope ,i dont get an ipv4 ip adress on my ubuntu laptop:

enp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether c0:18:50:04:eb:f6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And i also tried with a good cable and the same result.

florin-baciu,

Did you try give your laptop a static ip 192.168.1.2 and try to ping the router from the laptop?
ping 192.168.1.1
I think dhcp is not working on the router (no idea why not).

DG.