我有一台CentOS 6.64位的机器,我在上面安装了OpenVPN。
我想让OpenVPN内部建立一个虚拟专用网来取代QuickVPN(这是可怕的,脆弱的,随机将工作在Windows8.x上,甚至不再支持思科)。
在OpenVPN连接时,我无法访问互联网。我有以下可依地的规则集:
iptables -t -nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE我连接到192.168.2.6
另外,是否有一种方法可以将OpenVPN设置为在192.168.2.10上使用我的DHCP/DNS服务器?
SERVER.CONF:
cat /etc/openvpn/server.conf
port 1194 #- port
proto udp #- protocol
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
reneg-sec 0
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login #- Comment this line if you are using FreeRADIUS
#plugin /etc/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnf #- Uncomment this line if you are using FreeRADIUS
client-cert-not-required
username-as-common-name
server 192.168.2.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 192.168.2.10"
push "dhcp-option DNS 8.8.8.8"
push "route 0.0.0.0 255.255.255.255 192.168.2.254"
keepalive 5 30
comp-lzo
persist-key
persist-tun
status 1194.log
verb 3发布于 2014-01-21 03:13:23
你不需要一座桥,再加上一座桥,你需要水龙头的支持。
尝试将其设置为与网络匹配,而不是0.0.0.0。
例如推“路线192.168.0.0 255.255.255.0”
检查您的iptables规则,我使用这个(192.168.150.0是我的VPN子网)
-I输入1 -p udp --dport 1194 -j -j接受
-I转发1-源192.168.150.0/24 -j接受
https://serverfault.com/questions/568543
复制相似问题