wacken
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
Hallo Ich habe versucht openVPN mit dem Tut https://wiki.ubuntuusers.de/OpenVPN/ zu installieren.
Die installation hat auch geklappt und laut Logs läuft openvpn auch, jedoch ist kein Port geöffnet. Logs: Nov 21 21:03:36 xxx systemd[1]: Stopped OpenVPN service.
Nov 21 21:03:36 xxx systemd[1]: Stopping OpenVPN service...
Nov 21 21:03:36 xxx systemd[1]: Starting OpenVPN service...
Nov 21 21:03:36 xxx systemd[1]: Started OpenVPN service.
Der Daemon wird als user openvpn ausgeführt:
# You can uncomment this out on
# non-Windows systems.
#user nobody
#group nogroup
user openvpn
group openvpn Aber auch mit user und group nobody/nogroup funktioniert der Server nicht richtig.
Wie kann ich den Fehler eingrenzen, oder hat schon jemand eine Idee woran es liegen kann, dass kein Port geöffnet wird. Der Port fürs VPN ist natürlich noch nicht von einer anderen Anwendung in Verwendung.
|
lubux
Anmeldungsdatum: 21. November 2012
Beiträge: 13893
|
wacken schrieb: ... woran es liegen kann, dass kein Port geöffnet wird.
Wie sind die Ausgaben von:
systemctl status openvpn
sudo netstat -tulpen | grep -i openvpn
?
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
Ob der Port "bedient" wird siehst Du mit
netstat -tulpn Ob das tun-Device vorhanden ist, zeigt
ip a Fehler beim Starten des Daemons stehen im openvpn.log, welches vermutlich in der Conf angegeben ist. Wenn keins angegeben ist, würde ich Openvpn nicht als Daemon starten, sondern einfach im Vordergrund, um zu sehen, was an Meldungen ausgegeben wird. Solange der direkte Programmstart Fehlermeldungen rausbringt, ist es unnütz, den Start als Daemon beim Booten einzurichten.
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
Ausgaben von: systemctl status openvpn
xxx@xxx:~$ systemctl status openvpn
â openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Mo 2016-11-21 21:03:36 CET; 1h 33min ago
Process: 5128 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 5128 (code=exited, status=0/SUCCESS)
Nov 21 21:03:36 xxx systemd[1]: Starting OpenVPN service...
Nov 21 21:03:36 xxx systemd[1]: Started OpenVPN service.
xxx@xxx:~$
sudo netstat -tulpen | grep -i openvpn
xxx@xxx:~$ sudo netstat -tulpen | grep -i openvpn
xxx@xxx:~$
netstat -tulpn
xxx@xxx:~$ netstat -tulpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5938 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5939 0.0.0.0:* LISTEN -
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9665 0.0.0.0:* LISTEN 10520/java
tcp 0 0 127.0.0.1:9666 0.0.0.0:* LISTEN 10520/java
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:33998 0.0.0.0:* LISTEN 10520/java
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN -
tcp6 0 0 :::5938 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
tcp6 0 0 :::445 :::* LISTEN -
tcp6 0 0 :::139 :::* LISTEN -
udp 0 0 127.0.1.1:53 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 192.168.1.111:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp 0 0 192.168.1.255:137 0.0.0.0:* -
udp 0 0 192.168.1.111:137 0.0.0.0:* -
udp 0 0 0.0.0.0:137 0.0.0.0:* -
udp 0 0 192.168.1.255:138 0.0.0.0:* -
udp 0 0 192.168.1.111:138 0.0.0.0:* -
udp 0 0 0.0.0.0:138 0.0.0.0:* -
udp 0 0 0.0.0.0:7852 0.0.0.0:* -
udp 0 0 0.0.0.0:10000 0.0.0.0:* -
udp6 0 0 :::8082 :::* -
udp6 0 0 fe80::d250:99ff:fe5:123 :::* -
udp6 0 0 ::1:123 :::* -
udp6 0 0 :::123 :::* -
ip a
xxx@xxx:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d0:50:99:59:dc:51 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.111/24 brd 192.168.1.255 scope global dynamic enp3s0
valid_lft 806591sec preferred_lft 806591sec
inet6 fe80::d250:99ff:fe59:dc51/64 scope link
valid_lft forever preferred_lft forever
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
Wie ich gesagt habe, es gibt auf Grund eines Fehlers gar kein tun-Device. Plan den service wieder aus und behebe erst die berichteten Fehler, wenn Du das Programm im Vordergrund startest. Du kannst ja diese Ausgaben hier posten, dann sieht man, woran es scheitert. Und poste auch mal Deine openvpn-Server.conf. Ich würde sogar noch einen Schritt weitergehen und auch später rigoros auf das alte Zeug verzichten und lieber dem systemd-Gedanken folgen: Verzicht auf start-scripte in /etc/init.d beim Dienstestart. Gerade hier ist das überhaupt nicht notwendig, man kann wunderbar das Binary ohne jeglichen Overhead direkt über eine eigene Service-Unit starten. Also erst mal weg mit alten Müll:
systemctl stop openvpn
systemctl disable openvpn
update-rc.d -f openvpn remove
und im Vordergrund starten, bis alles fehlerfrei läuft. Das ist ausserdem viel effektiver bei der Fehlersuche.
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
Meine server.conf: #################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #
# of a many-clients <-> one-server #
# OpenVPN configuration. #
# #
# OpenVPN also supports #
# single-machine <-> single-machine #
# configurations (See the Examples page #
# on the web site for more info). #
# #
# This config should work on Windows #
# or Linux/BSD systems. Remember on #
# Windows to quote pathnames and use #
# double backslashes, e.g.: #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
# #
# Comments are preceded with '#' or ';' #
#################################################
# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d
# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one. You will need to
# open up this port on your firewall.
port 1194
# TCP or UDP server?
;proto tcp
proto udp
# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one. On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap
# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key). Each client
# and the server must have their own cert and
# key file. The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys. Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ./easy-rsa2/keys/ca.crt
cert ./easy-rsa2/keys/server.crt
key ./easy-rsa2/keys/server.key # This file should be kept secret
# Diffie hellman parameters.
# Generate your own with:
# openssl dhparam -out dh2048.pem 2048
dh ./easy-rsa2/keys/dh2048.pem
# Network topology
# Should be subnet (addressing via IP)
# unless Windows clients v2.0.9 and lower have to
# be supported (then net30, i.e. a /30 per client)
# Defaults to net30 (not recommended)
;topology subnet
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0
# Maintain a record of client <-> virtual IP address
# associations in this file. If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge
# Push routes to the client to allow it
# to reach other private subnets behind
# the server. Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
;push "route 192.168.10.0 255.255.255.0"
;push "route 192.168.20.0 255.255.255.0"
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).
# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
# iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN. This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.
# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2
# Suppose that you want to enable different
# firewall access policies for different groups
# of clients. There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
# group, and firewall the TUN/TAP interface
# for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
# modify the firewall in response to access
# from different clients. See man
# page for more info on learn-address script.
;learn-address ./script
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push "dhcp-option DNS 208.67.222.222"
;push "dhcp-option DNS 208.67.220.220"
# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
# openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo
# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100
# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
#user nobody
#group nogroup
user openvpn
group openvpn
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it. Use one
# or the other (but not both).
;log openvpn.log
;log-append openvpn.log
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
# Silence repeating messages. At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20
Wie starte ich openVPN im Vordergrund?
|
tomtomtom
Supporter
Anmeldungsdatum: 22. August 2008
Beiträge: 53484
Wohnort: Berlin
|
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
Hi Wacken ... mal ganz ernsthaft... verrätst Du mir, wie Du bei Deiner Server.conf überblicken willst, was da passiert? 😀 Ich verrate Dir dafür auch was.... Du wirst es nie überblicken 😬 Deswegen mal einen Rat für die Zukunft: Zu allererst KLEIN machen. Ich habe die also mal für Dich klein gemacht und das ist dabei rausgekommen:
port 1194
proto udp
dev tun
ca ./easy-rsa2/keys/ca.crt
cert ./easy-rsa2/keys/server.crt
key ./easy-rsa2/keys/server.key # This file should be kept secret
dh ./easy-rsa2/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
user openvpn
group openvpn
persist-key
persist-tun
status openvpn-status.log
verb 3 Als nächstes habe ich sie ein wenig überarbeitet. Schaus Dir bitte an und stelle auch die Unterschiede fest. Rückfragen kannst Du selber hier beantworten:
http://wiki.openvpn.eu/index.php/OpenVPN-Syntax
port 1194
proto udp
dev tun
comp-lzo
ca ./easy-rsa2/keys/ca.crt
cert ./easy-rsa2/keys/server.crt
key ./easy-rsa2/keys/server.key
dh ./easy-rsa2/keys/dh2048.pem
server 10.8.0.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"
ping-timer-rem
keepalive 20 180
persist-key
persist-tun
user openvpn
group openvpn
verb 3
###### log-append /run/openvpn/openvpn_udp.log
Rausgenommen habe ich erst mal die Static-IP-List - mach es am Anfang erst mal via DHCP. Wenn es läuft, kannst Du es ja wieder ändern. Und rausgeflogen ist der Sekunden-Active-Eintrag ins Log - das geht ja gar nicht, das pflastert dir nur das Logfile voll. Es reicht ne Pid-File-Status-Message... aber dazu später mehr. Zusätzlich drin ist ein Log-File, dass später im Daemon-Mode aktiviert werden sollte. Dann solltest Du noch ändern:
Der Pfad zu den Keys und Certs sollte absolut sein, nicht relativ.... und idealerweise außerhalb der Home-Dirs, wo nur Root einen Zugriff hat. Für den Push-Route musst Du das Netzwerk kontrollieren, ich habe hier 192.168.1/24 eingetragen. Achtung: Das ist das Netzwerk, KEINE Maschine. Ohne gibts für den Road-Warrior keinen Zugang ins stationäre Netzwerk.
wacken schrieb: Wie starte ich openVPN im Vordergrund?
Ganz einfach, so wie man jedes Binary startet ... *lol*... mit Pfad und Programmname....
/usr/local/sbin/openvpn --config /pfad/zur/server_udp.conf Achtung... bei mir ist das /usr/local/sbin, weil ich mir das Binary selber kompiliere. Die Repos sind zu alt. Du musst also vorher herausfinden, wo es bei Dir liegt.
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
So hier die Startausgabe:
xxx@xxx:/etc/openvpn$ sudo openvpn --config server.conf
Tue Nov 22 20:53:31 2016 OpenVPN 2.3.7 i686-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jul 8 2015
Tue Nov 22 20:53:31 2016 library versions: OpenSSL 1.0.2d 9 Jul 2015, LZO 2.08
Tue Nov 22 20:53:31 2016 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Tue Nov 22 20:53:31 2016 Diffie-Hellman initialized with 2048 bit key
Tue Nov 22 20:53:31 2016 Socket Buffers: R=[163840->131072] S=[163840->131072]
Tue Nov 22 20:53:31 2016 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=enp3s0 HWADDR=d0:50:99:59:dc:51
Tue Nov 22 20:53:31 2016 TUN/TAP device tun0 opened
Tue Nov 22 20:53:31 2016 TUN/TAP TX queue length set to 100
Tue Nov 22 20:53:31 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Nov 22 20:53:31 2016 /sbin/ip link set dev tun0 up mtu 1500
Tue Nov 22 20:53:31 2016 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Tue Nov 22 20:53:31 2016 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Tue Nov 22 20:53:31 2016 GID set to openvpn
Tue Nov 22 20:53:31 2016 UID set to openvpn
Tue Nov 22 20:53:31 2016 UDPv4 link local (bound): [undef]
Tue Nov 22 20:53:31 2016 UDPv4 link remote: [undef]
Tue Nov 22 20:53:31 2016 MULTI: multi_init called, r=256 v=256
Tue Nov 22 20:53:31 2016 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Tue Nov 22 20:53:31 2016 IFCONFIG POOL LIST
Tue Nov 22 20:53:31 2016 Initialization Sequence Completed
Wenn ich das hier richtig sehe öffnet er ein TUN-Device. @TomLu: Du hast zeitgleich geantwortet, daher sind die Änderungen der server.conf noch nicht berücksichtigt.
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
Ja, sieht richtig gut aus. Und jetzt lässt Du es erst Mal im Vordergrund und testest den Zugriff von außen. Dazu musst Du natürlich den Port im Router auf den PC weiterleiten, wo der Openvpn-Server läuft, port-forwarding auf dem PC einrichten und im Router eine Route ins VPN-Netz setzen. Wenn das alles klappt, ist (aber erst dann!) der letzte Schritt, den OpenVPN-Server via Service-Unit beim Booten zu starten. Sag bescheid, wenn Du soweit bist 😬 wacken schrieb: Du hast zeitgleich geantwortet, daher sind die Änderungen der server.conf noch nicht berücksichtigt.
Dann empfehle ich Dir, dass noch zu berücksichtigen.
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
So auch mit dem geänderten conf-File wird der Port auf dem Server nicht geöffnet. xxx@xxx:/etc/openvpn$ sudo openvpn --config server.conf
Tue Nov 22 21:45:24 2016 OpenVPN 2.3.7 i686-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jul 8 2015
Tue Nov 22 21:45:24 2016 library versions: OpenSSL 1.0.2d 9 Jul 2015, LZO 2.08
Tue Nov 22 21:45:24 2016 NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
Tue Nov 22 21:45:24 2016 Diffie-Hellman initialized with 2048 bit key
Tue Nov 22 21:45:24 2016 Socket Buffers: R=[163840->131072] S=[163840->131072]
Tue Nov 22 21:45:24 2016 ROUTE_GATEWAY 192.168.1.1/255.255.255.0 IFACE=enp3s0 HWADDR=d0:50:99:59:dc:51
Tue Nov 22 21:45:24 2016 TUN/TAP device tun0 opened
Tue Nov 22 21:45:24 2016 TUN/TAP TX queue length set to 100
Tue Nov 22 21:45:24 2016 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Nov 22 21:45:24 2016 /sbin/ip link set dev tun0 up mtu 1500
Tue Nov 22 21:45:24 2016 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Tue Nov 22 21:45:24 2016 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Tue Nov 22 21:45:24 2016 GID set to openvpn
Tue Nov 22 21:45:24 2016 UID set to openvpn
Tue Nov 22 21:45:24 2016 UDPv4 link local (bound): [undef]
Tue Nov 22 21:45:24 2016 UDPv4 link remote: [undef]
Tue Nov 22 21:45:24 2016 MULTI: multi_init called, r=256 v=256
Tue Nov 22 21:45:24 2016 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Tue Nov 22 21:45:24 2016 Initialization Sequence Completed
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
Ob auf dem Port "gelauscht" wird, siehst Du mit
netstat -tulpn und wie zuvor, ob das tun-device "lebt", siehst Du mit
ip a Zeig mal die Ausgaben... seitens openvpn sieht m.M.n. alles perfekt aus.
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
netstat -tulpn: xxx@xxx:~$ netstat -tulpn
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5938 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5939 0.0.0.0:* LISTEN -
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9665 0.0.0.0:* LISTEN 10520/java
tcp 0 0 127.0.0.1:9666 0.0.0.0:* LISTEN 10520/java
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:33998 0.0.0.0:* LISTEN 10520/java
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN -
tcp6 0 0 :::5938 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 :::443 :::* LISTEN -
tcp6 0 0 :::445 :::* LISTEN -
tcp6 0 0 :::139 :::* LISTEN -
udp 0 0 127.0.1.1:53 0.0.0.0:* -
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 10.8.0.1:123 0.0.0.0:* -
udp 0 0 192.168.1.111:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp 0 0 192.168.1.255:137 0.0.0.0:* -
udp 0 0 192.168.1.111:137 0.0.0.0:* -
udp 0 0 0.0.0.0:137 0.0.0.0:* -
udp 0 0 192.168.1.255:138 0.0.0.0:* -
udp 0 0 192.168.1.111:138 0.0.0.0:* -
udp 0 0 0.0.0.0:138 0.0.0.0:* -
udp 0 0 0.0.0.0:1194 0.0.0.0:* -
udp 0 0 0.0.0.0:7852 0.0.0.0:* -
udp 0 0 0.0.0.0:10000 0.0.0.0:* -
udp6 0 0 :::8082 :::* -
udp6 0 0 fe80::d250:99ff:fe5:123 :::* -
udp6 0 0 ::1:123 :::* -
udp6 0 0 :::123 :::* -
Aufgeführt wird der Port, aber LISTEN steht nicht dahinter. ip a:
xxx@xxx:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether d0:50:99:59:dc:51 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.111/24 brd 192.168.1.255 scope global dynamic enp3s0
valid_lft 717899sec preferred_lft 717899sec
inet6 fe80::d250:99ff:fe59:dc51/64 scope link
valid_lft forever preferred_lft forever
4: 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
|
wacken
(Themenstarter)
Anmeldungsdatum: 7. Juni 2014
Beiträge: 98
|
netstat -ulpn als root: xxx@xxx:~$ sudo -i
7[sudo] password for xxx:
root@xxx:~# netstat -ulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 127.0.1.1:53 0.0.0.0:* 1491/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 11222/dhclient
udp 0 0 192.168.1.111:123 0.0.0.0:* 1685/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 1685/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 1685/ntpd
udp 0 0 192.168.1.255:137 0.0.0.0:* 28636/nmbd
udp 0 0 192.168.1.111:137 0.0.0.0:* 28636/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 28636/nmbd
udp 0 0 192.168.1.255:138 0.0.0.0:* 28636/nmbd
udp 0 0 192.168.1.111:138 0.0.0.0:* 28636/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 28636/nmbd
udp 0 0 0.0.0.0:7852 0.0.0.0:* 11222/dhclient
udp 0 0 0.0.0.0:10000 0.0.0.0:* 1829/perl
udp6 0 0 :::8082 :::* 11222/dhclient
udp6 0 0 fe80::d250:99ff:fe5:123 :::* 1685/ntpd
udp6 0 0 ::1:123 :::* 1685/ntpd
udp6 0 0 :::123 :::* 1685/ntpd
root@xxx:~# TomLu schrieb: Vergiss nicht das portforwarding auf dem PC, sowie die Route und die Portweiterleitung auf dem Router...!... sonst wird das nix mit dem Connect von draußen.
Ich muss das Portforwarding auf dem Server auch noch einstellen? Wenn ja wie. Router ist momentan noch nicht wichtig, ich möchte erstmal von intern verbinden. Mir ist auch klar das es zu IP-Konflikten kommt.
|
TomLu
Anmeldungsdatum: 23. August 2014
Beiträge: 603
|
wacken schrieb: TomLu schrieb: Vergiss nicht das portforwarding auf dem PC, sowie die Route und die Portweiterleitung auf dem Router...!... sonst wird das nix mit dem Connect von draußen.
Ich muss das Portforwarding auf dem Server auch noch einstellen? Wenn ja wie. Router ist momentan noch nicht wichtig, ich möchte erstmal von intern verbinden. Mir ist auch klar das es zu IP-Konflikten kommt.
Entschuldige, ich habe mich 'versprochen'... auf dem Server musst Du IPv4 forwarden. Schau Dir das mal an: http://askubuntu.com/questions/311053/how-to-make-ip-forwarding-permanent. Und soweit ich mich erinnere, funktioniert das vom Handy und via WLAN aus auch innerhalb des LAN. Ich teste das gleich mal. Nachtrag:
Also bei mir geht das auch innerhalb des LANs, das soll heissen, dass der Bildschirm nicht mit Fehlermeldungen zugepflastert wird. Wobei ich den Aussagegehalt aber eher skeptisch sehe. Besser ist es, wenn Du mit dem Client "von außen" reinkommst. Ich teste das immer mit meinem Smartphone als AccessPoint über UMTS.... und zwar Tethering einschalten, meinen Laptop mit dem Handy-AP verbinden und mal eben die WAN-IP abfragen. Wird die UMTS-IP zurückgegeben, läuft es nicht, wird die ISP-IP Deines Routers zurückgegeben, funktionierts. Ich würde zum Testen hier auch erst mal wieder das Gateway redirecten ... das, was Du ja eigentlich nicht möchtest. Aber in der Testphase ist das eigentlich besser. IP ohne viel Traffic zu verbrauchen zeigt: https://wgetip.com/ Alternativ kannst Du natürlich auch versuchen den Router bzw. andere Clients im Netz anzupingen. Mannomann... ist so lange her, dass ich das alles durchgespielt habe. Wenn man es einmal ans Laufen gebracht hat, ist es danach eigentlich immer ein Kinderspiel.
|