- Как открыть порты на Андроид: несколько популярных способов
- Для чего нужно закрыть порты на Андроид?
- Как узнать , какие порты открыты на вашем устройстве Android?
- Как обезопасить свое устройство Андроид?
- Port-Forwarding Android Hotspot: How To?
- What Is Port Forwarding?
- Why Do You Need Port Forwarding?
- How Do You Port Forward With an Android Hotspot? (3 Ways)
- #1 Talk to Your Carrier
- #2 Use a VPN
- #3 Shop for Apps
- How to port-forward internet using Android Hotspot to PC?
- 1 Answer 1
- ROOT SOLUTION:
- NON-ROOT SOLUTION:
Как открыть порты на Андроид: несколько популярных способов
Открыть порты на Android возможно, но не всегда целесообразно. А если вы являетесь обладателем Android — смартфона, то вас , скорее , должен волновать вопрос, как закрыть порты на Андроид. Чуть ниже объясняем , почему.
Для чего нужно закрыть порты на Андроид?
Как узнать , какие порты открыты на вашем устройстве Android?
- У вас должна быть создана новая точка доступа WiFi на вашем устройстве.
- Вторым шагом будет подключение к этой точке вашего компьютера.
- Нужно использовать команды: ifconfig и/или ipconfig в консоли, эти команды помогут узнать IP адрес вашего устройства.
- Загрузите сканер безопасности nmap с сайта nmap.org.
- Воспользуйтесь следующей командой в сканере: nmap -sS -Pn -p- your_phone_ip_adress.
Как обезопасить свое устройство Андроид?
- Брандмауэр без ROOT. Это один из лучших брандмауэров для Android — устройств. Очень простой в использовании, не требует root-прав для работы на устройстве. Очень широкий список фильтрации трафика по хосту, порту, домену и т.д.
- Android Firewall +. Требуется доступ к устройству с рут-правами, поэтому , если у вас есть такой доступ, можете смело использовать этот. Он также позволяет осуществлять контроль трафика по различным критериям, позволяет открывать и закрывать порты на Андроид и предлагает набор интересных «плюшек».
- NetPatch Firewall. Он несколько отличается от первых двух фаер в о л ов. У него присутствуют их основные функции, однако из собственных можно отметить: создание доменов и группы IP, блокировка определенных IP, блокировка или настройка Wifi для разных приложений отдельно.
- InternetGuard Data Saver Firewall — это еще один из самых крутых брандмауэров для Android — устройств. Не зря у него один из самых высоких рейтингов от пользователей. Очень непохожий пользовательский интерфейс его существенно выделяет среди конкурентов. По своей функциональности он не уступает никому из этого списка.
- VPN Безопасный брандмауэр. Ему н ен ужны рут-права для блокировки / разблокировки приложений или чтобы открыть или закрыть порты на Android — устройстве. Он является полностью бесплатным продуктом, но тем не менее по функционалу не уступает свои м платным собратьям.
Мы будем очень благодарны
если под понравившемся материалом Вы нажмёте одну из кнопок социальных сетей и поделитесь с друзьями.
Port-Forwarding Android Hotspot: How To?
Here’s how to port-forward with your Android hotspot:
Generally speaking, port forwarding is not available on LTE carrier networks.
You can talk to your carrier and see if they offer features, services, or other support for port forwarding.
More likely, you will need to implement a workaround using VPNs or specialized apps on your Android device.
So if you want to learn all about how to port-forward a hotspot on your Android device, then this article is for you.
- 3 Ways to Port-Foward iPhone Hotspot
- ISP Blocking Ports: What to Do?
- ISP Blocking Port Forwarding: How to Know?
- DMZ vs. Port Forwarding: Difference?
What Is Port Forwarding?
If so, have you ever wondered what prevents anyone on the internet from finding the devices on your Wi-Fi and connecting right to them?
It turns out that the secret lies in port forwarding.
You see, every device that gets online has an address.
It’s called an IP address, and it works a lot like your physical address.
If your physical address can tell people where to find your house, then your IP address can tell internet devices where to find your computer (or phone, or whatever).
As you might imagine, you don’t want the whole of the internet to know your IP address, so your Wi-Fi is actually a private network.
Unless another device is on your Wi-Fi too, it can’t see your IP address.
This gives you a lot of privacy and security, but it comes at a price.
If the rest of the internet doesn’t know your IP address, how can a website send you the information you request?
That’s where port forwarding comes into play.
Instead of sharing your IP address with everything on the internet your router has its own address.
So, the router can talk to the rest of the internet, and it acts as a bouncer of sorts for any devices out there that want access to you.
Port forwarding is the key to this technique.
Your router designates ports for every device on its network.
Using those ports, it can establish a connection between your computer and a website without giving up your true IP address.
On the other end of the connection, the server that actually runs the website is often doing the same thing.
It uses port forwarding so that you don’t know its real address either.
The end result is that you get a direct connection between two devices that are on private networks (although port forwarding also works with public networks).
Why Do You Need Port Forwarding?
Port forwarding allows for connections between devices on different networks.
That seems useful, but when do you need port forwarding?
First, you need it to connect devices within the network to just about anything, if your network is private and/or secure.
There are exceptions depending on your own network, but generally speaking, port forwarding shows up when you check your email, visit social media, Google random things, or stream content.
On top of that, you might need specific port forwarding resources if you want to personally manage a connection.
So, if you wanted to host your own website, port forwarding is essential.
The computer that actually runs the website needs port forwarding in order to maintain stable connections with visitors.
Similarly, if you wanted to set up a Minecraft server, you would need port forwarding.
It’s something that shows up any time you want to host a connection.
That’s not always necessary for daily use, but there are plenty of scenarios where hosting a connection does become necessary, and you want port forwarding in those cases.
How Do You Port Forward With an Android Hotspot? (3 Ways)
So, if you’re using an Android hotspot and you want to set up port forwarding, then you need to learn the steps.
First off, if you’re just connecting a device like a laptop, and you aren’t doing any hosting, then you don’t really need to worry about port forwarding.
Carrier networks (which is presumably what your Android hotspot is on) use something called a carrier-grade NAT (Network Address Translation).
Basically, this is a replacement for port forwarding.
Since countless devices can connect to the same carrier network at the same time, port forwarding isn’t really robust enough to handle the job of masking IP addresses for every device at once.
A carrier-grade NAT works differently, but it accomplishes the same task.
So, if you’re only connecting one device to your Android hotspot, then the NAT handles your internet anonymity, and you don’t need to worry about ports.
But, if you’re doing something that does require port forwarding, then there are a few things you can try.
The important thing to understand is that you’re using a carrier network, so you don’t have direct control.
You’ll need the support of the carrier or a good workaround.
#1 Talk to Your Carrier
You can contact your carrier and see if they support port forwarding.
If they do, then they can help you assign ports and get everything set up.
There might be an additional fee for this service.
They might not support this feature.
If that’s the case, you can’t really force port forwarding into a carrier network.
Instead, you’ll need to look into workarounds.
But, I have a couple that you can try.
#2 Use a VPN
If you connect to a VPN server, it can help you assign a port to the device you’re using.
You can set up de facto port forwarding.
Things work a little differently with this workaround than if you just managed your own router, but the end result is basically the same.
Your device can get assigned the necessary port, and you can host whatever server or service you’re trying to host.
The details will depend on what specifically you are trying to accomplish.
But you can shop VPN services and talk to representatives to explain exactly what you’re doing.
They can help you find the right service or feature to get it done.
#3 Shop for Apps
There are apps on the Play Store that allow you to reassign ports and implement workarounds for port forwarding.
Each one will be a little different, and they will work in any number of different ways.
But, if you browse the apps, you might find one that provides the specific results you need for your setup.
How to port-forward internet using Android Hotspot to PC?
I have a Moto G3 Turbo with Android 6.0.1 Marshmallow. I use the phone to make WiFi hotspot so I can use internet on my laptop. I was able to do a successful Metasploit over WAN/Internet, and for that I need to port-forward to my laptop. But the problem is, I don’t have any modem or router to actually go to setting login with admin password or anything like that. What can I do? Is there any app that can do this and whether it needs root permission?
Generally you can’t, not because Android isn’t capable, but because in general carriers don’t allow inbound traffic of any kind to mobile devices. You may get an IP address from your carrier, but that is just for outbound traffic, unsolicited inbound traffic (the kind you need port forwarding for) is nearly always blocked by every carrier world-wide. Add to that most carriers don’t give you a public IP anyway, so even if you did get port forwarding to work, you likely couldn’t use it.
That’s not true, if your application could not receive inbound traffic how you getting message to your phone.
@ShawnThomasRheal by opening an outbound connection and keep it open for replies. That’s what most apps use GCM for – so not every app has to keep its own connection open.
1 Answer 1
In most cases you won’t be able to make inbound connection when using Mobile Data because of CGNAT and firewalls at ISP level, as explained by acejavelin in comment. To know the problem in detail and how it can be worked around see How to connect to Android through SSH over 3G/4G public IP?
However if you can reach your phone from internet, extending this access to a connected host (PC in your case) is not a problem. Port forwarding is done with routers, and when being used as a Wi-Fi hotspot (or with USB tethering), your phone is in fact acting as a router.
ROOT SOLUTION:
In order to forward port, you need to do Destination Address Translation (DNAT) using Linux kernel’s builtin firewall userspace tool iptables .
First make sure that kernel is configured to forward internet traffic (already set when hotspot is ON):
~# echo 1 >/proc/sys/net/ipv4/ip_forward
Let’s say the IP address assigned by hotspot to PC is 192.168.43.10 and you want to forward SSH default port ( 22 ):
~# iptables -t nat -I PREROUTING -p tcp --dport 22 -j DNAT --to 192.168.43.10
This is the simplest form of Port Forwarding.
If default POLICY of FORWARD chain in FILTER table is not ACCEPT, define rules explicitly to accept the forwarded packets:
~# iptables -I FORWARD -p tcp -d 192.168.43.10 --dport 22 -j ACCEPT
Also accept outbound forwarded traffic if needed.
NON-ROOT SOLUTION:
On non-rooted devices you can use adb or some other minimal TCP/UDP server like netcat or socat for port forwarding. Note that this won’t work for ports under 1024. To forward port 2222 :
~$ adb reverse tcp:2222 tcp:2222
~$ nc -lk -p 2222 -e nc 192.168.43.10 2222
* nc is a busybox applet. But make sure that you get the right binary, there are multiple implementations of netcat .
* Use -u option to forward UDP port.
However nc accepts only a single connection at a time. Use socat or ncat for more advanced options, e.g. from Termux:
~$ socat tcp-l:2222,fork,reuseaddr tcp:192.168.43.10:2222
There are also apps like Fwd (it’s open-source, I have no affiliation) meant for port forwarding.