FastNetMon

Sunday 15 October 2023

Using TP Link TL-SG108E web UI configuration tool on Ubuntu 22.04

My research was based on this great post from 2014.

This switch has UI which can be accessed via windows application and has UI which can be accessed via browser. 

Just for entertaining purposes I decided to try Window app on my Ubuntu 22.04 Linux machine.

To do so I installed wine:

sudo apt install wine-development

Then I downloaded version v1.3.10, 2022-04-12 from TP Link web site and unpacked it:

wget https://static.tp-link.com/upload/software/2022/202204/20220412/Easy%20Smart%20Configuration%20Utility%20v1.3.10.0.zip

unzip "Easy Smart Configuration Utility v1.3.10.0.zip"

After that I was able to run installer:

wine Easy\ Smart\ Configuration\ Utility\ v1.3.10.0.exe

Installation was finished successfully and then all exe files were put to "~/.wine/drive_c/Program Files (x86)/TPLINK/EasySmartConfigurationUtility".

And I was able to run it from first attempt:

cd ~/.wine/drive_c/Program Files (x86)/TPLINK/EasySmartConfigurationUtility 

wine Easy\ Smart\ Configuration\ Utility.jar

Unfortunately, it did not find switch:

Then I used trick from article I referenced above. You need to replace 192.168.1.201 by local IP address in your network:

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p udp -d 255.255.255.255 --dport 29809 -j DNAT --to 192.168.1.201:29809

After that it worked just fine:


Yay! For some reasons DHCP did not work well and IP address wasn't changed. In this case UI tool solves one of the most annoying issues: IP address discovery. 

I was able to change password to new one but everything else causes wine to crash:

0130:err:ole:com_get_class_object class {597d4fb0-47fd-4aff-89b9-c6cfae8cf08e} not registered

0130:err:ole:com_get_class_object no class object {597d4fb0-47fd-4aff-89b9-c6cfae8cf08e} could be created for context 0x1

0130:err:ole:com_get_class_object class {597d4fb0-47fd-4aff-89b9-c6cfae8cf08e} not registered

0130:err:ole:com_get_class_object no class object {597d4fb0-47fd-4aff-89b9-c6cfae8cf08e} could be created for context 0x1

#

# A fatal error has been detected by the Java Runtime Environment:

#

#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d2efe4d, pid=244, tid=304

#

# JRE version: 7.0_15-b03

# Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode windows-x86 )

# Problematic frame:

# C  [glass.dll+0xfe4d]  _Java_com_sun_glass_events_KeyEvent__1getKeyCodeForChar@12+0x134d

#

# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

#

# An error report file with more information is saved as:

# C:\Program Files (x86)\TPLINK\EasySmartConfigurationUtility\hs_err_pid244.log

#

# If you would like to submit a bug report, please visit:

#   http://bugreport.sun.com/bugreport/crash.jsp

# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#

0130:err:msvcrt:_invalid_parameter (null):0 (null): (null) 0 

After reading the Internet I found that this exe file is in fact Java JAR file and I've tried running it using OpenJDK:

sudo apt install default-jre

Sadly it failed miserably:

java -jar Easy\ Smart\ Configuration\ Utility.exe 

Error: JavaFX runtime components are missing, and are required to run this application

As final attempt I've tried using Java from Oracle directly.   You need to download it manually and then unpack it:

sudo tar -xf jre-8u381-linux-i586.tar.gz -C /opt

And run:

/opt/jre1.8.0_381/bin/java -jar Easy\ Smart\ Configuration\ Utility.exe 

Sadly it failed too:

Exception in thread "main" java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:904)

Caused by: java.lang.UnsupportedOperationException: Internal Error

at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:158)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)

at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)

at com.sun.glass.ui.Application.run(Application.java:147)

at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:279)

at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)

at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)

at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)

at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)

... 5 more


 You may try running older version of Oracle Java as bundled JRE is dated by 2013:

root@station:/home/pavel/.wine/drive_c/Program Files (x86)/TPLINK/EasySmartConfigurationUtility/jre# head COPYRIGHT 

Copyright � 1993, 2013, Oracle and/or its affiliates. 

All rights reserved.


This software and related documentation are provided under a

license agreement containing restrictions on use and

disclosure and are protected by intellectual property laws.

Except as expressly permitted in your license agreement or

allowed by law, you may not use, copy, reproduce, translate,

broadcast, modify, license, transmit, distribute, exhibit,

perform, publish, or display any part, in any form, or by

root@station:/home/pavel/.wine/drive_c/Program Files (x86)/TPLINK/EasySmartConfigurationUtility/jre# cat release 

JAVA_VERSION="1.7.0"

OS_NAME="Windows"

OS_VERSION="5.1"

OS_ARCH="i586"

SOURCE=" .:f37a75bd3959 corba:e5b996dabec6 deploy:3bb10c0238fe hotspot:5b55cef461b0 hotspot/src/closed:759fc4d1d429 hotspot/test/closed:2d8e36f71952 install:0154bd493323 jaxp:a55f67cfe182 jaxws:eaf9b2990670 jdk:87e45d30e24d jdk/make/closed:b83ea3e4144a jdk/src/closed:d8651f160809 jdk/test/closed:7e4b15d6c1bb langtools:c160d7d1616d pubs:06f851196d93 sponsors:2dbf246921cb"

 

With IP address in hands I was able to access web UI:


And finally I can use capability for which this switch was bought - port mirror: