You are here

Huawei E3276 4G USB dongle and Linux - NAT/PAT

dongleIn this article, I described how I was able to use an E3276 USB dongle on a PC running Linux.

A few days later, I had to face the following requirement: to accept an incoming TCP connection on the PC connected to the internet with the Huawei dongle. I was quite sure that it was possible (name this intuition Smile), but nothing was documented. And searching on the internet didn't give me back any interesting information.

So, I decided to run Wireshark on the PC, just to check whether something I could use was going on at IP level. And I found something Smile: on a periodic basis, the dongle was generating IP frames with destination address set to (multicast address used by Simple Service Discovery Protocol), and destination port set to 1900. Looking at payload of those frames, I rapidly understood that a uPnP server was running on the dongle, and broadcasting its services. And that one of them was a Layer 3 Forwarding service. Quite promising...

I installed UPnP Router Control on the PC, and started it.  It discovered the Huawei dongle immediately. I then added a NAT/PAT rule forwarding  port 32000 of the dongle to port 32000 of the PC:


And that was it! I was now able to connect to an application running on the PC, waiting on port 32000, from a remote machine (provided that, of course, respective IP addresses are on the same sub network).

华为的产品很好! Smile