Modify

Opened 3 years ago

Last modified 18 months ago

#18680 new defect

Unable to get WAN address

Reported by: clauded1 Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: Cc:

Description

I'm running OpenWrt Chaos Calmer r43814 (compiled from source) on a TP-Link Archer C7 v2 with the default configuration. When booting the router, it doesn't get it's ip address from the cable modem.

If I physically unplug and plug back the ethernet cable of the wan port then the router gets it's IPv4 address.

I tried different things but I always have the problem:

-shutting down the cable modem for several hours
-masquarading the MAC address using my old router MAC
-enabling DOCSIS 3 (broadcast)

Running manually 'udhcpc -p /var/run/udhcpc-eth0.pid -s /lib/netifd/dhcp.script -f -t 0 -i eth0 -C' returns 'Sending discover...' but never obtain an ip address.

Attachments (0)

Change History (15)

comment:1 Changed 3 years ago by sergiosat

I built r43862 for Archer C7 and DHCP for WAN is working for me as well as static address.
I had same problem in the past, but it was solved. I did not build r43814.

comment:2 Changed 3 years ago by clauded1

I've just tested r43954 and still have the problem. Here's my network config:

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

config globals 'globals'
	option ula_prefix 'fd0c:00ab:2cae::/48'

config interface 'lan'
	option ifname 'eth1'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.0.1'

config interface 'wan'
	option proto 'dhcp'
	option ifname 'eth0'

config interface 'wan6'
	option ifname 'eth0'
	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 2 3 4 5'

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

And the logs:

Mon Jan 12 22:18:59 2015 daemon.notice netifd: Network device 'eth0' link is up
Mon Jan 12 22:18:59 2015 daemon.notice netifd: Interface 'wan' has link connectivity 
Mon Jan 12 22:18:59 2015 daemon.notice netifd: Interface 'wan' is setting up now
Mon Jan 12 22:18:59 2015 daemon.notice netifd: Interface 'wan6' has link connectivity 
Mon Jan 12 22:18:59 2015 daemon.notice netifd: Interface 'wan6' is setting up now
Mon Jan 12 22:18:59 2015 kern.info kernel: [   22.990000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Mon Jan 12 22:18:59 2015 daemon.notice netifd: wan (1160): udhcpc (v1.22.1) started
Mon Jan 12 22:19:00 2015 daemon.notice netifd: wan (1160): Sending discover...

From there I never receive and IPv4 address until a physical disconnect/reconnect is done.

comment:3 follow-up: Changed 3 years ago by stupidicus

BB 14.07 and CC r44258 get no DHCP lease if the WAN cable is plugged in on boot.

Boot the router and cable modem with the wan cable unplugged, and when you plug it in you'll get a DHCP lease.

comment:4 in reply to: ↑ 3 Changed 3 years ago by anonymous

Replying to stupidicus:

Boot the router and cable modem with the wan cable unplugged, and when you plug it in you'll get a DHCP lease.

That was mentioned in my original post : it's just a workaround, not an acceptable long term solution.

CC r44439 still has the problem...

comment:5 Changed 3 years ago by derheld42

I can confirm that this version also has the issue.
OpenWrt Chaos Calmer r43124 / LuCI Trunk (git-14.303.42039-1b6e4e4)

comment:6 Changed 3 years ago by anonymous

Version r44873 also has the problem. I just wonder if devs even care at taking a look to bug reports...

comment:7 Changed 3 years ago by anonymous

Version r45514 still have this bug.

comment:8 Changed 3 years ago by shonjir

I had this problem with stock OpenWrt Chaos Calmer r45686 on an Archer C7 v2, which continued after switching to my own custom build on r45711. On a reboot, the WAN port would not acquire an address. Unplugging the cablemodem immediately fixes the issue, but as @stupidicus notes, it's not an acceptable solution.

On the default Archer C7 build, eth0 (port 6) is mapped to WAN (port 1) and eth1 (port 0) is mapped to LAN (ports 2-5). On a hunch, I decided to change them to a more conventional mapping (eth1 mapped to WAN) with the port changes shown below. The vlan mappings remain the same - only ports 0 and 6 are swapped.

Upon making this change, my router now reboots normally, and acquires a WAN address on its own on reboot. This behavior has been consistent following multiple reboots. It continued to work following upgrade to r45741.

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

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

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0 1'

config interface 'wan'
	option ifname 'eth1'
	option proto 'dhcp'
	option ipv6 '1'

config interface 'lan'
	option ifname 'eth0'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6hint '0'
	option ip6assign '64'
Last edited 3 years ago by shonjir (previous) (diff)

comment:9 follow-up: Changed 3 years ago by clauded1

That's brilliant! Thanks shonjir.

This has been tested succesfully on r45743.

comment:10 in reply to: ↑ 9 Changed 3 years ago by shonjir

Replying to clauded1:

That's brilliant! Thanks shonjir.

This has been tested succesfully on r45743.

Thanks. I wish I knew why it works, though. Maybe someone with more knowledge of the boot timing can explain it.

comment:11 Changed 2 years ago by anonymous

I can confirm that flipping Port 0 and Port 6 on the switch works.

This was the only way I could get an additional VLAN working for a MWAN3 setup on Archer C7 v2.

VLAN1: option ports '3 4 5 6' => eth0 (bridged lan)
VLAN2: option ports '0 1' => eth1 (wan1)
VLAN3: option ports '2 6t' => eth0.3 (wan2)

comment:12 Changed 2 years ago by anonymous

I just tried making these changes (via LUCI) on my Archer C7 v2, Chaos Calmer 15.05 (the problem remains on that version). Does not appear to have fixed the problem, as the restart after applying the changes still did not pull an IP from the modem. The usual routine of pulling the WAN cable, restarting the router and reinserting the cable fixed the problem, as before ...

comment:13 Changed 23 months ago by anonymous

I have the same issue, also an Archer C7 v2. Found it running Gargoyle v1.8.1 which I believe is based on Barrier Breaker.

Based on this thread and that Gargoyle v1.9 would include the fix above (r45743) I upgraded. Unfortunately as reported in 'comment 12' the issue is still there.

comment:14 Changed 23 months ago by anonymous

An update to the previous post (comment 13)...

I'd misinterpreted the trail and assumed this fix HAD been included in Chaos Calmer. Am advised this wasn't the case. Working with Lantis, moderator on the Gargoyle site we edited the etc/config/network file to line up with the changes proposed earlier in the thread- reference: https://www.gargoyle-router.com/phpbb/viewtopic.php?f=11&t=8356

Unfortunately my experience was the same as the last poster from 6 months ago- did not fix the behavior.

There are at least two other users on the Gargoyle thread with the same router and the same issue as described in this thread.

Is there anyone interested or able to look into this issue? I am not literate enough with routing protocal to diagnose; but am willing to help as needed...

comment:15 Changed 18 months ago by kdorman

I have this issue on an Ubiquity AirRouter on trunk (Need to boot with wan unplugged and plug when the boot is complete)

But I didn't encountered the error on my Archer C7 v2 on trunk

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.