我正在尝试使用 Raspberry Pi 设置自己的 VPN,但在启动期间出现以下错误:Failed OpenVPN Connection to Server
我正在使用最新的 Raspbian 并遵循本教程:http://www.bbc.co.uk/news/technology-33548728
我的静态 IP 是 192.168.1.8,路由器的 IP 是 192.168.1.1。我尝试使用 wlan0 执行此操作。
我的/etc/openvpn/server.conf
文件内容如下:
local 192,168.1.8 #RASP PI Static Ip Address
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/#MYSERVER#.crt #Server name
key /etc/openvpn/easy-rsa/keys/#MYSERVER#.key #Server Name
dh /etc/openvpn/easy-rsa/keys/dh1024.pem #If you chose 2048 change it here
server 10.8.00 255.255.255.0
#server and remote endpoints
ifconfig -a
显示:
eth0 Link encap:Ethernet HWaddr b8:27:eb:f9:61:05
inet6 addr: fe80::f933:3ab8:d352:8bad/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:204 errors:0 dropped:0 overruns:0 frame:0
TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:16896 (16.5 KiB) TX bytes:16896 (16.5 KiB)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:ac:34:50
inet addr:192.168.1.8 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:feac:3450/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:544 errors:0 dropped:191 overruns:0 frame:0
TX packets:295 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:116710 (113.9 KiB) TX bytes:44995 (43.9 KiB)
ps aux | grep openvpn
显示:
root 1069 0.0 0.2 4276 2004 pts/0 S+ 21:58 0:00 grep openvpn
nano /etc/network/interfaces 读取:
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet static
address [192.168.1.8]
netmask [255.255.255.0]
network [192.168.1.0]
broadcast [192.168.1.255]
gateway [192.168.1.1]
# pre-up /etc/firewall-openvpn-rules.sh
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
我不确定/var/log/openvpn
此时如何显示内容。
答案1
您的第一行似乎是错误的,IP 中的一个逗号而不是 .。
local 192,168.1.8 #RASP PI Static Ip Address
应该有可能
local 192.168.1.8 #RASP PI Static Ip Address
另外,要监视日志文件,请尝试使用 tail(在 shell 提示符中):
tail -f /var/log/openvpn
并使用ctrl+c退出。
答案2
解决了!我通过删除以下行解决了这个问题:
local 192,168.1.8 #RASP PI Static Ip Address
来自我的/etc/openvpn/server.conf
档案