Why the bridge and Wi-Fi up in time?

Hello. At the time, I refused from the typical router, because its hardware does not meet requirements. Keep the host PC as the gateway - uncomfortable. Began experimenting with outdated hardware, on Pentium 200, and later on Copermine + pfsense is also. Now it's a full home server-router with built-in "extender", based on i3-3240 and Server Ubuntu 16.04, the core 4.4.0.

I recently changed the Wi-Fi module from Realtek to Atheros AR9485, hoping to get 802.11 n. First delved into why the speed is not set above 65 Mbps. Tried to configure Hostapd, but then I realized that you need to apply the patch.
Put this matter, as I am having problems with the Wi-Fi works in principle.
At the time of system start-up errors that can't raise the bridge, the Wi-Fi module.
For example:
Ubuntu systemd[1]: Found device AR9485 Wireless Network Adapter.
Ubuntu systemd[1]: ifup@wlp4s0.service: Main process exited, code=exited, status=1/FAILURE
Ubuntu kernel: [ 29.192663] br0: port 1(wlp4s0) entered disabled state
Ubuntu systemd[1]: ifup@wlp4s0.service: Unit entered failed state.
Ubuntu systemd[1]: ifup@wlp4s0.service: Failed with result 'exit-code'.
Ubuntu systemd[1]: Started ifup wlp4s0 for.
Ubuntu kernel: [ 29.244138] wlp4s0 device left promiscuous mode
Ubuntu kernel: [ 29.244145] br0: port 1(wlp4s0) entered disabled state
Ubuntu systemd[1]: Stopping ifup wlp4s0 for...
Ubuntu ifdown[1865]: /sbin/ifdown: waiting for lock on /run/network/ifstate.wlp4s0
Ubuntu kernel: [ 29.299556] IPv6: ADDRCONF(NETDEV_UP): wlp4s0: link is not ready
Ubuntu kernel: [ 29.299619] wlp4s0 device entered promiscuous mode
Ubuntu kernel: [ 29.299642] br0: port 1(wlp4s0) entered forwarding state
Ubuntu kernel: [ 29.299648] br0: port 1(wlp4s0) entered forwarding state
Ubuntu systemd[1]: Found device AR9485 Wireless Network Adapter.
Ubuntu systemd[1]: ifup@wlp4s0.service: Main process exited, code=exited, status=1/FAILURE
Ubuntu kernel: [ 29.343484] br0: port 1(wlp4s0) entered disabled state
Ubuntu systemd[1]: ifup@wlp4s0.service: Unit entered failed state.
Ubuntu systemd[1]: ifup@wlp4s0.service: Failed with result 'exit-code'.
Ubuntu systemd[1]: Started ifup wlp4s0 for.
Ubuntu kernel: [ 29.396125] wlp4s0 device left promiscuous mode
Ubuntu kernel: [ 29.396132] br0: port 1(wlp4s0) entered disabled state
Ubuntu systemd[1]: Stopping ifup wlp4s0 for...
Ubuntu ifdown[2035]: /sbin/ifdown: waiting for lock on /run/network/ifstate.wlp4s0
Ubuntu kernel: [ 29.447609] IPv6: ADDRCONF(NETDEV_UP): wlp4s0: link is not ready
Ubuntu kernel: [ 29.447673] wlp4s0 device entered promiscuous mode
Ubuntu kernel: [ 29.447696] br0: port 1(wlp4s0) entered forwarding state
Ubuntu kernel: [ 29.447700] br0: port 1(wlp4s0) entered forwarding state
Ubuntu systemd[1]: Found device AR9485 Wireless Network Adapter.
Ubuntu systemd[1]: ifup@wlp4s0.service: Main process exited, code=exited, status=1/FAILURE
Ubuntu kernel: [ 29.491748] br0: port 1(wlp4s0) entered disabled state
Ubuntu systemd[1]: ifup@wlp4s0.service: Unit entered failed state.
Ubuntu systemd[1]: ifup@wlp4s0.service: Failed with result 'exit-code'.
Ubuntu systemd[1]: ifup@wlp4s0.service: Start request repeated too quickly.
Ubuntu systemd[1]: Failed to start ifup wlp4s0 for.
Ubuntu systemd[1]: ifup@wlp4s0.service: Failed with result 'start-limit-hit'.

Raise Network Interfaces

Ubuntu kernel: [ 57.464391] wlp4s0 device left promiscuous mode
Ubuntu kernel: [ 57.464398] br0: port 1(wlp4s0) entered disabled state
Ubuntu kernel: [ 57.516975] IPv6: ADDRCONF(NETDEV_UP): wlp4s0: link is not ready
Ubuntu kernel: [ 57.517071] wlp4s0 device entered promiscuous mode
Ubuntu kernel: [ 57.517095] br0: port 1(wlp4s0) entered forwarding state
Ubuntu kernel: [ 57.517099] br0: port 1(wlp4s0) entered forwarding state
Ubuntu kernel: [ 57.517139] br0: port 1(wlp4s0) entered disabled state
Ubuntu ifup[1171]: Waiting for br0 to get ready (MAXWAIT is 32 seconds).
Ubuntu systemd[1]: Started ifup wlp4s0 for.
Ubuntu sh[2461]: ifup: interface wlp4s0 already configured
Ubuntu systemd[1]: Found device AR9485 Wireless Network Adapter.
Ubuntu ifup[1171]: RTNETLINK answers: File exists
Ubuntu ifup[1171]: Failed to bring up br0.
Ubuntu systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Ubuntu systemd[1]: Failed to start Raise network interfaces.
Ubuntu systemd[1]: networking.service: Unit entered failed state.
Ubuntu systemd[1]: networking.service: Failed with result 'exit-code'.
Ubuntu systemd[1]: Reached target Network.

After the download is complete, the wifi works, the network interfaces are raised, but not distributed online and are not issued IP addresses.
Config network:
source /etc/network/interfaces.d/*

# The loopback network interface
iface lo inet loopback
auto lo

# The primary network interface
allow-hotplug enp2s0
enp2s0 iface inet dhcp
auto enp2s0

enp3s0 iface inet manual
auto enp3s0

wlp4s0 iface inet manual
pre-up iw dev wlp4s0 del
pre-up iw phy phy0 interface add wlp4s0 type __ap
auto wlp4s0

iface br0 inet static
 address 192.168.1.1
 network 192.168.0.0
 netmask 255.255.0.0
 broadcast 192.168.255.255
 bridge_ports enp3s0 wlp4s0
 dns-nameservers 127.0.0.1
 pre-up iptables-restore < /etc/iptables.up.rules
 up route add -net 0.0.0.0 netmask 0.0.0.0 gw 109.226.203.222
auto br0

Hostapd

interface=wlp4s0
bridge=br0
driver=nl80211
hw_mode=g
ieee80211n=1
wmm_enabled=1
channel=6
ieee80211d=1
ht_capab=[HT40-][SHORT-GI-40][RX-STBC1][DSSS_CCK-40][SHORT-GI-20]
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=0
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=Ubuntu
country_code=RU
auth_algs=1
eapol_key_index_workaround=0
eap_server=0
wpa=3
wpa_passphrase=**********
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

Please share the experience. I did not set up and why after 2-3 restarts it works, according to the configuration?
April 19th 20 at 12:39
0 answer

Find more questions by tags UbuntuNetwork equipmentComputer networksLinux