没有互联网访问的 OpenVPN

没有互联网访问的 OpenVPN

我正在使用 OpenVPN 并且能够连接,但是无法再访问互联网。

这是我的 IP 表:

sshadmin@mdpi1:/etc/openvpn/easy-rsa/keys$ netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         my.live.ip.adr  0.0.0.0         UG        0 0          0 eth0
my.live.ip.adr  0.0.0.0         255.255.255.224 U         0 0          0 eth0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.10.0.0       0.0.0.0         255.255.255.0   U         0 0          0 eth1

以下是服务器配置:

### General config
dev tun
proto udp
port 1194
client-to-client

### Certificates
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key
dh /etc/openvpn/easy-rsa/keys/dh2048.pem

### User permissions
user nobody
group nogroup

### VPN network subnet
server 10.8.0.0 255.255.255.0

### Varia
keepalive 10 120
persist-key
persist-tun

### Logging
status /var/log/openvpn-status.log
verb 3
log-append /var/log/openvpn

### Push network config (default gateway and DNS server)
push "redirect-gateway local def1"
push "dhcp-option DNS 10.8.0.1"

### User authentication settings
plugin /usr/lib/openvpn/openvpn-plugin-auth-pam.so login
client-cert-not-required
username-as-common-name

### Management interface
management localhost 7505

知道为什么会有这个问题吗?

谢谢。

答案1

我可以通过编辑推送网络配置并绕过 dhcp 来解决问题:

### Push network config (default gateway and DNS server)
push "route 10.0.0.0 255.0.0.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.0.0.2"
push "dhcp-option DNS 10.1.0.2"

相关内容