Set metric for wlan0 network in XUBUNTU

I need to set the metric 0 for the wlan network

$   ifconfig   wlp2s0 .... 

if I use the command:

sudo ifmetric wlp2s0 1 

Everything works until the system reboots.

already tried to configure the file: /etc/network/interfaces

auto wlp2s0 iface wlp2s0 inet dhcp   metric 0 

failed, when the system starts the network wlp2s0 is disabled.

How can I make this permanent?

I need to leave the wireless (wlp2s0) network with priority 0.

19.04 NetworkManager bombing /var/log/syslog when wlan0 disconnected

I just noticed that when my internal wireless card is not connected to a wireless network, NetworkManager bombs my syslog with repeated logs like this…

May  1 17:16:44 Satellite-E55 NetworkManager[1289]: <info>  [1556756204.5912] device (wlan0): supplicant interface state: scanning -> disconnected May  1 17:16:44 Satellite-E55 NetworkManager[1289]: <info>  [1556756204.5913] device (p2p-dev-wlan0): supplicant management interface state: scanning -> disconnected May  1 17:16:44 Satellite-E55 NetworkManager[1289]: <info>  [1556756204.7670] device (wlan0): supplicant interface state: disconnected -> scanning May  1 17:16:44 Satellite-E55 NetworkManager[1289]: <info>  [1556756204.7671] device (p2p-dev-wlan0): supplicant management interface state: disconnected -> scanning 

Here’s an abbreviated sudo lshw -C network

 *-network        description: Wireless interface        product: Wireless 7260        vendor: Intel Corporation        physical id: 0        bus info: pci@0000:03:00.0        logical name: wlan0        version: 6b        serial: 5c:51:4f:a6:e2:99        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless        configuration: broadcast=yes driver=iwlwifi driverversion=5.0.0-13-generic firmware=17.3216344376.0 latency=0 link=no multicast=yes wireless=IEEE 802.11        resources: irq:44 memory:f7c00000-f7c01fff 

Once the wireless card is connected to a wireless network, the syslog bombing ceases.

Any idea where to start looking for a fix for this?

aircrack-ng issue: No mon0 when run “airmon-ng start wlan0” and “No such BSSID available”

I have read many threads on StackExchange and some other blogs but none helped me. The issue is with aircrack-ng on Kali Linux. It gives me error No such BSSID available when I run aireply-ng. I think it is because of not having mon0 when I run airmon-ng.

root@kali:~# uname -a Linux kali 4.19.0-kali1-amd64 #1 SMP Debian 4.19.13-1kali1 (2019-01-03) x86_64 GNU/Linux 

I have updated the driver of usb wifi adaptor; RTL8812AU and it is the output of iwconfig.

root@kali:~# iwconfig eth0      no wireless extensions.  lo        no wireless extensions.  wlan0     IEEE 802.11  Mode:Monitor  Frequency:2.422 GHz  Tx-Power=18 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:off 

I think it needs to show the name of the adapter in the monitor mode, something like mon0 or wlanmon0 but it shows only 3 or some other numbers.

root@kali:~# airmon-ng start wlan0  PHY Interface   Driver      Chipset  phy0    wlan0       88XXau      Realtek Semiconductor Corp. RTL8812AU 802.11a/b/g/n/ac WLAN Adapter          (mac80211 monitor mode already enabled for [phy0]wlan0 on [phy0]3) 

I have read on some blogs that it does not really matter if there is no mon0; but it doesn’t work at all and just give me the following error, No such BSSID available.

root@kali:~# aireplay-ng --deauth 100 -a MAC_OF_AP -c MAC_OF_TARGET wlan0 16:56:02  Waiting for beacon frame (BSSID: MAC_OF_AP) on channel 3 16:56:12  No such BSSID available. 

P.S. – I have tested it on Windows 10 and Ubuntu 18.10 hosts as well as Kali 2019 and ParrotSec. Both have the same issue.