Aktuell habe ich einen gut funktionierenden vServer mit meiner Webseite, Mailserver und Owncloud. Jedoch kostet mich das Teil halt monatlich Geld, was ich mir sparen könnte, da ich selbst zu Hause einen HP Microserver habe und daruf das ganze abbilden will (in einer Hyper V VM).
Das ganze läuft auch schon ganz gut (es ist natürlich noch nichts groß umgezogen oder eingerichtet). Leider stecke ich an einem Punkt fest, wo ich zugegeben leider nicht so fit drin bin (bin auch nicht der große Linux/Debian Crack, das gleich vorweg. Und bitte keine großen Belehrungen! Hinweise oder direkte Hilfe wären Zielführend).
Ich bekomme das mit dem Forwarding (IPTables) nicht so hin.
Aktuell bekomme ich soweit alles zum Server durch. Ping der tun - Interfaces in beide Richtungen geht und ich kann die apache-Seite, sowie die Seiten von iRedMail (Mail und iredadmin) aufrufen. Ich kann vom Client aus auch einen ping zu google oder bild.de oder was auch immer erfolgreich absetzen. Nur kann ich z.B. über wget am VPN-Client nichts mehr laden und auch apt-get strekt z.B. mit folgenden Fehlern:
Es scheint einfach nichts über http per Terminal zu funktionieren (meine https auch nicht).apt update
Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://packages.hs-regensburg.de/debian stretch InRelease
Fehl:3 http://security.debian.org/debian-security stretch/updates Release
404 Not Found
Ign:4 http://packages.hs-regensburg.de/debian stretch-updates InRelease
Fehl:5 http://packages.hs-regensburg.de/debian stretch Release
404 Not Found
Fehl:6 http://packages.hs-regensburg.de/debian stretch-updates Release
404 Not Found
Paketlisten werden gelesen... Fertig
E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://packages.hs-regensburg.de/debian stretch Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://packages.hs-regensburg.de/debian stretch-updates Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Die iptables am Server sehen aktuell so aus (und ja, habe schon bissl rumprobiert, daher das Chaos bzw. die uncomments):
IPv4 Forwarding in der Config ist aktiviert [net.inet.ip.forwarding=1].#!/bin/sh
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ens192 -j MASQUERADE
iptables -A INPUT -i ens192 -p udp --dport 1194 -j ACCEPT
# Masquerade outgoing traffic
iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
# Allow return traffic
iptables -A INPUT -i ens192 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
# Forward everything
iptables -A FORWARD -j ACCEPT
iptables -A FORWARD -i ens192 -o tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o ens192 -j ACCEPT
#sudo iptables -t nat -I POSTROUTING 1 -o tun0 -j MASQUERADE
#sudo iptables -I FORWARD 1 -i tun0 -o ens192 -m state --state RELATED,ESTABLISHED -j ACCEPT
#sudo iptables -I FORWARD 1 -i ens192 -o tun0 -j ACCEPT
#orig:
#iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ens192 -j MASQUERADE
#iptables -A INPUT -i tun0 -j ACCEPT
#iptables -A FORWARD -i ens192 -o tun0 -j ACCEPT
#iptables -A FORWARD -i tun0 -o ens192 -j ACCEPT
#iptables -A INPUT -i ens192 -p udp --dport 1194 -j ACCEPT
#additional:
#iptables -I INPUT -p tcp --dport 443 -j ACCEPT
#iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.8.0.2:80
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to 10.8.0.2:443
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 443 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 993 -j DNAT --to 10.8.0.2:993
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 993 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 587 -j DNAT --to 10.8.0.2:587
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 587 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 18000 -j DNAT --to 10.8.0.2:18000
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 18000 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 4190 -j DNAT --to 10.8.0.2:4190
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 4190 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 110 -j DNAT --to 10.8.0.2:110
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 110 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 143 -j DNAT --to 10.8.0.2:1430
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 143 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 995 -j DNAT --to 10.8.0.2:995
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 995 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 25 -j DNAT --to 10.8.0.2:25
iptables -A FORWARD -d 10.8.0.2 -p tcp --dport 25 -j ACCEPT
Ich hoffe mir kann einer helfen.
Danke im Voraus.
PS: Falls einer weiß, wie ich (auf einfachem Weg und ohne den Zielserver zu schrotten) den bisherigen Server auf den bei mir umziehe (beide Debian 9), so würde ich mich auch über Hinweise dazu freuen. Meine Versuche gem. HowTo's aus dem Netz mit rsync etc. führten akteull immer dazu, dass iptables, ufw und aqmavisd am Zielserver dann im Eimer waren. Rest ging (augenscheinlich) problemlos.