![openvpn --config client.ovpn 失败:RTNETLINK 答案:文件存在](https://linux22.com/image/1000647/openvpn%20--config%20client.ovpn%20%E5%A4%B1%E8%B4%A5%EF%BC%9ARTNETLINK%20%E7%AD%94%E6%A1%88%EF%BC%9A%E6%96%87%E4%BB%B6%E5%AD%98%E5%9C%A8.png)
我在 Ubuntu 16.04 Mate 上
sudo openvpn --config 客户端.ovpn
结果
初始化序列已完成
有错误
Tue May 30 23:54:41 2017 /sbin/ip link set dev tun0 up mtu 1500
Tue May 30 23:54:41 2017 /sbin/ip addr add dev tun0 10.10.10.3/24 broadcast 10.10.10.255
Tue May 30 23:54:45 2017 /sbin/ip route add 188.93.88.146/32 via 192.168.0.1
Tue May 30 23:54:45 2017 /sbin/ip route add 10.1.1.0/24 via 10.10.10.1
Tue May 30 23:54:45 2017 /sbin/ip route add 10.1.1.1/32 via 10.10.10.1
Tue May 30 23:54:45 2017 /sbin/ip route add 10.1.1.2/32 via 10.10.10.1
Tue May 30 23:54:45 2017 /sbin/ip route add 10.1.1.1/32 via 10.10.10.1
RTNETLINK answers: File exists
Tue May 30 23:54:45 2017 ERROR: Linux route add command failed: external program exited with error status: 2
Tue May 30 23:54:45 2017 /sbin/ip route add 188.93.88.146/32 via 192.168.0.1
RTNETLINK answers: File exists
Tue May 30 23:54:45 2017 ERROR: Linux route add command failed: external program exited with error status: 2
Tue May 30 23:54:45 2017 Initialization Sequence Completed
/etc/network/interfaces
好像
auto lo
iface lo inet loopback
$ ip link show
结果
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp8s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 34:64:a9:bf:10:da brd ff:ff:ff:ff:ff:ff
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether 10:08:b1:1f:3c:77 brd ff:ff:ff:ff:ff:ff
$ route
结果
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 600 0 0 wlo1
link-local * 255.255.0.0 U 1000 0 0 wlo1
192.168.0.0 * 255.255.255.0 U 600 0 0 wlo1
我努力了
$ sudo ip addr flush dev wlo1
$ sudo ip addr flush dev enp8s0
并重新启动,但使用 openvpn 连接时仍然出现错误
答案1
我已从文件route remote_host 255.255.255.255 net_gateway
中删除client.ovpn
答案2
/sbin/ip route add 10.1.1.1/32 via 10.10.10.1
和/sbin/ip route add 188.93.88.146/32 via 192.168.0.1
都在前几行执行,导致错误File Exists
。删除这些重复项将解决您的问题(我相信)。