I'm using OpenWrt 23.05, and I'm tethering my Android phone's 4G connection to OpenWrt. On my Android phone, I'm using Termux to install some services to access a USB device connected to OpenWrt and using Ser2net on OpenWrt for sharing.
From the LAN network, I can connect to the port opened by Ser2net. However, I can't connect from Termux. I've tried telnet to that port, but it's getting refused. I can still telnet to port 22 and 80 from Termux.
What configuration do I need to make so that Termux can see ports other than 80 and 22?
Telnet is not available on openwrt. Use ssh.
I can SSH; I'm currently using SSH to connect to OpenWrt and forward ports to Termux. Tonight, I want to access the port that Ser2net has opened directly from Termux
Is your question about how to configure ser2net? Or opening the port on your router? Or getting termux to recognize the port?
Identify the port number on OpenWrt:
netstat -l -n -p | grep -e ser2net
Then create a port opening rule in your upstream firewall zone.
On my laptop, I can access OpenWrt with the IP 192.168.5.1:5000 (5000 is the port opened by Ser2net). However, in Termux, I can't access 192.168.5.1:5000. I can access ports 80 and 22 of 192.168.5.1 from Termux. Termux has the IP address 192.168.42.129. I've configured it like this in OpenWrt, but it still doesn't work.
https://imgur.com/a/xpXZ9rF
Your Android device is on a completely different subnet- is this intentional? Do you have multiple subnets configured on your openwrt device?
Edit: I see that in your image.
Please post your config…
Please copy the output of the following commands and post it here using the "Preformatted text </>
" button:

Remember to redact passwords, MAC addresses and any public IP addresses you may have:
cat /etc/config/network
cat /etc/config/firewall
1 Like
Temporarily stop Tailscale to disable its built-in PBR and stop mobile VPN client if any,
Thank you everyone for your replies
I solved the problem, I changed the port on ser2net and was able to access it