OpenWrt Forum Archive

Topic: Tp-Link td-w8970

The content of this topic has been archived between 26 Mar 2018 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Thanks all for the details.

In my howto I am writing, I just installed Openwrt and reboot. I'd guess at this point I can stop the process, shut down and carry on later. Right?

Then I'll install VDSL.
I downloaded from xdarklight.github.io (link in a previous post) the file
5.8.1.5.0.7-5.8.0.9.0.1     29de7210958de4ba57464685f680dd66e6fb5b36     898856     8.1.5    VDSL over ISDN incl. vectoring support.
I tried to sha1sum but it failed.
Other versions are not available any more.
Any help for that would be great as well.

z3non wrote:

Please note that there is no ATM-Bridge required in this setup. Be sure to have packages kmod-ltq-atm-vr9, ppp-mod-pppoa and kmod-pppoa installed. Also the kernel module ltq_ptm_vr9 must be unloaded for the DSL line to synchronize. If it remains loaded (lsmod) just uninstall the package kmod-ltq-ptm-vr9 and reboot.

Yes because you are using pppoa. If you are on pppoe you will have to use the atm bridge for ADSL.

Toutatis wrote:

Then I'll install VDSL.
I downloaded from xdarklight.github.io (link in a previous post) the file
5.8.1.5.0.7-5.8.0.9.0.1     29de7210958de4ba57464685f680dd66e6fb5b36     898856     8.1.5    VDSL over ISDN incl. vectoring support.
I tried to sha1sum but it failed.
Other versions are not available any more.
Any help for that would be great as well.

Follow the suggestion in the post above you. DD=Designated driver or LEDE comes with pre-installed VDSL firmware, no need to download it separately.

@Toutatis

xdsl firmware (vdsl.bin) can be downloaded also from here: https://github.com/ScApi/P2812HNUFx-Pre … 20firmware

P.S.
Both OpenWrt Designated Driver and LEDE are Trunk versions - they changing frequently and are without GUI (LUCi). 
Newest xdsl firmware will not work with CC

Thank you Scotch's, I'll follow your way.

Now I have the vdsl.bin file and need to install it.
I had a look on /sbin/vdsl_fw_install.sh. I found the script at dev.openwrt.org/browser/trunk/package/kernel/lantiq/ltq-vdsl-fw/src/vdsl_fw_install.sh?rev=37007
My understanding of the script is that I need to copy/transfert the vdsl.bin file from the PC to /lib/firmware/vdsl.bin in the modem.
Am I right? Do I need to do something else?
What is the command using the terminal emulator?

(Last edited by Toutatis on 26 Aug 2016, 16:35)

All you have to do is to copy vdsl.bin file to /lib/firmware/ - in your router
I use for that WinSCP (under Windows) - for Linux you must use some other SCP program

Settings for VDSL connection:

You must modify 3 sections: <config atm-bridge 'atm'>, <config interface 'wan'>, <config vdsl 'dsl'> - in: /etc/config/network

#config atm-bridge 'atm' - this section can be deleted
    #option vpi '1'
    #option vci '32'
    #option encaps 'llc'
    #option payload 'bridged'

config interface 'wan'
    option ifname 'ptm0.35'
    option proto 'pppoe'
    option username 'login'
    option password 'password'
    option ipv6 '0'

config vdsl 'dsl'
    option firmware '/lib/firmware/vdsl.bin'
    option tone 'av'
    option xfer_mode 'ptm'

Note:
It is also possible that You must change 35 (VLAN ID) to the proper value - in line: option ifname 'ptm0.xx'
But You must check first VLAN ID of Your ISP.

(Last edited by Scotch's on 26 Aug 2016, 18:30)

Scotch's wrote:

It is also possible that You must change 35 (VLAN ID) to the proper value - in line: option ifname 'ptm0.xx'
But You must check first VLAN ID of Your ISP.

It's 101 if you are in the UK. It can be googled for each country.

Could you confirm.
Reboot the modem, connect Ethernet cable, set static IP address to the PC: 192.168.1.2
Terminal:
scp /path/to/vdsl.bin admin@192.168.1.1:/lib/firmware/vdsl.bin
no password, just return

I am in Ireland with Vodafone and I don't know where to find the setup
BTW could you read this thread (I can't post URL)
h t t p s :
//community.vodafone.ie/t5/Technical-Support/Vodafone-VDSL-Settings-for-3rd-Party-Router/td-p/166813
and let me know your thoughts.

(Last edited by Toutatis on 26 Aug 2016, 19:19)

Without connection details (i.e.login/password) you will not be able to establish internet connection on TD-W8970.
However You can still use your own router - connected to the VF router (their router will be working as modem only).

I did so - because my ISP router has better synchronization parameters than my TD-W8970
The only thing you have to do with VF router will be to disable WiFi and connect one of the LAN ports to LAN/WAN port of TD-W8970.

If that solution is OK for You - let me know,  I'll describe how to prepare LAN port of TD-W8970 to work as WAN port.

I am now in the process to install Openwrt.
I noticed something I want to be sure 100%.
In the howto the flash layout table for OEM 1.2 (I have this version) shows
mtd1     0x00020000-0x00160000     kernel     RAM executable     kernel 2.6.32
mtd2     0x00160000-0x007c0000     rootfs     squashfs     root
In the Installation direct to Flash, point 2e Erase the rootfs flash area:
sf erase 0x20000 0x7a0000
This command will erase from kernel and a part of rootfs, not all. Is it an error "a" instead of "c" for all the rootfs?
- Are the values correct?

After that I'll have to write image to flash
The length of the file vary with the version. When I copied the image file to the RAM I got the value
Bytes transferred = 4194308 (400004 hex)
I'd guess I have to use this value but the difference with the howto seems big to me between 2 images versions (0x680004 vs 0x400004).
Maybe the author wanted to forecast the different versions and added some space but what is in the RAM after 0x40004 position to be transferred into flash?
What len should I use?
sf write 0x80800000 0x20000 0x400004

This is the part the most dangerous of the process, I need your help with all accuracy.
Many thanks

Scotch's wrote:

Both OpenWrt Designated Driver and LEDE are Trunk versions - they changing frequently and are without GUI (LUCi).

You are right that trunk versions change frequently and version change of kernel of libc can force you to perform a sysupgrade - which is kind of painful in my extroot-setup. But of course they have LuCI, it is just not included on the image.

opkg update; opkg install luci luci-mod-admin-full

does the job (once your router has internet connectivity). To avoid the frequent sysupgrades I created a private mirror of the relevant parts of the repository on an external storage (mounted USB disk, approx. 656 MB required):


As we already have a web-server (the funky link-detection of this forum doesn't allow me to write its real name ...) running on our device, I just needed to link the mirrored folders into the /ww w folder:

wget --recursive --no-parent h t t p : //downloads.lede-project.org/snapshots/targets/lantiq/xrx200/packages
wget --recursive --no-parent h t t p : //downloads.lede-project.org/snapshots/packages/mips_24kc
cd /ww w; ln -s /path/to/your/storage/mirror/downloads.lede-project.org/snapshots .

I replaced the hostname with 'localhost' in all lines from /etc/opkg/distfeeds.conf like this:

src/gz reboot_core  h t t p : //localhost/snapshots/targets/lantiq/xrx200/packages

Now I'm pinned on a specific revision from the trunk without having changes of kernel version and libc every now and then. Another advantage of this setup is that I can continue to install/uninstall packages using opkg without internet connectivity.

Toutatis wrote:

sf erase 0x20000 0x7a0000
This command will erase from kernel and a part of rootfs, not all. Is it an error "a" instead of "c" for all the rootfs?
- Are the values correct?

Yes, as explained in 3.

wiki wrote:

3. the rootfs area is 0x7c0000, erase command is to 0x7a000 and BB image is only 0x680004 in size, so it works anyway. If your image is bigger, custom or next release you see the size after tftpboot command and need to adjust it.

You don't need to erase a larger area but if you want - it's your own risk. Just tell us if you were lucky ;-)

Toutatis wrote:

What len should I use?
sf write 0x80800000 0x20000 0x400004

looks good. Size matches exactly with sysupgrade image listed here: h t t p s hmm/downloads.openwrt.org/chaos_calmer/15.05.1/lantiq/xrx200/

If your paranoia demands it, you can compare the sha256 sum of your file with the one listed here:
h t t p s hmm/downloads.openwrt.org/chaos_calmer/15.05.1/lantiq/xrx200/sha256sums

If this still doesn't make you feel safe you can verify the GPG signature of the sha256sums file.

I did it !
Everything smooth, looks working, I am happy

vdsl.bin is in /lib/firmware/ folder. I did reboot but I can't find anything related to vdsl. Sould I do something?
I am not skilled at all on WAN networking, I'll need help again.

Some info on my working config on vodafone modem:
ATM_TR069_VOIP_INTERNET_R_8_35    IP_Routed (PPP)    Disconnected         Enable
PTM_TR069_INTERNET_R_VID_10    IP_Routed (PPP)    Connected     IPv4

ATM_TR069_VOIP_INTERNET_R_8_35:
WAN connection:     Enable
Service list:     INTERNET     TR069       VOIP
Connection type:     IP_Routed (PPP)
Connection type:     IPV4
NAT:  NAPT
Authentication mode:     Auto
Connection trigger: AlwaysOn
User name: (I can read it, grey out)
Password: (I CAN'T read it, but maybe guess it, grey out)
Tunel Type:     None
MRU: Auto
MSS: Auto

Where to copy this setup on the Openwrt?

Scotch's wrote:

All you have to do is to copy vdsl.bin file to /lib/firmware/ - in your router
I use for that WinSCP (under Windows) - for Linux you must use some other SCP program

Settings for VDSL connection:

You must modify 3 sections: <config atm-bridge 'atm'>, <config interface 'wan'>, <config vdsl 'dsl'> - in: /etc/config/network

#config atm-bridge 'atm' - this section can be deleted
    #option vpi '1'
    #option vci '32'
    #option encaps 'llc'
    #option payload 'bridged'

config interface 'wan'
    option ifname 'ptm0.35'
    option proto 'pppoe'
    option username 'login'
    option password 'password'
    option ipv6 '0'

config vdsl 'dsl'
    option firmware '/lib/firmware/vdsl.bin'
    option tone 'av'
    option xfer_mode 'ptm'

Note:
It is also possible that You must change 35 (VLAN ID) to the proper value - in line: option ifname 'ptm0.xx'
But You must check first VLAN ID of Your ISP.

OK to do that but what do I need to use: ssh, serial or web interface?

Edit: Did it with ssh, now I have to test on WAN line

(Last edited by Toutatis on 29 Aug 2016, 09:27)

Again, sorry for my ignorance.
Now I have plugged the WAN line. In Status I can read:

ADSL Status
Status: UP
Line State: showtime_tc_sync [0x801]
Line Speed: 18.432 Mb/s / 5.116 Mb/s   (This is the speed I have with the other modem: OK)
Line Attenuation: 25.1 dB / 0 dB
Noise Margin: 12.5 dB / 10.3 dB

The 2 first LED on the modem are steady ON.
System log says

Interface 'wan' is enabled
Interface 'wan' is setting up now
Plugin rp-pppoe.so loaded
RP-PPPoE plugin version 3.8p compiled against pppd 2.4.7
pppd 2.4.7 started by root, uid0

Kernel log says

enter showtime
device ptm0 entered promiscuous mode
device ptm0 left promiscuous mode
IPv6: ADDRCONF (NETDEV_UP): ptmo.35: link is not ready
device ptm0 entered promiscuous mode
device ptm0 left promiscuous mode
IPv6: ADDRCONF (NETDEV_UP): ptmo.35: link is not ready
device ptm0 entered promiscuous mode

Repeats the last 3 lines

What set-up I should add/change?
Do you need more info?

Thanks for your help

(Last edited by Toutatis on 29 Aug 2016, 11:04)

In your previous post

PTM_TR069_INTERNET_R_VID_10    IP_Routed (PPP)    Connected     IPv4

so your provider is using PTM in vlan 10.
Your config show ptm0.35 . Change it to ptm0.10 in wan , change the o to 0 ( zero ) .

(Last edited by zhadoom on 29 Aug 2016, 22:37)

Thank you zhadoom, it's working now, you saved my day!

Now I'll play with it, set it up for my home lan then use it instead of the Vodafone one.
I'll attach a USB drive, maybe I'll have some question and I like the CRON to control WIFI.

Thanks again to z3non, Scotch's, dziny, rezad1393 and zhadoom

Another question:
I try to set port forwarding.
Match
IPv4-TCP, UDP
From any host in wan
Via any router IP at port 51413
Forward to
IP 192.168.1.115, port 51413 in lan
Enabled
However when I test the port is still closed.
Where is my error?

TCP port 51413 is used by transmission.
The machine at 192.168.1.115 have the software running ( listening the port 51413 ) ?
If that machine is windows based, is the firewall configured to accept incoming connections to that port ?

Yes, this is Transmission running on 192.168.1.115, Linux. I do the Test port and result is "closed"
This was working 1 hour ago with my other modem

See the thead
ttps://forum.openwrt.org/viewtopic.php?id=66061
I had a look on the bug track #22762 LuCI creating firewall rule with wrong protocol.
I did the correction 'tcpudp' => Nothing better
I did with and without option src_dport '51413' => Nothing better

Any other idea?

(Last edited by Toutatis on 30 Aug 2016, 18:23)

Example of redirect that works in my router adapted to your ip and port.
In /etc/config/firewall

config redirect
        option target 'DNAT'
        option src 'wan'
        option dest 'lan'
        option proto 'tcp udp'
        option src_dport '51413'
        option dest_ip '192.168.1.115'
        option dest_port '51413'
        option name 'torrent1'

This is mine

config redirect
    option target 'DNAT'
    option src 'wan'
    option dest 'lan'
    option proto 'tcpudp'
    option dest_ip '192.168.1.115'
    option dest_port '51413'
    option name 'Transmission'

I tried
    option proto 'tcp udp'
nothing better
See post 21 The basic check list from
h ttps://forum.openwrt.org/viewtopic.php?id=36055
So far nothing found
Checked with canyouseeme.org as well

I am wandering if the position in the list is relevant. This redirect is the last in the /etc/config/firewall file.

(Last edited by Toutatis on 30 Aug 2016, 19:00)

Toutatis wrote:

This is mine

config redirect
    option target 'DNAT'
    option src 'wan'
    option dest 'lan'
    option proto 'tcpudp'
    option dest_ip '192.168.1.115'
    option dest_port '51413'
    option name 'Transmission'

I tried
    option proto 'tcp udp'
nothing better
See post 21 The basic check list from
h ttps://forum.openwrt.org/viewtopic.php?id=36055
So far nothing found
Checked with canyouseeme.org as well

I am wandering if the position in the list is relevant. This redirect is the last in the /etc/config/firewall file.

the source port should be added . without that port forwarding doesn't mean anything.

and the option proto 'tcp udp' should be that way too.
try them together.

(Last edited by rezad1393 on 30 Aug 2016, 19:18)

Toutatis wrote:

This is mine

config redirect
    option target 'DNAT'
    option src 'wan'
    option dest 'lan'
    option proto 'tcpudp'
    option dest_ip '192.168.1.115'
    option dest_port '51413'
    option name 'Transmission'

I tried
    option proto 'tcp udp'
nothing better
See post 21 The basic check list from
h ttps://forum.openwrt.org/viewtopic.php?id=36055
So far nothing found
Checked with canyouseeme.org as well

I am wandering if the position in the list is relevant. This redirect is the last in the /etc/config/firewall file.

After changing the file /etc/config/firewall do you restart the firewall service ?
If not, do /etc/init.d/firewall restart .

@ rezad1393

the source port should be added . without that port forwarding doesn't mean anything.

- Thread
https://forum.openwrt.org/viewtopic.php?id=36055
Post 21
Point b) the source ip is either unset (should be this way) ...
However I did both => Not working

and the option proto 'tcp udp' should be that way too.

- As I wrote I did both => Not working

@ zhadoom
Sure I do it at every change, at least once to be certain and I check the output.

I did all the above again, => Not working

(Last edited by Toutatis on 30 Aug 2016, 20:51)

I had a lot of reading and checked the

The basic check list to run through before considering port forwards "broken":

What I don't know how to check or read the 3 points bellow:
f) accessing the own public ip from within the lan is not the same as actually testing a port forward from the outside. OpenWrt will attempt to setup some loopback rules but they only work by default if your lan network is called "lan"
i) use "{ iptables -nvL; iptables -t nat -nvL; } | grep port-nr" to see if you rules are actually reached, a counter of 0 means that either no traffic ever arrived or that the arriving traffic was not matched, because e.g. a bad "src_ip" is set
m) make sure the outgoing traffic is masqueraded (should be by default)

Thanks