Re-enable telnet on Thomson TG585 v8 routers

A few months ago, I had successfully updated the firmware on my Thomson TG585 v8 router to version 8.2.7.8 when I also found out that I could connect to it via telnet, as per my previous post.

Recently, due to connectivity problems, my ISP requested that I perform a factory reset on the device. After solving those connectivity problems, I realised that access via telnet was not possible anymore. The weird thing was that I had not changed any settings on either router or computer, so this problem got really puzzling.

Finally, I found the reason why this was happening, as well as a working solution from member ZhenXlogic over the Greek forum at www.adslgr.com which I replicate here, in English, for those of you that could not easily find a solution, yet. The steps are easy.

First, save your current router settings by visiting the web interface over at 192.168.1.254 and selecting the left icon “Thomson Gateway”. Once inside, click on “Configuration” and then choose to “Save or Restore Configuration”. Then click on “Backup Configuration Now…” and select the location where user.ini will be saved.

Now with your favourite text editor, open the file user.ini and carefully browse inside, until you find the section [servmgr.ini] where you will see the problem itself: the new settings of the router have restrictions on the IP addresses that will access it via telnet, as seen in this output of mine:

[ servmgr.ini ]
ifadd name=PPTP group=lan
ifadd name=HTTP group=lan
ifadd name=HTTPs group=lan
ifadd name=HTTPs group=wan
ifadd name=FTP group=lan
ifadd name=FTP group=wan
ifadd name=TELNET group=lan
ifadd name=TELNET group=wan
ifadd name=DNS-S group=lan
ifadd name=MDAP group=lan
ifadd name=SSDP group=lan
ifadd name=PING_RESPONDER group=lan
ipadd name=HTTPs ip=212.251.87.4
ipadd name=HTTPs ip=62.1.46.29
ipadd name=HTTPs ip=62.1.46.30
ipadd name=HTTPs ip=10.24.11.19
ipadd name=HTTPs ip=10.24.11.20
ipadd name=FTP ip=212.251.87.4
ipadd name=FTP ip=62.1.46.29
ipadd name=FTP ip=62.1.46.30
ipadd name=FTP ip=10.24.11.19
ipadd name=FTP ip=10.24.11.20
ipadd name=TELNET ip=62.1.46.29
ipadd name=TELNET ip=62.1.46.30
ipadd name=TELNET ip=10.24.11.19
ipadd name=TELNET ip=10.24.11.20
ipadd name=TELNET ip=212.251.87.4
modify name=PPTP state=enabled
modify name=SNTP state=enabled
modify name=SLA_ICMP_PING state=enabled
modify name=SLA_UDP_PING state=disabled
modify name=HTTP state=enabled
modify name=HTTPs state=enabled
modify name=WEBF state=disabled
modify name=TFTP-C state=disabled
modify name=FTP state=enabled
modify name=TELNET state=enabled
modify name=RIP state=disabled
modify name=IGMP-Proxy state=enabled
modify name=DNS-S state=enabled
modify name=DNS-C state=enabled
modify name=DHCP-S state=enabled
modify name=MDAP state=enabled
modify name=CWMP-C state=enabled qoslabel=Management
modify name=CWMP-S state=enabled
modify name=SSDP state=enabled
modify name=GRE state=disabled
modify name=IPIP state=disabled
modify name=IP_COMMANDS state=enabled
modify name=PING_RESPONDER state=enabled
mapadd name=HTTP port=www-http
mapadd name=HTTPs port=443
mapadd name=HTTPI intf=LocalNetwork port=www-http
mapadd name=HTTPI intf=LocalNetwork port=1080
mapadd name=HTTPI intf=LocalNetwork port=httpproxy
mapadd name=FTP port=ftp
mapadd name=TELNET port=telnet
mapadd name=DNS-S port=dns
mapadd name=MDAP port=3235
mapadd name=SSDP port=1900

As you can see, unless you set the IP of your computer to the above specific values in highlighted red, the router will not allow access to its telnet console. For some reason, the developers of the Thomson firmware forgot to include the router’s default IP subnet, i.e. 192.168.1.xxx completely.

To remedy this situation, you simply need to add the line below as the first entry for TELNET, in order to allow the current router’s IP subnet (static or DHCP) computers to connect to it:

ipadd name=TELNET ip=192.168.1.[1-100]

In my example, I restrict the range from 1 to 100 but you can also set it from 1 to 200, accordingly. Therefore, insert this entry with your text editor back in the [servmgr.ini] section, like I did:

[ servmgr.ini ]
ifadd name=PPTP group=lan
ifadd name=HTTP group=lan
ifadd name=HTTPs group=lan
ifadd name=HTTPs group=wan
ifadd name=FTP group=lan
ifadd name=FTP group=wan
ifadd name=TELNET group=lan
ifadd name=TELNET group=wan
ifadd name=DNS-S group=lan
ifadd name=MDAP group=lan
ifadd name=SSDP group=lan
ifadd name=PING_RESPONDER group=lan
ipadd name=HTTPs ip=212.251.87.4
ipadd name=HTTPs ip=62.1.46.29
ipadd name=HTTPs ip=62.1.46.30
ipadd name=HTTPs ip=10.24.11.19
ipadd name=HTTPs ip=10.24.11.20
ipadd name=FTP ip=212.251.87.4
ipadd name=FTP ip=62.1.46.29
ipadd name=FTP ip=62.1.46.30
ipadd name=FTP ip=10.24.11.19
ipadd name=FTP ip=10.24.11.20
ipadd name=TELNET ip=192.168.1.[1-100]
ipadd name=TELNET ip=62.1.46.29
ipadd name=TELNET ip=62.1.46.30
ipadd name=TELNET ip=10.24.11.19
ipadd name=TELNET ip=10.24.11.20
ipadd name=TELNET ip=212.251.87.4
modify name=PPTP state=enabled
modify name=SNTP state=enabled
modify name=SLA_ICMP_PING state=enabled
modify name=SLA_UDP_PING state=disabled
modify name=HTTP state=enabled
modify name=HTTPs state=enabled
modify name=WEBF state=disabled
modify name=TFTP-C state=disabled
modify name=FTP state=enabled
modify name=TELNET state=enabled
modify name=RIP state=disabled
modify name=IGMP-Proxy state=enabled
modify name=DNS-S state=enabled
modify name=DNS-C state=enabled
modify name=DHCP-S state=enabled
modify name=MDAP state=enabled
modify name=CWMP-C state=enabled qoslabel=Management
modify name=CWMP-S state=enabled
modify name=SSDP state=enabled
modify name=GRE state=disabled
modify name=IPIP state=disabled
modify name=IP_COMMANDS state=enabled
modify name=PING_RESPONDER state=enabled
mapadd name=HTTP port=www-http
mapadd name=HTTPs port=443
mapadd name=HTTPI intf=LocalNetwork port=www-http
mapadd name=HTTPI intf=LocalNetwork port=1080
mapadd name=HTTPI intf=LocalNetwork port=httpproxy
mapadd name=FTP port=ftp
mapadd name=TELNET port=telnet
mapadd name=DNS-S port=dns
mapadd name=MDAP port=3235
mapadd name=SSDP port=1900

Notice the entries in orange, where TELNET is enabled for access via wired (lan) and wireless (wan) computers, at the default port 23:

ifadd name=TELNET group=lan
ifadd name=TELNET group=wan
modify name=TELNET state=enabled
mapadd name=TELNET port=telnet

Now that you’re at it, you can disable (unbind) the router’s SIP port mapping to allow your own SIP devices to work perfectly, as per my older post. Simply remove the line below from section [connection.ini] within user.ini:

bind application=SIP port=5060-5060

You can also disable the WPS functionality by setting the proper field inside [wireless.ini] section:

wps config ssid_id=0 state=enabled

to:

wps config ssid_id=0 state=disabled

Once saved, you need to upload the new configuration back to the router. Thus, you need to visit again the web interface over at 192.168.1.254 and select the left icon “Thomson Gateway”. Right under, click on “Configuration” and then choose to “Save or Restore Configuration”. Then click on “Restore Configuration Now…” and point to the modified user.ini to be uploaded.

The device will reboot in order to apply the new settings; in a couple of minutes, you shall have telnet access!

Enable SIP on Thomson TG585 ADSL modem/router

I have been trying to make my wireless VoIP phone work properly at home, where my ISP gave me the Thomson TG585 v8 ADSL modem/router, but despite my best efforts, the phone would not connect to the SIP registrar/server/proxy.

I thus started digging the internet for a possible solution (or not) and whether I can make this finally work or be forced to change ADSL router. I also have a Netgear DGN2000 as a backup router but I prefer the Thomson as it seems to connect to my ISP at higher speeds.

Following my search, I found out that the modem has an internal SIP service running that messes up the SIP/VoIP packets, and a possible solution is to disable that service. Then, I stumbled on this site that shows how to Telnet the modem/router and change some settings. It seems that if you login via PuTTY or Terminal.app and enter the same credentials as the router’s WebUI, with a simple command you can disable the SIP service:

connection unbind application=SIP port=5060
saveall

The first command unbinds the service from the (default) port for SIP/VoIP and the second command saves the settings to the flash memory. After a necessary soft reboot of the modem/router, the wireless VoIP phone works and successfully connects with my provider’s registrar/proxy!

Terminal.app connecting to TG585

To revert/undo the change above, simply Telnet again the router and type:

connection bind application=SIP port=5060
saveall

…and reboot the modem/router for the change to take effect.

There is a CLI Reference Guide available for this Thomson router that contains all available commands and what they do, for using via Telnet. I got the latest version (v8) from here.

For example, you can display the IP address of the DNS server entries of the modem/router (as provided by the ISP):

dns server route list

This Telnet functionality was a really interesting find…