Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo liebe FI-Gemeinde ;)

Folgendes Problem:

Ich habe derzeit nur Internet via UMTS Stick an der Fritzbox. Mit O2 bin ich leider hinter einer NAT und kann dadurch keine Ports forwarden.

Ist jetzt erstmal kein Beinbruch, weil ich in etwa 2 Wochen wieder Internet via DSL bekomme. Mich interessiert allerdings, wie ich das umgehen kann.

Ich habe einen kleinen Raspberry wo ich gerne bestimmte Ports freigeben würde. Des weiteren einen (Debian)Root Server mit fester IP-Adresse.

Mein Plan: VPN Verbindung zwischen Raspberry und Root Server und dann die Ports weiterleiten.

Die VPN-Verbindung besteht bereits (OpenVPN). Mein Problem ist noch das Weiterleiten der Ports.

Versucht habe ich bisher Folgendes:


iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 61097 -j DNAT --to-destination 172.16.0.6:61097
iptables -A FORWARD -p tcp -d 172.16.0.6 --dport 61097 -j ACCEPT
iptables -A POSTROUTING -t nat -s 172.16.0.6 -o tun0 -j MASQUERADE[/PHP]

Gefunden hier: iptables - How to do port forwarding/redirecting on Debian? - Server Fault

Habe das halt ein bisschen angepasst, aber ich glaube ich habe dort ein bisschen was durcheinander geworfen.

172.16.0.6 ist die IP-Adresse vom Raspberry im VPN.

Der Root Server hat 172.16.0.1.

Der Port den ich freigeben möchte ist zB 61097

Per nmap (nmap 172.16.0.6 -sV -p 61097) bekomme ich vom Root Server gemeldet: 61097/tcp open unknown

Von außen auf den Root Server allerdings (nmap ROOTSERVER -sV -p 61097): 61097/tcp filtered unknown

Der Dienst der auf dem Port läuft ist leider auch nicht erreichbar.

Habt ihr eine Idee woran es liegt?

  • Autor

Folgende Regel funktioniert:


iptables -t nat -A POSTROUTING --out-interface tun0 -j MASQUERADE
iptables -A FORWARD --in-interface eth0 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -i eth0 -m tcp --dport 61097 -j DNAT --to-destination 172.16.0.6:61097
[/PHP]

Außerdem: echo 1 > /proc/sys/net/ipv4/ip_forward

Bearbeitet von sas86ks

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.