Contents

Config Huawei HS8145X6

How to config Huawei HS8145X6 with shell permission

Background

I recently bought a Huawei HS8145X6 from AliExpress, it’s a good router for connecting to the internet with optical fiber, and I will introduce the detailed parameters in the next chapter.

Which version I bought is Huawei HS8145X6 (GPON) & Shell Permission & Huawei Interface . I pay the extra money for the last two specific contents. Why did I pay for that? That’s because when I bought it, I thought: time is money, and I want to use it without specific configuration, so that can save my time and make me happy.

And after I received that router from the postman, then I started to figure out: how to config the PPPOE client for the internet connection, but at the same time, I found: even it has the Huawei interface, but I still can see a lot of specific content that customized for telecom operators.

So, I start to figure outinternet surfing how to delete pages or services from the Huawei router. There are too many articles to teach you how to enable the shell permission and switch to the Huawei interface from telecom operators’ interface, but they are all useless.

Detail parameters

I have to say again: the router has gorgeous hardware parameters, another essential thing is: it has a little cheap.

You can see the below table, which shows the parameters of the router.

component parameter
CPU SD5117P dual-core ARM A9
Memory DDR3 512MB
Storage 256MB
Ethernet 4 x 1GE & 1 PON port
USB 2 x USB 2.0
Wifi 2.4G/5G 11ax (Wi-Fi 6)
Other 1 x POTS port

Funny things

I found many funny things and unbelievable implementations when figuring out how to remove the telecom operators’ customized content. Those implementations teach me: what is creative.

Here are funny things:

  • The router has built-in LXCLinux Containers capability.
  • Relying on the LXC, it has an OpenWRT system running on the router system.
  • All the telecom operators’ customized content is running on the OpenWRT.
  • The filesystem is mounted as read-only, but it can read overwrite configuration from another file hosted on a read-write mount point.
  • The telecom operators’ service provided a device registry page on 10.0.3.1, and it can configure the LOID and Wi-Fi without the router’s password.

What a brilliant idea! Run container technology on the router system, and run the OpenWRT in the container. I mean: who can believe that?

How to config it

In this part, I will show you how to disable the telecom operators’ customized page.

Disable the LXC

First, we need to disable the OpenWRT that runs in the container because no one wants the guest to access the registration page to messy your router configuration. Did you?

To disable the LXC, you only need to append the below content to the /mnt/jffs2/hw_hardinfo_feature file and restart your router to let the configuration work. If the file does not exist, create it.

1
feature.name="HW_SSMP_FEATURE_CTRG" feature.enable="0" feature.attribute="0"

It means: disable the CTRG feature, and after you disable CTRG, the router will not start the LXC, but what’s the CTRG?

I don’t know the CTRG. I only found it related to the LXC from the init script, but who cares? The important thing is: it works! And I will give a little further information about how I found it.

After you reboot your router, then you can try to access the 10.0.3.1. Ideally, you will get access failed response, and you can try to access your router’s configuration page. It will fail too. Don’t be panic, because it’s part of the result.

Change the port of the router configuration page

Have you noticed the actual configuration page is working on port 8080?

So after you disable the telecom operators’ customized page, you will lose access to port 80, so you can not access your router’s configuration page. Add the 8080 to your configuration address and try again. You will see the familiar page.

So, I guess you want to change the admin page port to 80 now. Am I right?

To change the admin page’s port, you need to append the below content to the /mnt/jffs2/hw_hardinfo_spec file and restart your router to let the configuration work. If the file does not exist, create it.

1
2
spec.name="SSMP_SPEC_WEB_PORTNUM" spec.type="uint" spec.value="80"
spec.name="SSMP_SPEC_WEB_OUTPORTNUM" spec.type="uint" spec.value="80"

You can see the values from the content are 80. Ideally, you can change it to any port you want, but please be careful. If it conflicts with other services, I’m not sure what will happen.

After you restart the router, you will see the admin page will be back.

How I found that things

This part is the rest of the story, if you only care about configuring your router, your work has been done, but if you are interested in other parts, such as how I found them and want to learn how to analyze existing service, you can keep reading this part.

These have a common knowledge: most of the configuration will be store in the /etc folder.

So, if you have some keywords related to what you want to change, you can find them in the /etc file with the below command.

1
find | xargs grep "content what you want to search"

If some contents of the files can match your keyword, you will see something after you run the command, and then you can use vi or less commands to check the file content and use some experience to think is the place has the content which you want.

Disable LXC

First, I combined the top and ps commands, and then I got the first guess: the saf-huawei process probably related to LXC.

Then I tried using the kill command to stop the saf-huawei process, it worked, the LXC stopped for a while, and I can’t access 10.0.3.1 anymore. But after 5 seconds, the saf-huawei process is back so that I can reaccess 10.0.3.1. That’s too sad.

Then I tried to find some scrip related to saf-huawei, and then I got the below code from /etc/rc.d/rc.start/1.sdk_init.sh file.

1
2
3
4
5
6
7
8
9
ctrg_support=`GetFeature HW_SSMP_FEATURE_CTRG`
#saf-huawei......ctrg_m......                                                 
if [ $ctrg_support = 1  ] && [ $work_as_ap -eq 0 ]; then                      
    #........oom........                                                      
    #0....oom....panic........2                                               
    echo 0 > /proc/sys/vm/panic_on_oom                                        
    #1....oom....................0                                            
    echo 1 > /proc/sys/vm/oom_kill_allocating_task                            
fi

And I guess these two echo commands change some configuration of the kernel module. Another reason is I didn’t find any content related to LXC, so I bet the functionality has been build with the kernel module.

Then I disabled the HW_SSMP_FEATURE_CTRG flag by using the hw_hardinfo_feature file. Fortunately, it works for me, and I will not see anything related to LXC and saf-huawei.

Change admin page port

About this part, I just used the find command to search the specific configuration with the HTTP keyword, but I got nothing.

But when I used the top command, I found the web process, and it should host the admin page, so I did some search with web and 8080, then I found some files which include the above lines, and the file name contains HX8145X6.

Then I copied the existing configuration, changed the 8080 to 80, and restarted my router. Everything has been back and works well.

Ok, that’s all the steps about me config my router. I hope it can help you.