Могу ли я пинговать общедоступный IP-адрес ключа 3G?

9994
nixda

Я хочу пинговать свое мобильное устройство. Это Raspberry Pi, который имеет 3G-ключ и работающее 3G-соединение. Я могу пинговать с моего устройства наружу, но не наоборот.

Что я исследовал до сих пор

  1. Я понимаю, что мой провайдер предоставляет моему ключу IPv4-адрес, который находится за many-to-one NAT gateway. Таким образом, я не могу пропинговать публичный IP моего ключа из дикого интернета.

  2. Насколько мне известно, мой провайдер (Telekom Germany) по- прежнему не поддерживает IPv6 для мобильных соединений, что может быть потенциальным решением, поскольку каждое устройство должно иметь свой собственный IP.

  3. Я знаю, что вы можете купить SIM-карты со статическими адресами IPv4. Но они слишком дороги для моих нужд

У меня нет выбора?

6
я не использовал такую ​​вещь, но кое-что для рассмотрения, говорит ли вам nmap -P0 dongleip о том, работает ли устройство вверх / вниз? (-P0 - это когда устройство не принимает пинг). Если это говорит вам о том, идет он вверх или вниз, то это может быть альтернативным вариантом. barlop 9 лет назад 0
У вас нет выбора, если вы еще не пытались связаться со службой поддержки вашего 3G-ключа. У большинства производителей этих устройств есть статьи поддержки о включении публичного IP-адреса. Мой маршрутизатор TP-Link 3G имеет следующие инструкции: http://www.tp-link.us/article/?faqid=300 9 лет назад 2
Что именно Вы пытаетесь выполнить (подозревается проблема XY - http://xyproblem.info/)? Я думаю, что создание пингов для систем за NAT (не контролируемых вами) не стоит усилий. Если, например, вам нужен сердцебиение от этого RPi, другие варианты могут быть более жизнеспособными. Это также зависит от других ресурсов, которыми вы управляете (контролируете ли вы какой-либо компьютер с открытым IP?). kestasx 9 лет назад 0
1) Я свяжусь с моим провайдером, как только закончатся праздники. 2) Нет пульса, нет других ресурсов nixda 9 лет назад 0
Это сработало для меня. Даже из школы я мог проверить, используется ли наш ключ. Tomáš Zato 9 лет назад 0

6 ответов на вопрос

5
janos

If your dongle is behind a NAT, then it doesn't have a public IP address and your post title is misleading. Also keep in mind that an IP can be reachable, but not ping-able, if the network's gateway forbids ICMP packets.

First of all, I think you should do what @Tyler suggested in a comment: contact your provider and ask them about:

  • Can they enable public IPv4 access for your device
  • Can they enable public IPv6 access for your device. If not yet, then when will they?
  • Any other alternative they can offer for accessing your device via their network

If these options don't work out, then I'm afraid there won't be a very user-friendly way to access your device.

A not user-friendly, and perhaps not suitable way for you, is remote port forwarding. You can connect from your raspi to a publicly accessible server, and forward connections from a port on the server to a port on your raspi. This is of course far from having a direct connection, and you would have to repeat the setup for every port that you want to access on the raspi.

Although this is less than ideal, and might not even be suitable for you, but at least this is doable, and in any case I can't think of any other option.

3
LawrenceC

If your RPi's 3G dongle is behind a NAT, even if you could ping its public IP, it would not do you any good, as that is not the true IP of your RPi.

You are at the mercy of the network operator's carrier-grade NAT equipment.

Your problem is solvable to some degree using VPNs.

On a system outside of the 3G network that you control, that is reachable by your 3G dongle, setup a VPN server (such as OpenVPN). Make sure it is externally reachable.

Then, setup a VPN client on the Raspberry Pi, and have it periodically attempt to connect to the server when there is no connection. I believe if you start OpenVPN, it will basically do this, though over a 3G connection you may want to rate-limit reconnection attempts so you don't use all your 3G data trying to connect to a nonexistent VPN server, if you don't intend to run the VPN server continually. Or run it on a schedule.

If OpenVPN is set up correctly, you will be able to ping it and otherwise act as though it is directly connected.

Also, look into seeing if your 3G dongle can receive any text messages sent to its mobile number. Linux support for such a feature may be a long shot, and you may be looking at a lot of research on getting this to work, but possibly you could have something polling the dongle for text messages, and then have that start/stop a VPN or similar.

хе. Я пытался опубликовать openvpn в качестве альтернативы ipv6, и я заметил, что ваш ответ стал гораздо более подробным, чем я. Потрясающие. Journeyman Geek 9 лет назад 1
Я закончил с использованием OpenVPN. Не так удобно, как мне пришлось настроить второе устройство nixda 8 лет назад 1
1
Journeyman Geek

I suspect some flavour of ipv6 tunneling might help here.

I've not tried this on a pi, and with raspian ipv6 is not enabled by default anyway, but it can be enabled if you want it.

I've had most luck with v6udpv4(which is designed to punch through NAT) and the gw6c client using gogo6/freenet6 - this protocol has been the most reliable for me through a NATted connection, but you're free to pick another provider/client. Its been a few years (I've had some flavour of ISP supplied ipv6 for years) so I had to compile my own client, and I don't remember the details, but this combination ought to work. I've not found anyone who's tried using gw6c on a raspi, so YMMV.

If that dosen't work, in your specific case, I'd also suggest looking at AYIYA clients and tunnel brokers who support that as an alternative if you have issues with freenet. AYIYA seems to be designed to fit your very specific use case but the tunnel broker I was using at the time didn't support it.

IIRC a registered freenet6 account has a static IP, (and your ip address is unlikely to change anyway), so I'd suggest an AAA record and/or a dynamic DNS provider so you don't need to remember the excessively long ip address.

I'd add you'd need ipv6 on the system that's pinging it as well.

If its just about checking connectivity there might be simpler options, but that's out of the scope of the question as is.

0
harrymc

If your provider is giving you an IPv4 address, then it is very likely that you are behind a many-to-one NAT gateway and you won't be able to reach inside the NAT from the outside.

A possible solution might be to connect to an external VPN service to get a public IP address.

Another possible solution is to contact the Support of your 3G provider and ask for a static IP address. Even if this is possible, it might still require extra payment.

Внешняя VPN вряд ли даст вам внешний IP-адрес, и ОП исключил возможность оплаты статического адреса iv4 в самом вопросе. Journeyman Geek 9 лет назад 0
@JourneymanGeek: VPN-сервис, который выполняет переадресацию портов, является решением. На сегодняшний день существуют сверхдешевые предложения даже [19 $ на 3 года] (https://stacksocial.com/sales/vpn-unlimited-premium-plan-3-years-of-hacker-protection-more). harrymc 9 лет назад 0
0
Fynn

Вы можете настроить свой 3G-ключ с другим APN. internet.t-d1.deдает вам общедоступный IP-адрес (говорят, что этот APN следует использовать только для целей тестирования, поэтому имейте в виду, что вы, скорее всего, сами по себе, если у вас возникнут проблемы). Я получил доступ к своей записной книжке через ssh по IP-адресу, который мне был назначен с этими настройками. Также см. Здесь для получения дополнительной информации о доступных APN Telekom (только на немецком языке).

-2
user400344

I would get ipv6 for my local network if something like this was important. Apart from the ridiculous addresses which cannot be easily remembered it's pretty cool. And you can get a free chunk of addresses.

Это предполагает, что он находится в локальной сети, очевидно, что он не Journeyman Geek 9 лет назад 1