OpenVPN 和 wlan0 无法很好地配合

OpenVPN 和 wlan0 无法很好地配合

我已经使用 /etc/network/interfaces 设置了 WIFI 连接,效果非常好。

udooer@udooneo:~$ cat /etc/network/interfaces
# Loopback network interface
auto lo
iface lo inet loopback

# Primary network interface
#auto eth0
#iface eth0 inet dhcp

allow-hotplug usb0
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.252

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
    dns-nameservers 8.8.8.8 
### Add a line like this for every Wifi network defined in the wpa_supplicant.conf file
iface home inet dhcp
iface work inet dhcp
iface iphone inet dhcp

问题是,当我启动我的设备时(我的 OpenVPN 客户端也在启动,我看到我的 wlan0 连接不断地断开和连接。)。就好像我的 OpenVPN 和 wlan0 连接在争吵。如果我不启动 OpenVPN 客户端,WIFI 就可以正常连接,不会断开连接。

这是我在 syslog 中看到的内容(不断地重复,直到我关闭 openvpn 服务):

Dec 18 22:33:31 localhost ntpdate[1320]: step time server 85.88.55.5 offset 30407602.944281 sec
Dec 18 22:33:32 localhost ntpd[1893]: ntpd [email protected] Wed Nov 11 18:05:09 UTC 2015 (1)
Dec 18 22:33:32 localhost ntpd[1894]: proto: precision = 0.666 usec
Dec 18 22:33:32 localhost ntpd[1894]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Dec 18 22:33:32 localhost ntpd[1894]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen and drop on 1 v6wildcard :: UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen normally on 2 lo 127.0.0.1 UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen normally on 3 usb0 192.168.7.2 UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen normally on 4 lo ::1 UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen normally on 5 usb0 fe80::4c71:9eff:fe8c:405b UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: Listen normally on 6 wlan0 fe80::7eec:79ff:fecb:3f01 UDP 123
Dec 18 22:33:32 localhost ntpd[1894]: peers refreshed
Dec 18 22:33:32 localhost ntpd[1894]: Listening on routing socket on fd #23 for interface updates
Dec 18 22:33:32 localhost ntpd[1894]: Deferring DNS for 0.ubuntu.pool.ntp.org 1
Jan  1 00:00:08 localhost ovpn-client[1375]: message repeated 3 times: [ write UDPv4: Network is unreachable (code=101)]
Dec 18 22:33:33 localhost ovpn-client[1375]: [UNDEF] Inactivity timeout (--ping-restart), restarting
Dec 18 22:33:33 localhost ovpn-client[1375]: SIGUSR1[soft,ping-restart] received, process restarting
Dec 18 22:33:33 localhost ovpn-client[1375]: Restart pause, 2 second(s)
Dec 18 22:33:34 localhost ntpd[1894]: Deferring DNS for 1.ubuntu.pool.ntp.org 1
Dec 18 22:33:34 localhost ntpd[1894]: Deferring DNS for 2.ubuntu.pool.ntp.org 1
Dec 18 22:33:34 localhost ntpd[1894]: Deferring DNS for 3.ubuntu.pool.ntp.org 1
Dec 18 22:33:34 localhost ntpd[1894]: Deferring DNS for ntp.ubuntu.com 1
Dec 18 22:33:34 localhost ntpd[1897]: signal_no_reset: signal 17 had flags 4000000
Dec 18 22:33:34 localhost avahi-daemon[577]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:34 localhost avahi-daemon[577]: New relevant interface wlan0.IPv4 for mDNS.
Dec 18 22:33:34 localhost avahi-daemon[577]: Registering new address record for 192.168.1.117 on wlan0.IPv4.
Dec 18 22:33:35 localhost dhclient: bound to 192.168.1.117 -- renewal in -30374924 seconds.
Dec 18 22:33:35 localhost ovpn-client[1375]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Dec 18 22:33:35 localhost ovpn-client[1375]: Socket Buffers: R=[163840->131072] S=[163840->131072]
Dec 18 22:33:35 localhost ovpn-client[1375]: UDPv4 link local: [undef]
Dec 18 22:33:35 localhost ovpn-client[1375]: UDPv4 link remote: [AF_INET]52.91.25.92:1194
Dec 18 22:33:35 localhost ovpn-client[1375]: TLS: Initial packet from [AF_INET]52.91.25.92:1194, sid=42da4f6c 9301d3d6
Dec 18 22:33:35 localhost ntpd[1894]: ntpd exiting on signal 15
Dec 18 22:33:35 localhost avahi-daemon[577]: Withdrawing address record for 192.168.1.117 on wlan0.
Dec 18 22:33:35 localhost avahi-daemon[577]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:35 localhost avahi-daemon[577]: Interface wlan0.IPv4 no longer relevant for mDNS.
Dec 18 22:33:36 localhost dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0x6bf80137)
Dec 18 22:33:36 localhost ntpd_intres[1897]: parent died before we finished, exiting
Dec 18 22:33:37 localhost wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Dec 18 22:33:37 localhost wpa_action: bssid=00:25:9c:4d:18:36
Dec 18 22:33:37 localhost wpa_action: ssid=MYWIFI
Dec 18 22:33:37 localhost wpa_action: id=0
Dec 18 22:33:37 localhost wpa_action: id_str=home
Dec 18 22:33:37 localhost wpa_action: mode=station
Dec 18 22:33:37 localhost wpa_action: pairwise_cipher=CCMP
Dec 18 22:33:37 localhost wpa_action: group_cipher=CCMP
Dec 18 22:33:37 localhost wpa_action: key_mgmt=WPA2-PSK
Dec 18 22:33:37 localhost wpa_action: wpa_state=COMPLETED
Dec 18 22:33:37 localhost wpa_action: p2p_device_address=7c:ec:79:cb:3f:01
Dec 18 22:33:37 localhost wpa_action: address=7c:ec:79:cb:3f:01
Dec 18 22:33:37 localhost wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
Dec 18 22:33:37 localhost wpa_action: WPA_ID=0 WPA_ID_STR=home WPA_CTRL_DIR=/var/run/wpa_supplicant
Dec 18 22:33:37 localhost wpa_action: ifdown wlan0
Dec 18 22:33:37 localhost dhclient: DHCPREQUEST of 192.168.1.117 on wlan0 to 255.255.255.255 port 67 (xid=0x3701f86b)
Dec 18 22:33:37 localhost dhclient: DHCPOFFER of 192.168.1.117 from 192.168.1.1
Dec 18 22:33:37 localhost dhclient: DHCPACK of 192.168.1.117 from 192.168.1.1
Dec 18 22:33:37 localhost dhclient: Internet Systems Consortium DHCP Client 4.2.4
Dec 18 22:33:37 localhost dhclient: Copyright 2004-2012 Internet Systems Consortium.
Dec 18 22:33:37 localhost dhclient: All rights reserved.
Dec 18 22:33:37 localhost dhclient: For info, please visit https://www.isc.org/software/dhcp/
Dec 18 22:33:37 localhost dhclient: 
Dec 18 22:33:37 localhost avahi-daemon[577]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:37 localhost avahi-daemon[577]: New relevant interface wlan0.IPv4 for mDNS.
Dec 18 22:33:37 localhost avahi-daemon[577]: Registering new address record for 192.168.1.117 on wlan0.IPv4.
Dec 18 22:33:37 localhost dhclient: Listening on LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:37 localhost dhclient: Sending on   LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:37 localhost dhclient: Sending on   Socket/fallback
Dec 18 22:33:37 localhost dhclient: DHCPRELEASE on wlan0 to 192.168.1.1 port 67 (xid=0x102f0b30)
Dec 18 22:33:38 localhost avahi-daemon[577]: Withdrawing address record for 192.168.1.117 on wlan0.
Dec 18 22:33:38 localhost avahi-daemon[577]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:38 localhost avahi-daemon[577]: Interface wlan0.IPv4 no longer relevant for mDNS.
Dec 18 22:33:38 localhost kernel: [   40.889995] wlan0: deauthenticating from 00:25:9c:4d:18:36 by local choice (Reason: 3=DEAUTH_LEAVING)
Dec 18 22:33:38 localhost kernel: [   40.929706] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
Dec 18 22:33:38 localhost kernel: [   40.929723] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
Dec 18 22:33:38 localhost kernel: [   40.929733] wlan0: moving STA 00:25:9c:4d:18:36 to state 1
Dec 18 22:33:38 localhost kernel: [   40.929741] wlan0: Removed STA 00:25:9c:4d:18:36
Dec 18 22:33:38 localhost kernel: [   40.930384] wlan0: Destroyed STA 00:25:9c:4d:18:36
Dec 18 22:33:38 localhost wpa_supplicant[815]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:25:9c:4d:18:36 reason=3
Dec 18 22:33:38 localhost avahi-daemon[577]: Interface wlan0.IPv6 no longer relevant for mDNS.
Dec 18 22:33:38 localhost avahi-daemon[577]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::7eec:79ff:fecb:3f01.
Dec 18 22:33:38 localhost kernel: [   40.952029] wlcore: down
Dec 18 22:33:38 localhost avahi-daemon[577]: Withdrawing address record for fe80::7eec:79ff:fecb:3f01 on wlan0.
Dec 18 22:33:38 localhost kernel: [   40.960826] cfg80211: All devices are disconnected, going to restore regulatory settings
Dec 18 22:33:38 localhost kernel: [   40.960844] cfg80211: Restoring regulatory settings
Dec 18 22:33:38 localhost kernel: [   40.960856] cfg80211: Kicking the queue
Dec 18 22:33:38 localhost kernel: [   40.960877] cfg80211: Calling CRDA to update world regulatory domain
Dec 18 22:33:38 localhost kernel: [   41.016867] cfg80211: Updating information on frequency 2412 MHz with regulatory rule:
Dec 18 22:33:38 localhost kernel: [   41.016883] cfg80211: 2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
Dec 18 22:33:38 localhost wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Dec 18 22:33:38 localhost dbus[512]: [system] Activating service name='org.freedesktop.UPower' (using servicehelper)
Dec 18 22:33:39 localhost kernel: [   41.917136] wlcore: PHY firmware version: Rev 8.2.0.0.232
Dec 18 22:33:39 localhost kernel: [   42.050647] wlcore: firmware booted (Rev 8.9.0.0.48)
Dec 18 22:33:39 localhost kernel: [   42.121592] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Dec 18 22:33:39 localhost dbus[512]: [system] Successfully activated service 'org.freedesktop.UPower'
Dec 18 22:33:39 localhost wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
Dec 18 22:33:39 localhost wpa_action: WPA_ID=0 WPA_ID_STR=home WPA_CTRL_DIR=/var/run/wpa_supplicant
Dec 18 22:33:39 localhost wpa_action: ifup wlan0=home
Dec 18 22:33:40 localhost dbus[512]: [system] Activating service name='org.freedesktop.UDisks2' (using servicehelper)
Dec 18 22:33:40 localhost wpa_supplicant[815]: wlan0: SME: Trying to authenticate with 00:25:9c:4d:18:36 (SSID='MYWIFI' freq=2462 MHz)
Dec 18 22:33:40 localhost kernel: [   42.785934] wlan0: authenticate with 00:25:9c:4d:18:36
Dec 18 22:33:40 localhost kernel: [   42.785957] wlan0: Allocated STA 00:25:9c:4d:18:36
Dec 18 22:33:40 localhost kernel: [   42.794503] wlan0: Inserted STA 00:25:9c:4d:18:36
Dec 18 22:33:40 localhost kernel: [   42.794523] wlan0: send auth to 00:25:9c:4d:18:36 (try 1/3)
Dec 18 22:33:40 localhost wpa_supplicant[815]: wlan0: Trying to associate with 00:25:9c:4d:18:36 (SSID='MYWIFI' freq=2462 MHz)
Dec 18 22:33:40 localhost kernel: [   42.807552] wlan0: authenticated
Dec 18 22:33:40 localhost kernel: [   42.807572] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
Dec 18 22:33:40 localhost kernel: [   42.809465] wlan0: associate with 00:25:9c:4d:18:36 (try 1/3)
Dec 18 22:33:40 localhost kernel: [   42.813732] wlan0: RX AssocResp from 00:25:9c:4d:18:36 (capab=0x411 status=0 aid=2)
Dec 18 22:33:40 localhost kernel: [   42.813758] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
Dec 18 22:33:40 localhost kernel: [   42.837965] wlan0: associated
Dec 18 22:33:40 localhost kernel: [   42.838003] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Dec 18 22:33:40 localhost wpa_supplicant[815]: wlan0: Associated with 00:25:9c:4d:18:36
Dec 18 22:33:40 localhost dhclient: Internet Systems Consortium DHCP Client 4.2.4
Dec 18 22:33:40 localhost dhclient: Copyright 2004-2012 Internet Systems Consortium.
Dec 18 22:33:40 localhost kernel: [   42.849274] wlan0: dropped frame to 00:25:9c:4d:18:36 (unauthorized port)
Dec 18 22:33:40 localhost dhclient: All rights reserved.
Dec 18 22:33:40 localhost dhclient: For info, please visit https://www.isc.org/software/dhcp/
Dec 18 22:33:40 localhost dhclient: 
Dec 18 22:33:40 localhost wpa_supplicant[815]: wlan0: WPA: Key negotiation completed with 00:25:9c:4d:18:36 [PTK=CCMP GTK=CCMP]
Dec 18 22:33:40 localhost wpa_supplicant[815]: wlan0: CTRL-EVENT-CONNECTED - Connection to 00:25:9c:4d:18:36 completed (reauth) [id=0 id_str=home]
Dec 18 22:33:40 localhost kernel: [   42.882667] wlan0: moving STA 00:25:9c:4d:18:36 to state 4
Dec 18 22:33:40 localhost kernel: [   42.887484] wlcore: Association completed.
Dec 18 22:33:40 localhost udisksd[2320]: udisks daemon version 2.1.3 starting
Dec 18 22:33:40 localhost dhclient: Listening on LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:40 localhost dhclient: Sending on   LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:40 localhost dhclient: Sending on   Socket/fallback
Dec 18 22:33:40 localhost dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0xab408b06)
Dec 18 22:33:40 localhost ntpdate[2067]: Can't find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:40 localhost ntpdate[2067]: Can't find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:40 localhost ntpdate[2067]: Can't find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:40 localhost ntpdate[2067]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Dec 18 22:33:40 localhost ntpdate[2067]: sendto(193.104.37.238): Success
Dec 18 22:33:40 localhost dbus[512]: [system] Successfully activated service 'org.freedesktop.UDisks2'
Dec 18 22:33:41 localhost udisksd[2320]: Acquired the name org.freedesktop.UDisks2 on the system message bus
Dec 18 22:33:41 localhost ntpdate[2067]: sendto(193.190.253.212): Success
Dec 18 22:33:41 localhost ntpdate[2067]: sendto(85.88.55.5): Success
Dec 18 22:33:41 localhost avahi-daemon[577]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::7eec:79ff:fecb:3f01.
Dec 18 22:33:41 localhost avahi-daemon[577]: New relevant interface wlan0.IPv6 for mDNS.
Dec 18 22:33:41 localhost avahi-daemon[577]: Registering new address record for fe80::7eec:79ff:fecb:3f01 on wlan0.*.
Dec 18 22:33:42 localhost NetworkManager[1024]: <info> Unmanaged Device found; state CONNECTED forced. (see http://bugs.launchpad.net/bugs/191889)
Dec 18 22:33:42 localhost ntpdate[2067]: sendto(193.104.37.238): Success
Dec 18 22:33:43 localhost ntpdate[2067]: sendto(193.190.253.212): Success
Dec 18 22:33:43 localhost ntpdate[2067]: sendto(85.88.55.5): Success
Dec 18 22:33:43 localhost dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8 (xid=0xab408b06)
Dec 18 22:33:44 localhost dhclient: DHCPREQUEST of 192.168.1.117 on wlan0 to 255.255.255.255 port 67 (xid=0x68b40ab)
Dec 18 22:33:44 localhost dhclient: DHCPOFFER of 192.168.1.117 from 192.168.1.1
Dec 18 22:33:44 localhost dhclient: DHCPACK of 192.168.1.117 from 192.168.1.1
Dec 18 22:33:44 localhost ntpdate[2067]: sendto(193.104.37.238): Success
Dec 18 22:33:44 localhost avahi-daemon[577]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:44 localhost avahi-daemon[577]: New relevant interface wlan0.IPv4 for mDNS.
Dec 18 22:33:44 localhost avahi-daemon[577]: Registering new address record for 192.168.1.117 on wlan0.IPv4.
Dec 18 22:33:45 localhost dhclient: bound to 192.168.1.117 -- renewal in 42573 seconds.
Dec 18 22:33:47 localhost wpa_action: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Dec 18 22:33:47 localhost wpa_action: bssid=00:25:9c:4d:18:36
Dec 18 22:33:47 localhost wpa_action: ssid=MYWIFI
Dec 18 22:33:47 localhost wpa_action: id=0
Dec 18 22:33:47 localhost wpa_action: id_str=home
Dec 18 22:33:47 localhost wpa_action: mode=station
Dec 18 22:33:47 localhost wpa_action: pairwise_cipher=CCMP
Dec 18 22:33:47 localhost wpa_action: group_cipher=CCMP
Dec 18 22:33:47 localhost wpa_action: key_mgmt=WPA2-PSK
Dec 18 22:33:47 localhost wpa_action: wpa_state=COMPLETED
Dec 18 22:33:47 localhost wpa_action: ip_address=192.168.1.117
Dec 18 22:33:47 localhost wpa_action: p2p_device_address=7c:ec:79:cb:3f:01
Dec 18 22:33:47 localhost wpa_action: address=7c:ec:79:cb:3f:01
Dec 18 22:33:47 localhost wpa_action: WPA_IFACE=wlan0 WPA_ACTION=DISCONNECTED
Dec 18 22:33:47 localhost wpa_action: WPA_ID=0 WPA_ID_STR=home WPA_CTRL_DIR=/var/run/wpa_supplicant
Dec 18 22:33:47 localhost wpa_action: ifdown wlan0
Dec 18 22:33:47 localhost ntpdate[2067]: adjust time server 193.190.253.212 offset 0.001129 sec
Dec 18 22:33:47 localhost dhclient: 
Dec 18 22:33:47 localhost dhclient: Listening on LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:47 localhost dhclient: Sending on   LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:47 localhost dhclient: Sending on   Socket/fallback
Dec 18 22:33:47 localhost dhclient: DHCPRELEASE on wlan0 to 192.168.1.1 port 67 (xid=0x6b12994)
Dec 18 22:33:47 localhost ntpd[2559]: ntpd [email protected] Wed Nov 11 18:05:09 UTC 2015 (1)
Dec 18 22:33:47 localhost ntpd[2560]: proto: precision = 0.666 usec
Dec 18 22:33:47 localhost ntpd[2560]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Dec 18 22:33:47 localhost ntpd[2560]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen and drop on 1 v6wildcard :: UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 2 lo 127.0.0.1 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 3 wlan0 192.168.1.117 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 4 usb0 192.168.7.2 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 5 lo ::1 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 6 usb0 fe80::4c71:9eff:fe8c:405b UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: Listen normally on 7 wlan0 fe80::7eec:79ff:fecb:3f01 UDP 123
Dec 18 22:33:47 localhost ntpd[2560]: peers refreshed
Dec 18 22:33:47 localhost ntpd[2560]: Listening on routing socket on fd #24 for interface updates
Dec 18 22:33:48 localhost avahi-daemon[577]: Withdrawing address record for 192.168.1.117 on wlan0.
Dec 18 22:33:48 localhost avahi-daemon[577]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.117.
Dec 18 22:33:48 localhost avahi-daemon[577]: Interface wlan0.IPv4 no longer relevant for mDNS.
Dec 18 22:33:48 localhost kernel: [   50.954532] wlan0: deauthenticating from 00:25:9c:4d:18:36 by local choice (Reason: 3=DEAUTH_LEAVING)
Dec 18 22:33:48 localhost wpa_supplicant[815]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:25:9c:4d:18:36 reason=3
Dec 18 22:33:48 localhost kernel: [   50.989766] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
Dec 18 22:33:48 localhost kernel: [   50.989786] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
Dec 18 22:33:48 localhost kernel: [   50.989796] wlan0: moving STA 00:25:9c:4d:18:36 to state 1
Dec 18 22:33:48 localhost kernel: [   50.989806] wlan0: Removed STA 00:25:9c:4d:18:36
Dec 18 22:33:48 localhost kernel: [   50.990182] wlan0: Destroyed STA 00:25:9c:4d:18:36
Dec 18 22:33:48 localhost kernel: [   50.996900] wlcore: down
Dec 18 22:33:48 localhost avahi-daemon[577]: Interface wlan0.IPv6 no longer relevant for mDNS.
Dec 18 22:33:48 localhost avahi-daemon[577]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::7eec:79ff:fecb:3f01.
Dec 18 22:33:48 localhost avahi-daemon[577]: Withdrawing address record for fe80::7eec:79ff:fecb:3f01 on wlan0.
Dec 18 22:33:48 localhost kernel: [   51.003580] cfg80211: All devices are disconnected, going to restore regulatory settings
Dec 18 22:33:48 localhost kernel: [   51.003598] cfg80211: Restoring regulatory settings
Dec 18 22:33:48 localhost kernel: [   51.003609] cfg80211: Kicking the queue
Dec 18 22:33:48 localhost kernel: [   51.003629] cfg80211: Calling CRDA to update world regulatory domain
Dec 18 22:33:48 localhost kernel: [   51.033463] cfg80211: Updating information on frequency 2412 MHz with regulatory rule:
Dec 18 22:33:48 localhost wpa_action: removing sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
Dec 18 22:33:48 localhost kernel: [   51.689265] wlcore: PHY firmware version: Rev 8.2.0.0.232
Dec 18 22:33:48 localhost kernel: [   51.732232] wlcore: firmware booted (Rev 8.9.0.0.48)
Dec 18 22:33:48 localhost kernel: [   51.751504] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Dec 18 22:33:49 localhost wpa_action: WPA_IFACE=wlan0 WPA_ACTION=CONNECTED
Dec 18 22:33:49 localhost wpa_action: WPA_ID=0 WPA_ID_STR=home WPA_CTRL_DIR=/var/run/wpa_supplicant
Dec 18 22:33:49 localhost wpa_action: ifup wlan0=home
Dec 18 22:33:49 localhost dhclient: Internet Systems Consortium DHCP Client 4.2.4
Dec 18 22:33:49 localhost dhclient: Copyright 2004-2012 Internet Systems Consortium.
Dec 18 22:33:49 localhost dhclient: All rights reserved.
Dec 18 22:33:49 localhost dhclient: For info, please visit https://www.isc.org/software/dhcp/
Dec 18 22:33:49 localhost dhclient: 
Dec 18 22:33:49 localhost dhclient: Listening on LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:49 localhost dhclient: Sending on   LPF/wlan0/7c:ec:79:cb:3f:01
Dec 18 22:33:49 localhost dhclient: Sending on   Socket/fallback
Dec 18 22:33:49 localhost dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3 (xid=0x59b31d7e)
Dec 18 22:33:49 localhost wpa_supplicant[815]: wlan0: SME: Trying to authenticate with 00:25:9c:4d:18:36 (SSID='MYWIFI' freq=2462 MHz)
Dec 18 22:33:49 localhost kernel: [   52.422467] wlan0: authenticate with 00:25:9c:4d:18:36
Dec 18 22:33:49 localhost kernel: [   52.422491] wlan0: Allocated STA 00:25:9c:4d:18:36
Dec 18 22:33:49 localhost kernel: [   52.425806] wlan0: Inserted STA 00:25:9c:4d:18:36
Dec 18 22:33:49 localhost kernel: [   52.425824] wlan0: send auth to 00:25:9c:4d:18:36 (try 1/3)
Dec 18 22:33:49 localhost wpa_supplicant[815]: wlan0: Trying to associate with 00:25:9c:4d:18:36 (SSID='MYWIFI' freq=2462 MHz)
Dec 18 22:33:49 localhost kernel: [   52.443755] wlan0: authenticated
Dec 18 22:33:49 localhost kernel: [   52.443778] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
Dec 18 22:33:49 localhost kernel: [   52.448691] wlan0: associate with 00:25:9c:4d:18:36 (try 1/3)
Dec 18 22:33:49 localhost kernel: [   52.452972] wlan0: RX AssocResp from 00:25:9c:4d:18:36 (capab=0x411 status=0 aid=2)
Dec 18 22:33:49 localhost kernel: [   52.453001] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
Dec 18 22:33:49 localhost wpa_supplicant[815]: wlan0: Associated with 00:25:9c:4d:18:36
Dec 18 22:33:49 localhost kernel: [   52.460902] wlan0: associated
Dec 18 22:33:49 localhost kernel: [   52.460938] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Dec 18 22:33:49 localhost kernel: [   52.478579] wlan0: dropped frame to 00:25:9c:4d:18:36 (unauthorized port)
Dec 18 22:33:49 localhost wpa_supplicant[815]: wlan0: WPA: Key negotiation completed with 00:25:9c:4d:18:36 [PTK=CCMP GTK=CCMP]
Dec 18 22:33:49 localhost wpa_supplicant[815]: wlan0: CTRL-EVENT-CONNECTED - Connection to 00:25:9c:4d:18:36 completed (reauth) [id=0 id_str=home]
Dec 18 22:33:49 localhost kernel: [   52.492755] wlan0: moving STA 00:25:9c:4d:18:36 to state 4
Dec 18 22:33:49 localhost kernel: [   52.493101] wlcore: Association completed.
Dec 18 22:33:50 localhost avahi-daemon[577]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::7eec:79ff:fecb:3f01.
Dec 18 22:33:50 localhost avahi-daemon[577]: New relevant interface wlan0.IPv6 for mDNS.
Dec 18 22:33:50 localhost avahi-daemon[577]: Registering new address record for fe80::7eec:79ff:fecb:3f01 on wlan0.*.
Dec 18 22:33:51 localhost ntpd[2560]: ntpd exiting on signal 15
Dec 18 22:33:51 localhost ntpdate[2689]: Can't find host 0.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:51 localhost ntpdate[2689]: Can't find host 1.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:51 localhost ntpdate[2689]: Can't find host 2.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:51 localhost ntpdate[2689]: Can't find host 3.ubuntu.pool.ntp.org: Name or service not known (-2)
Dec 18 22:33:51 localhost ntpdate[2689]: Can't find host ntp.ubuntu.com: Name or service not known (-2)
Dec 18 22:33:51 localhost ntpdate[2689]: no servers can be used, exiting
Dec 18 22:33:51 localhost ntpd[2720]: ntpd [email protected] Wed Nov 11 18:05:09 UTC 2015 (1)
Dec 18 22:33:51 localhost ntpd[2721]: proto: precision = 0.667 usec
Dec 18 22:33:51 localhost ntpd[2721]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Dec 18 22:33:51 localhost ntpd[2721]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen and drop on 1 v6wildcard :: UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen normally on 2 lo 127.0.0.1 UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen normally on 3 usb0 192.168.7.2 UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen normally on 4 lo ::1 UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen normally on 5 usb0 fe80::4c71:9eff:fe8c:405b UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: Listen normally on 6 wlan0 fe80::7eec:79ff:fecb:3f01 UDP 123
Dec 18 22:33:51 localhost ntpd[2721]: peers refreshed
Dec 18 22:33:51 localhost ntpd[2721]: Listening on routing socket on fd #23 for interface updates
Dec 18 22:33:51 localhost ntpd[2721]: Deferring DNS for 0.ubuntu.pool.ntp.org 1
Dec 18 22:33:51 localhost ntpd[2721]: Deferring DNS for 1.ubuntu.pool.ntp.org 1
Dec 18 22:33:51 localhost ntpd[2721]: Deferring DNS for 2.ubuntu.pool.ntp.org 1
Dec 18 22:33:51 localhost ntpd[2721]: Deferring DNS for 3.ubuntu.pool.ntp.org 1
Dec 18 22:33:51 localhost ntpd[2721]: Deferring DNS for ntp.ubuntu.com 1
Dec 18 22:33:51 localhost ntpd[2725]: signal_no_reset: signal 17 had flags 4000000
Dec 18 22:33:51 localhost ntpd[2721]: ntpd exiting on signal 15

dmeg 输出(过滤 wlan0)

[  737.984415] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  738.003029] wlan0: dropped frame to 00:25:9c:4d:18:36 (unauthorized port)
[  738.027517] wlan0: moving STA 00:25:9c:4d:18:36 to state 4
[  742.690201] wlan0: deauthenticating from 00:25:9c:4d:18:36 by local choice (Reason: 3=DEAUTH_LEAVING)
[  742.714889] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
[  742.714906] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
[  742.714916] wlan0: moving STA 00:25:9c:4d:18:36 to state 1
[  742.714925] wlan0: Removed STA 00:25:9c:4d:18:36
[  742.715405] wlan0: Destroyed STA 00:25:9c:4d:18:36
[  743.359582] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  744.014634] wlan0: authenticate with 00:25:9c:4d:18:36
[  744.014676] wlan0: Allocated STA 00:25:9c:4d:18:36
[  744.020416] wlan0: Inserted STA 00:25:9c:4d:18:36
[  744.020453] wlan0: send auth to 00:25:9c:4d:18:36 (try 1/3)
[  744.042476] wlan0: authenticated
[  744.042515] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
[  744.045329] wlan0: associate with 00:25:9c:4d:18:36 (try 1/3)
[  744.049740] wlan0: RX AssocResp from 00:25:9c:4d:18:36 (capab=0x411 status=0 aid=2)
[  744.049787] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
[  744.067155] wlan0: associated
[  744.067218] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  744.085215] wlan0: dropped frame to 00:25:9c:4d:18:36 (unauthorized port)
[  744.106893] wlan0: moving STA 00:25:9c:4d:18:36 to state 4
[  749.441918] wlan0: deauthenticating from 00:25:9c:4d:18:36 by local choice (Reason: 3=DEAUTH_LEAVING)
[  749.478623] wlan0: moving STA 00:25:9c:4d:18:36 to state 3
[  749.478660] wlan0: moving STA 00:25:9c:4d:18:36 to state 2
[  749.478684] wlan0: moving STA 00:25:9c:4d:18:36 to state 1
[  749.478704] wlan0: Removed STA 00:25:9c:4d:18:36
[  749.480041] wlan0: Destroyed STA 00:25:9c:4d:18:36

如果我更换

iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

配置完成后wpa-conf,我的 OpenVPN 客户端启动正常,WIFI 连接也很稳定。但问题是wpa-conf,当 WIFI 连接断开时(通常发生在约 12 小时后),它不会再自动重新连接。

通过 wlan0 设置 OpenVPN 客户端的最佳方法是什么,同时保持 WIFI 连接稳定,并允许其在 WIFI 连接断开时重新连接。

相关内容