I know there are a lot of posts about this issue but none of the ones I have seen are quite the same as the issue I am having. Sorry if I have missed some.
I am running Ubuntu 18.04.
I have an internet connection but no access to internet whether on ethernet or wifi. It is the same with a few different routers/connections. I get an Ip address and dns details from the router but no connection after.
When trying to connect to a webpage for example it just tries for a long time then eventually times out. I have tried pinging to 8.8.8.8 and it seems to work a couple of times (literally 2 pings will get through then nothing) then stops working, then if I turn the wifi on and off again it will ping a couple more times then again stop. Same with dhclient, if I run it in terminal at the point just after wifi is enabled or an ethernet cable is attached it connects just long enough to bind to an IP then nothing, it won't rebind.
I have checked to see if there is a physical wifi/airplane mode kill switch and I can see using rfkill
that there is nothing blocking the connection, as I said above it does connect.
Interestingly when I booted in recovery mode I managed to get a connection but only temporarily, by turning on and off wifi repeatedly. In that time of having a connection I managed to check for updates, and broken/ missing packages and install all the updates but that didn't help. Weirdly when I tried again I couldn't repeat this in recovery mode. I have also tried booting in an older version of linux from grub but that also made no difference.
I thought it might be something to do with a firewall so I have checked and ufw states it is disabled. I also completely removed (with the purge option) my vpn (nord) just in case that was affecting it but still nothing. Nord uses openvpn as a backend which I have also completely removed. Nord implements its own "kill switch" option which stops any connection to the internet (after connection) until the vpn is connected and I'm not sure how it is implemented. I wonder if this kill switch option is the issue. Before removing nord I tried setting this to disabled but it made no difference.
When running:
sudo rfkill list && lspci -knn | grep Net && sudo lshw -C network
I get
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
grep: et: No such file or directory
sudo rfkill list && lspci -knn | grep Net && sudo lshw -C network
? Please copy the results, then come back here, click edit and add the results into your question. Please don't answer with Add Comment; as it loses formatting.