OPENVPN PSK: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 45: Zeile 45:
 
*vi /etc/openvpn/server.conf
 
*vi /etc/openvpn/server.conf
 
<pre>
 
<pre>
 +
local 203.0.113.5
 
dev tun
 
dev tun
 
ifconfig 10.9.0.1 10.9.0.2
 
ifconfig 10.9.0.1 10.9.0.2
Zeile 52: Zeile 53:
 
VPN Client
 
VPN Client
 
</pre>
 
</pre>
 +
 
=Openvpn config on hubsi (client)=
 
=Openvpn config on hubsi (client)=
 
*vi /etc/openvpn/client.conf
 
*vi /etc/openvpn/client.conf

Version vom 24. Oktober 2019, 10:29 Uhr

Layout

-192.168.33.1/24 -|garlic|-10.82.1.211---------------------10.82.1.195-|hubsi|-192.168.55.1/24

Interfaces

garlic

auto ens18
iface ens18 inet static
 address 10.82.1.211
 netmask 255.255.0.0
 gateway 10.82.0.1

auto dummy0
iface dummy0 inet static
 address 192.168.33.1
 netmask 255.255.255.0
 pre-up ip link add dummy0 type dummy

hubsi

auto ens18
iface ens18 inet static
 address 10.82.1.195
 netmask 255.255.0.0
 gateway 10.82.0.1

auto dummy0
iface dummy0 inet static
 address 192.168.55.1
 netmask 255.255.255.0
 pre-up ip link add dummy0 type dummy

Ipfordward on

  • cat /etc/sysctl.conf
net.ipv4.ip_forward=1
  • sysctl -p

Openvpn

Install

  • sudo apt-get install openvpn

Generatre PSK on garlic

  • cd /etc/openvpn/
  • openvpn --genkey --secret static.key

Copy to hubsi

  • scp static.key hubsi:$PWD

Openvpn config on garlic (server)

  • vi /etc/openvpn/server.conf
local 203.0.113.5
dev tun
ifconfig 10.9.0.1 10.9.0.2
secret static.key
#proto tcp-server
keepalive 10 120
VPN Client

Openvpn config on hubsi (client)

  • vi /etc/openvpn/client.conf
remote 203.0.113.5
dev tun
ifconfig 10.9.0.2 10.9.0.1
secret static.key
route 192.168.255.0 255.255.255.0
#proto tcp-client
keepalive 10 120