Not being able to connect to a 40 MHz Wifi Channel is not a problem on the Linux side per se in this case. WiFi is a complex protocol, and even more down to the definition of the protocol and particular bits of how to is implemented by different vendors.
As we can see from the output of your commands, you are using Cisco equipment and the client is in the 2....
The problem is with the firmware of the chipset I am using. The vendor has disabled the channel bonding in the configuration. Once I enabled it I can connect it to the 40 Mhz Channel.
The Qualcomm chipset requires the gChannelBondingMode24GHz variable to be set as one in the configuration file
As you have connection to your router, your routes are properly configured, and you have no internet connection to outside of the LAN - then the problem should lie within the router and its internet connection/configuration, not yours. It is also not a problem with DNS, as you're pinging simple IP addresses.
What can I try to get a working internet ...
I do not know of any ready-made tool that can be used for your purpose, but you could build one yourself.
The necessary tools and programs are available on Raspbian.
Luckily, wpa-supplicant allows for interactive control of scanning for networks and manually connecting to networks.
To be specific you can either use the program wpa_cli or use the wpa_ctrl ...
As an alternate answer you could sign the drivers with the MOK Key
The full write up is here
This way you can keep secure boot enabled!
Writing up the basis of it all from downloading the repo to finish would look like this:
(Note I signed more modules then I probably needed to. I'm not sure which ones govern what except rtl8822be was my driver so I ...
After a fresh install of Linux Mint my wifi was not working duo to a missing driver Realtek RTL8822BE.
To install I had to follow these steps:
sudo apt install build-essential git
git clone -b extended https://github.com/lwfinger/rtlwifi_new.git
sudo make install
sudo modprobe rtl8822be
Note that I am cloning the extended branch ...