Openvpn

Openvpn linux伺服器,可以用linux,不能用windows客戶端

  • March 13, 2018

這是我的openvpn配置

伺服器是linux centos,client1是linux centos,client2是windows10。Linux客戶端能ping通linux伺服器,windows客戶端不能ping通,windows客戶端能ping通linux伺服器,linux客戶端不能ping通 linux客戶端能ping通linux伺服器,windows客戶端不能。我想念什麼?系統日誌上沒有錯誤,我試圖在 Windows 上關閉防火牆但沒有成功。這些是文件conf

伺服器 linux

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1

客戶端linux

client
dev tun
proto udp
remote mysite.fqdn 1194
resolv-retry infinite
nobind
user nobody
group nobody
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
remote-cert-tls server
tls-auth ta.key 1
cipher AES-256-CBC
verb 6

客戶端視窗

client 
proto udp 
verb 3 
dev tun 
remote mysite.fqdn
port 1194 
ca ca.crt
cert windows10.mysite.crt
key windows10.mysite.key
tls-auth ta.key 1
nobind 
persist-key 
persist-tun
cipher AES-256-CBC

找到的解決方案:在伺服器上必須添加

客戶對客戶和其他一些東西

對於 Windows 客戶端(像往常一樣..)

所以 server.conf 是

port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
client-to-client
topology "subnet"
push "topology subnet"
push "route 10.8.0.0 255.255.255.0"

引用自:https://unix.stackexchange.com/questions/430034