Odp: OpenWrt 18.06.1 i OpenVPN
Witam,
Panowie chciałbym się podłączyć pod temat, od wczoraj zabrałem się za konfigurację OpenVPN po swojej stronie.
Konfigi serwera to:
root@GATE:~# cat /etc/config/openvpn
config openvpn 'custom_config'
option enabled '0'
option config '/etc/openvpn/my-vpn.conf'
config openvpn 'home'
option enabled '1'
option dev 'tun0'
option port '1194'
option proto 'udp'
option log '/var/log/openvpn.log'
option verb '3'
option ca '/etc/openvpn/ca.crt'
option cert '/etc/openvpn/serwer.crt'
option key '/etc/openvpn/serwer.key'
option server '10.8.0.0 255.255.255.0'
option dh '/etc/openvpn/dh.pem'
list push 'route 172.16.10.0 255.255.255.128'
list push 'redirect-gateway def1'
list push 'route 172.16.10.0 255.255.255.128'
#list route '172.16.10.0 255.255.255.128'
mam pytanie czy config client też muszę mieć po stronie serwera ? Chyba nie.
Moja sieć LAN to 172.16.10.0/25
Openvpn się łączy no i nie mogę spingować routera czyli 172.16.10.1, ani wersji na interfejsie tun0 czyli 10.8.0.1
Na firewallu mam:
config zone
option name 'vpn'
option input 'ACCEPT'
option forward 'ACCEPT'
option output 'ACCEPT'
option network 'vpn'
option masq '1'
config forwarding
option src 'lan'
option dest 'wan'
config zone
option name 'vpn'
option input 'ACCEPT'
option forward 'ACCEPT'
option output 'ACCEPT'
option network 'vpn'
po stronie serwera openvpn.log:
root@GATE:~# cat /var/log/openvpn.log
Mon Jun 17 19:10:34 2019 OpenVPN 2.4.5 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD]
Mon Jun 17 19:10:34 2019 library versions: OpenSSL 1.0.2r 26 Feb 2019, LZO 2.10
Mon Jun 17 19:10:34 2019 WARNING: --keepalive option is missing from server config
Mon Jun 17 19:10:35 2019 Diffie-Hellman initialized with 2048 bit key
Mon Jun 17 19:10:35 2019 TUN/TAP device tun0 opened
Mon Jun 17 19:10:35 2019 TUN/TAP TX queue length set to 100
Mon Jun 17 19:10:35 2019 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Jun 17 19:10:35 2019 /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Mon Jun 17 19:10:35 2019 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
Mon Jun 17 19:10:35 2019 Could not determine IPv4/IPv6 protocol. Using AF_INET
Mon Jun 17 19:10:35 2019 Socket Buffers: R=[163840->163840] S=[163840->163840]
Mon Jun 17 19:10:35 2019 UDPv4 link local (bound): [AF_INET][undef]:1194
Mon Jun 17 19:10:35 2019 UDPv4 link remote: [AF_UNSPEC]
Mon Jun 17 19:10:35 2019 MULTI: multi_init called, r=256 v=256
Mon Jun 17 19:10:35 2019 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Mon Jun 17 19:10:35 2019 Initialization Sequence Completed
Mon Jun 17 19:36:07 2019 31.0.68.104:8429 TLS: Initial packet from [AF_INET]31.0.68.104:8429, sid=8f3b04e5 d4efc41d
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 VERIFY OK: depth=1, CN=dominbdg.servebeer.com
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 VERIFY OK: depth=0, CN=dominik
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 peer info: IV_VER=2.3.11
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 peer info: IV_PLAT=win
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 peer info: IV_PROTO=2
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 peer info: IV_GUI_VER=OpenVPN_GUI_10
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 Outgoing Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Jun 17 19:36:08 2019 31.0.68.104:8429 [dominik] Peer Connection Initiated with [AF_INET]31.0.68.104:8429
Mon Jun 17 19:36:08 2019 dominik/31.0.68.104:8429 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Mon Jun 17 19:36:08 2019 dominik/31.0.68.104:8429 MULTI: Learn: 10.8.0.6 -> dominik/31.0.68.104:8429
Mon Jun 17 19:36:08 2019 dominik/31.0.68.104:8429 MULTI: primary virtual IP for dominik/31.0.68.104:8429: 10.8.0.6
Mon Jun 17 19:36:10 2019 dominik/31.0.68.104:8429 PUSH: Received control message: 'PUSH_REQUEST'
Mon Jun 17 19:36:10 2019 dominik/31.0.68.104:8429 SENT CONTROL [dominik]: 'PUSH_REPLY,route 172.16.10.0 255.255.255.128,redirect-gateway def1,route 172.16.10.0 255.255.255.128,route 10.8.0.1,topology net30,ifconfig 10.8.0.6 10.8.0.5,peer-id 0' (status=1)
Mon Jun 17 19:36:57 2019 172.16.10.5:1194 TLS: Initial packet from [AF_INET]172.16.10.5:1194, sid=a8f4b9f7 95c998fd
Mon Jun 17 19:37:13 2019 dominik/31.0.68.104:8429 TLS: new session incoming connection from [AF_INET]31.0.68.104:8429
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 VERIFY OK: depth=1, CN=dominbdg.servebeer.com
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 VERIFY OK: depth=0, CN=dominik
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 peer info: IV_VER=2.3.11
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 peer info: IV_PLAT=win
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 peer info: IV_PROTO=2
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 peer info: IV_GUI_VER=OpenVPN_GUI_10
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 Outgoing Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 TLS: move_session: dest=TM_ACTIVE src=TM_UNTRUSTED reinit_src=1
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 TLS: tls_multi_process: untrusted session promoted to trusted
Mon Jun 17 19:37:14 2019 dominik/31.0.68.104:8429 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Jun 17 19:37:16 2019 dominik/31.0.68.104:8429 PUSH: Received control message: 'PUSH_REQUEST'
Mon Jun 17 19:37:16 2019 dominik/31.0.68.104:8429 SENT CONTROL [dominik]: 'PUSH_REPLY,route 172.16.10.0 255.255.255.128,redirect-gateway def1,route 172.16.10.0 255.255.255.128,route 10.8.0.1,topology net30,ifconfig 10.8.0.6 10.8.0.5,peer-id 0' (status=1)
Mon Jun 17 19:37:57 2019 172.16.10.5:1194 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Mon Jun 17 19:37:57 2019 172.16.10.5:1194 TLS Error: TLS handshake failed
Mon Jun 17 19:37:57 2019 172.16.10.5:1194 SIGUSR1[soft,tls-error] received, client-instance restarting
Mon Jun 17 19:40:36 2019 31.0.68.104:8396 TLS: Initial packet from [AF_INET]31.0.68.104:8396, sid=951fca5a 38cd8dc5
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 VERIFY OK: depth=1, CN=dominbdg.servebeer.com
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 VERIFY OK: depth=0, CN=dominik
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 peer info: IV_VER=2.3.11
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 peer info: IV_PLAT=win
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 peer info: IV_PROTO=2
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 peer info: IV_GUI_VER=OpenVPN_GUI_10
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 Outgoing Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Jun 17 19:40:37 2019 31.0.68.104:8396 [dominik] Peer Connection Initiated with [AF_INET]31.0.68.104:8396
Mon Jun 17 19:40:37 2019 MULTI: new connection by client 'dominik' will cause previous active sessions by this client to be dropped. Remember to use the --duplicate-cn option if you want multiple clients using the same certificate or username to concurrently connect.
Mon Jun 17 19:40:37 2019 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Mon Jun 17 19:40:37 2019 MULTI: Learn: 10.8.0.6 -> dominik/31.0.68.104:8396
Mon Jun 17 19:40:37 2019 MULTI: primary virtual IP for dominik/31.0.68.104:8396: 10.8.0.6
Mon Jun 17 19:40:39 2019 dominik/31.0.68.104:8396 PUSH: Received control message: 'PUSH_REQUEST'
Mon Jun 17 19:40:39 2019 dominik/31.0.68.104:8396 SENT CONTROL [dominik]: 'PUSH_REPLY,route 172.16.10.0 255.255.255.128,redirect-gateway def1,route 172.16.10.0 255.255.255.128,route 10.8.0.1,topology net30,ifconfig 10.8.0.6 10.8.0.5,peer-id 1' (status=1)
Mon Jun 17 19:42:46 2019 172.16.10.5:1194 TLS: Initial packet from [AF_INET]172.16.10.5:1194, sid=65814fac 4d9dd110
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 TLS: Initial packet from [AF_INET]31.0.68.104:8425, sid=65814fac 4d9dd110
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 VERIFY OK: depth=1, CN=dominbdg.servebeer.com
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 VERIFY OK: depth=0, CN=dominik
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 peer info: IV_VER=2.3.11
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 peer info: IV_PLAT=win
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 peer info: IV_PROTO=2
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 peer info: IV_GUI_VER=OpenVPN_GUI_10
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 Outgoing Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 WARNING: INSECURE cipher with block size less than 128 bit (64 bit). This allows attacks like SWEET32. Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Mon Jun 17 19:43:17 2019 31.0.68.104:8425 [dominik] Peer Connection Initiated with [AF_INET]31.0.68.104:8425
Mon Jun 17 19:43:17 2019 MULTI: new connection by client 'dominik' will cause previous active sessions by this client to be dropped. Remember to use the --duplicate-cn option if you want multiple clients using the same certificate or username to concurrently connect.
Mon Jun 17 19:43:17 2019 MULTI_sva: pool returned IPv4=10.8.0.6, IPv6=(Not enabled)
Mon Jun 17 19:43:17 2019 MULTI: Learn: 10.8.0.6 -> dominik/31.0.68.104:8425
Mon Jun 17 19:43:17 2019 MULTI: primary virtual IP for dominik/31.0.68.104:8425: 10.8.0.6
Mon Jun 17 19:43:20 2019 dominik/31.0.68.104:8425 PUSH: Received control message: 'PUSH_REQUEST'
Mon Jun 17 19:43:20 2019 dominik/31.0.68.104:8425 SENT CONTROL [dominik]: 'PUSH_REPLY,route 172.16.10.0 255.255.255.128,redirect-gateway def1,route 172.16.10.0 255.255.255.128,route 10.8.0.1,topology net30,ifconfig 10.8.0.6 10.8.0.5,peer-id 2' (status=1)
Mon Jun 17 19:43:46 2019 172.16.10.5:1194 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Mon Jun 17 19:43:46 2019 172.16.10.5:1194 TLS Error: TLS handshake failed
Mon Jun 17 19:43:46 2019 172.16.10.5:1194 SIGUSR1[soft,tls-error] received, client-instance restarting
chciałbym przez openvpn'a dostać się do maszyn wewnątrz sieci LAN, dlatego w configu openvpn'a jest redirect,
na razie przez vpn nie mogę się dostać nawet do routera.