DHCP WAN port does not work

I have a Comfast CF-WR650AC router, I installed the new version of OpenWRT 21.02, but the WAN port is not connecting properly, connections work normally in base/factory firmware.

I tried some settings from the documentation, from YouTube videos and here from the forum, but without success.

Here is the current configuration of the router, I have not changed anything:

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 'fd91:a6bc:5966::/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 'eth1.2'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth1.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 '1 2 3 4 0t'

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

I just want it to take the internet from the operator's router and distribute the IPs through it, which is the DHCP distributor of IPs.

The default configuration of OpenWrt will work in your scenario. So if you didn't change anything in the configuration, I'd check:

  1. Cable: verify that it is working, replace it with another to verify just in case.
  2. Speed/duplex: verify that both OpenWrt and the ISP router are negotiating at a mutual speed and duplex, usually 1000M/Full.
  3. Verify that the mac address of the wan interface is the same that stock firmware used and there is no white/blacklist on the ISP router.
  4. Having 0 packets received shows that for some reason there is no uplink, as there would be something sent from the ISP router.
  5. Power off the ISP router for 5 minutes and power it on again.
    Which ISP is this and which router?
1 Like

Thanks for helping!

  1. The cable works normally
  2. It is running at 1000M/Full
  3. With nothing on the black and white lists
  4. The ISP connection is ok, I tested it on my PC
  5. I hung up for more than 5 min but nothing changed

The ISP is TIM Brazil (TIM LIVE), the router is a Sagemcom F@st 5657

Maybe there is something wrong with the port mapping.
Run the command swconfig list; swconfig dev switch0 show and verify that link on port 5 is indeed up.

1 Like

Hi! I ran the commands and the log is this

root@OpenWrt:~# swconfig list; swconfig dev switch0 show
Found: switch0 - mdio.0:1f
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 2: MAC b0:25:aa:3c:0f:45
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:down
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

Edit:

My ISP is: 192.168.0.1
My router: 192.168.1.1

You have not connected the cable to the port 5 which corresponds to wan. Or the cable is faulty or there is some hardware issue with the port. Ports 0 and 6 are the CPU.

2 Likes

With the factory firmware from Comfast it works as normal, connected in the same way (in the photo). Only with OpenWRT is it causing this problem.

And the cable LAN1 that I see connected is showing in swconfig as Port 2?
link: port:2 link:up speed:1000baseT full-duplex txflow rxflow auto

1 Like

Not sure, I know the white cable (CAT6) comes from the ISP and the yellow cable (CAT5e) is connected to the PC.

We can try to reassign a lan port to act as wan. But you'll need to identify which LANX port corresponds to which switchport first.
Plug the yellow cable to all LAN ports and run the command

swconfig dev switch0 show

each time to see which port comes up

1 Like

I tested the swconfig dev switch0 show command on all ports, including the WAN, the only one that didn't return anything and left the terminal useless was LAN4.

The last result of the WAN I connected the yellow cable to the WAN and the white one to the LAN4. According to the tests, the result was this:

LAN1 is Port 2
LAN2 is Port 3
LAN3 is Port 4
LAN4 is Port 5
WAN is Port 6

I turned the ISP on port 4, which is currently the WAN port, and the PC on port 2 (LAN1). The image shows the WAN as red, is this normal?

LAN1

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 1: MAC 5c:cd:5b:bd:6c:df
Port 1: MAC 44:d4:53:fe:92:d7
Port 2: MAC b0:25:aa:3c:0f:45
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

LAN2

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 1: MAC 5c:cd:5b:bd:6c:df
Port 1: MAC 44:d4:53:fe:92:d7
Port 3: MAC b0:25:aa:3c:0f:45
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

LAN3

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 1: MAC 5c:cd:5b:bd:6c:df
Port 1: MAC 44:d4:53:fe:92:d7
Port 4: MAC b0:25:aa:3c:0f:45
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

LAN4

Don't work - No signal from terminal

WAN

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 1: MAC 5c:cd:5b:bd:6c:df
Port 1: MAC 44:d4:53:fe:92:d7
Port 1: MAC b0:25:aa:3c:0f:45
Port 1: MAC 08:f4:58:b2:16:9b
Port 5: MAC b0:25:aa:3c:0f:45
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

Yellow = WAN and White = LAN4

root@OpenWrt:~# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table
Port 0: MAC 40:a5:ef:52:5c:78
Port 1: MAC b0:25:aa:3c:0f:45
Port 5: MAC 08:f4:58:b2:16:9b
Port 5: MAC 44:d4:53:fe:92:d7
Port 5: MAC 5c:cd:5b:bd:6c:df
Port 6: MAC 40:a5:ef:52:5c:7a

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:1 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:2 link:down
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 1
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 2
        link: port:5 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:1000baseT full-duplex txflow rxflow
VLAN 1:
        vid: 1
        ports: 0t 1 2 3 4
VLAN 2:
        vid: 2
        ports: 5 6t

When configuring Ethernet it is useful to set up a wifi AP and log into the router by wifi, so you're not depending on Ethernet to monitor and control the router.

Which one of those MACs is from your DSL modem? Check the label on the modem.

It looks like as would be expected ports 0 and 6 are the two CPU ports that link the switch to the CPU. You need to be sure which one is eth0 and which one is eth1. Again compare the MACs in the switch versus the port MACs you can find with ip link show.

1 Like

Ports 0 and 6 are the CPU.
From the rest of the results I'd say that:

LAN1 is Port 2
LAN2 is Port 3
LAN3 is Port 4
LAN4 is Port 5
WAN is Port 1

However Port 5 is configured in vlan 2, which is the wan and wan6 interfaces.
So try to put the white cable from the ISP modem to LAN4 and use the other ports as lan.
Otherwise you can reassign the port assignments, so that port 5 is in vlan1 and port 1 is in vlan2.

1 Like

How do I do this port reassignment?

Did it work on LAN4?

yes, but I think it's weird to work like this

Sure is, but I wanted to make sure it works first.

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

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 6t'

Edit the network configuration file like this. Or you can change it in Luci under Network/Switch.

1 Like

It worked out! Thank you so much for your patience and help!

You're welcome! I'm glad it got fixed.

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