![Debian](/pics/debianpackage.png)
Jedoch klappt die Internetverbindung nicht. (Timeouts im Browser...)
Hier mal ein paar Daten:
VPS mit Debian Stretch.
Ich habe unbound installiert, glaube aber nicht, dass das ein Problem ist. DNS Auflösung klappt nicht.
Auf dem Server:
Code: Alles auswählen
cat /proc/sys/net/ipv4/ip_forward
Ich habe eine Firewall mittels IPtables realisiert:
Code: Alles auswählen
[...]
*filter
# Base policy
:INPUT DROP [0:0]
# :FORWARD DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
[...]
###############################################################################
# 2. HOST SPECIFIC RULES #
# #
# This section is a good place to enable your host-specific services. #
# ! DO NOT FORGOT TO COPY THESE RULES TO firewall.ip6tables TO ALLOW IPV6 ! #
###############################################################################
# Accept HTTP and HTTPS
-A INPUT -p tcp -m multiport --dports 80,443 --syn -m conntrack --ctstate NEW -j ACCEPT
# Accept Mail
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
# Accept IMAP
-A INPUT -p tcp -m tcp --dport 143 -j ACCEPT
# Accept SMTP
-A INPUT -p tcp -m tcp --dport 587 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 993 -j ACCEPT
# Accept openvpn
-A INPUT -p udp --dport 1194 -j ACCEPT
# Accept all connections from vpn
-A INPUT -s 10.8.0.0/24 -j ACCEPT
#accept dns from VPN
-A INPUT -i tun0 -p udp --dport 53 -j ACCEPT
###############################################################################
# 3. GENERAL RULES #
# #
# This section contains general rules that should be suitable for most hosts. #
###############################################################################
[...]
# Prevent DOS by filling log files.
-A INPUT -m limit --limit 1/second --limit-burst 100 -j LOG --log-prefix "iptables[DOS]: "
COMMIT
###############################################################################
# 4. HOST SPECIFIC NAT RULES #
# #
# Uncomment this section if you want to use NAT table, e.g. for port #
# forwarding, redirect, masquerade... #
###############################################################################
*nat
# Base policy
:INPUT ACCEPT [0:0]
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# Redirect port 21 to local port 2121
#-A PREROUTING -i eth0 -p tcp --dport 21 -j REDIRECT --to-port 2121
# Forward port 8080 to port 80 on host 192.168.1.10
#-A PREROUTING -i eth0 -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.10:80
# Allow smtp on port 36854
-A PREROUTING -p tcp --dport 36854 -j REDIRECT --to-port 587
-A POSTROUTING -s 10.8.0.0/24 -o ens3 -j MASQUERADE
COMMIT
ip addr show bei tun0:
Code: Alles auswählen
3: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
link/none
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
valid_lft forever preferred_lft forever
inet6 fe80::6d85:9876:498d:75d9/64 scope link flags 800
valid_lft forever preferred_lft forever
Code: Alles auswählen
dev tun
proto udp
port 1194
server 10.8.0.0 255.255.255.0
#
ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/server.crt
key /etc/openvpn/certs/server.key
dh /etc/openvpn/certs/dh4096.pem
tls-auth /etc/openvpn/certs/ta.key 0
#
verb 4
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
#
cipher AES-256-CBC
auth sha256
#
user nobody
group nogroup
persist-key
persist-tun
client-to-client
comp-lzo
keepalive 10 120
push "redirect-gateway def1 bypass-dhcp"
# push "dhcp-option DNS 10.8.0.1"
push "dhcp-option DNS 8.8.8.8"