OpenVPN에 연결되어 있지만 인터넷에 연결되어 있지 않거나 클라이언트 간 연결이 없습니다.

OpenVPN에 연결되어 있지만 인터넷에 연결되어 있지 않거나 클라이언트 간 연결이 없습니다.

방금 IP 192.168.1.2인 라즈베리 파이 v3에 다음 설정을 설치했습니다.

  1. 먼저 PiHole을 설치했습니다.
  2. 그런 다음 PiVPN을 설치했습니다
  3. 한 가지 조정 사항 /etc/openvpn/server.conf: 기존 항목을 주석 처리 dhcp-options하고 추가했습니다. PiHole_IP는 push "dhcp-option DNS 192.168.1.2"어디에 있습니까?192.168.1.2
  4. 내 휴대폰에 대한 인증서 하나를 만들었습니다.

휴대폰에서 VPN에 연결할 수 있지만 웹사이트를 열려고 하면 아무런 응답도 받지 못합니다. LAN에서 클라이언트를 찾으려고 해도 응답이 없습니다.

다음은 내 휴대폰의 개방형 VPN 앱에서 가져온 로그입니다.

2018-02-10 14:02:41 1

2018-02-10 14:02:41 ----- OpenVPN Start -----
OpenVPN core 3.2 ios arm64 64-bit PT_PROXY built on Oct  3 2018 06:35:04

2018-02-10 14:02:41 Frame=512/2048/512 mssfix-ctrl=1250

2018-02-10 14:02:41 UNUSED OPTIONS
4 [resolv-retry] [infinite] 
5 [nobind] 
6 [persist-key] 
7 [persist-tun] 
10 [verify-x509-name] [server_HASH] [name] 
14 [verb] [3] 

2018-02-10 14:02:41 EVENT: RESOLVE

2018-02-10 14:02:41 Contacting [MY_EXTERNAL_IP]:1194/UDP via UDP

2018-02-10 14:02:41 EVENT: WAIT

2018-02-10 14:02:41 Connecting to [MY_DNS_NAME]:1194 (MY_EXTERNAL_IP) via UDPv4

2018-02-10 14:02:41 EVENT: CONNECTING

2018-02-10 14:02:41 Tunnel Options:V4,dev-type tun,link-mtu 1570,tun-mtu 1500,proto UDPv4,comp-lzo,cipher AES-256-CBC,auth SHA256,keysize 256,key-method 2,tls-client

2018-02-10 14:02:41 Creds: UsernameEmpty/PasswordEmpty

2018-02-10 14:02:41 Peer Info:
IV_GUI_VER=net.openvpn.connect.ios 3.0.2-894
IV_VER=3.2
IV_PLAT=ios
IV_NCP=2
IV_TCPNL=1
IV_PROTO=2
IV_LZO_STUB=1
IV_COMP_STUB=1
IV_COMP_STUBv2=1
IV_AUTO_SESS=1


2018-02-10 14:02:42 VERIFY OK : depth=1
cert. version     : 3
serial number     : A7:A9:F2:46:05:5B:BD:D8
issuer name       : CN=ChangeMe
subject name      : CN=ChangeMe
issued  on        : 2018-10-10 16:04:51
expires on        : 2028-10-07 16:04:51
signed using      : RSA with SHA-256
RSA key size      : 4096 bits
basic constraints : CA=true
key usage         : Key Cert Sign, CRL Sign


2018-02-10 14:02:42 VERIFY OK : depth=0
cert. version     : 3
serial number     : 01
issuer name       : CN=ChangeMe
subject name      : CN=server_HASH
issued  on        : 2018-10-10 16:05:10
expires on        : 2028-10-07 16:05:10
signed using      : RSA with SHA-256
RSA key size      : 4096 bits
basic constraints : CA=false
key usage         : Digital Signature, Key Encipherment
ext key usage     : TLS Web Server Authentication


2018-02-10 14:02:42 SSL Handshake: TLSv1.2/TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384

2018-02-10 14:02:42 Session is ACTIVE

2018-02-10 14:02:42 EVENT: GET_CONFIG

2018-02-10 14:02:42 Sending PUSH_REQUEST to server...

2018-02-10 14:02:42 OPTIONS:
0 [dhcp-option] [DNS] [192.168.1.2] 
1 [block-outside-dns] 
2 [redirect-gateway] [def1] 
3 [route-gateway] [10.8.0.1] 
4 [topology] [subnet] 
5 [ping] [1800] 
6 [ping-restart] [3600] 
7 [ifconfig] [10.8.0.2] [255.255.255.0] 
8 [peer-id] [0] 
9 [cipher] [AES-256-GCM] 


2018-02-10 14:02:42 PROTOCOL OPTIONS:
  cipher: AES-256-GCM
  digest: SHA256
  compress: COMP_STUB
  peer ID: 0

2018-02-10 14:02:42 EVENT: ASSIGN_IP

2018-02-10 14:02:42 NIP: preparing TUN network settings

2018-02-10 14:02:42 NIP: init TUN network settings with endpoint: MY_EXTERNAL_IP

2018-02-10 14:02:42 NIP: adding IPv4 address to network settings 10.8.0.2/255.255.255.0

2018-02-10 14:02:42 NIP: adding (included) IPv4 route 10.8.0.0/24

2018-02-10 14:02:42 NIP: redirecting all IPv4 traffic to TUN interface

2018-02-10 14:02:42 NIP: adding DNS 192.168.1.2

2018-02-10 14:02:42 Connected via NetworkExtensionTUN

2018-02-10 14:02:42 LZO-ASYM init swap=0 asym=1

2018-02-10 14:02:42 Comp-stub init swap=1

2018-02-10 14:02:42 EVENT: CONNECTED MY_DNS_NAME.com:1194 (MY_EXTERNAL_IP) via /UDPv4 on NetworkExtensionTUN/10.8.0.2/ gw=[/]

이것은 server.conf위에서 설명한 대로 dhcp-options를 추가/제거하여 약간 수정한 것입니다.

dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/server_HASH.crt
key /etc/openvpn/easy-rsa/pki/private/server_HASH.key
dh none
ecdh-curve secp384r1
topology subnet
server 10.8.0.0 255.255.255.0
# Set your primary domain name server address for clients
#push "dhcp-option DNS 1.1.1.1"
#push "dhcp-option DNS 1.0.0.1"
push "dhcp-option DNS 192.168.1.2"
# Prevent DNS leaks on Windows
push "block-outside-dns"
# Override the Client default gateway by using 0.0.0.0/1 and
# 128.0.0.0/1 rather than 0.0.0.0/0. This has the benefit of
# overriding but not wiping out the original default gateway.
push "redirect-gateway def1"
client-to-client
keepalive 1800 3600
remote-cert-tls client
tls-version-min 1.2
tls-crypt /etc/openvpn/easy-rsa/pki/ta.key
cipher AES-256-CBC
auth SHA256
compress lz4
user nobody
group nogroup
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
#DuplicateCNs allow access control on a less-granular, per user basis.
#Remove # if you will manage access by user instead of device. 
#duplicate-cn
# Generated for use by PiVPN.io

또한 PiHole이 차단되지 않는 IP 10.0.8.2로부터 요청을 받고 있는 것을 볼 수 있습니다. 문제 해결을 어디서부터 시작해야 할지 잘 모르겠고 힌트와 지침을 기대하고 있습니다 :-)

답변1

기본 Google DNS 서버를 제거하는 것 외에도"dhcp-옵션 DNS 192.168.1.2"를 푸시하세요.~에server.conf, 이미 수행한 작업을 수행하려면 다음을 수행하십시오.

  • 예를 들어 이동하여 /etc/dnsmasq.d새 파일을 만듭니다.custom.conf( sudo nano custom.conf), 다음 내용을 포함:

    listen-address=127.0.0.1, 192.168.1.2, 10.8.0.1
    

    어디192.168.1.2Pi-hole DNS의 주소이며10.8.0.1PiVPN 게이트웨이입니다.

    이렇게 하면 Pi-hole이 업데이트되면 다른 conf 파일의 변경 사항을 덮어쓰지 않게 됩니다.

  • 다음을 실행하여 OpenVPN 서비스를 다시 시작하세요.

    sudo service openvpn restart
    

이제 클라이언트에서 PiVPN에 연결하면 인터넷에 액세스할 수 있어야 하며 Pi-hole은 모든 광고를 필터링해야 합니다.

관련 정보