Unable to setup switch WAN port on TP-LINK TD-W8970 v1

I have TD-W8970. It is DSL modem so don't have separate WAN interface. So I trying to create virtual. I have a problem to get DHCP client working on the WAN port on the switch. My wan never set IP address for wan port so I can't access the internet. I checked the second router and it's working correctly and I also try to connect another (third) router without success.
My switch configuration is
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'

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

config switch_vlan
option device 'switch0'
option vlan '4'
option vid '4'
option ports '4 6t
'
config interface 'wifi'
option proto 'static'
option delegate '0'
option ipaddr '192.168.77.1'
option netmask '255.255.255.0'
option type 'bridge'
option ifname 'eth0.1'

config interface 'WLAN4'
option ifname 'eth0.4'
option proto 'dhcp'
option clientid 'root'

When I try to reach DHCP with udhcpc
root@OpenWrt:~# udhcpc
udhcpc: started, v1.28.3
udhcpc: sending discover
udhcpc: sending select for 192.168.111.88
udhcpc: lease of 192.168.111.88 obtained, lease time 43200
udhcpc: ifconfig eth0 192.168.111.88 netmask 255.255.255.0 broadcast 192.168.111.255
udhcpc: setting default routers: 192.168.111.1

When I replace WLAN4 DHCP client with a static address like this everything starts working fine. But I want to use DHCP client, not static address.
config interface 'WLAN4'
option ifname 'eth0.4'
option proto 'static'
option ipaddr '192.168.111.88'
option netmask '255.255.255.0'
option gateway '192.168.111.1'
option dns '8.8.8.8'

More config files Firewall etc.
Any suggestions?

When you're not using the integral DSL modem, remove anything DSL related from the configs.

Don't use this 'WLAN4'. Use lowercase for network names. The wan should be called 'wan' since that matches what is in the default firewall config.

option clientid is wrong. To pass a hostname to the DHCP server, use option hostname. A few ISPs do not like you to send a hostname, which is why OpenWrt defaults to not send one. In most cases the wan network can simply be:

config interface 'wan'
    option proto 'dhcp'
    option ifname 'eth0.4'
1 Like

Thank you! You saved my day :slight_smile:

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