No internet for Kodi

Hi friends,

As the title says, I got no internet for Kodi unless I edit all the time after reboot the file called resolv.conf in /etc adding the line “nameserver 8.8.8.8”.

The Pi has internet connection all the time as I can ssh into it, but Kodi won’t work unless I run sudo sh -c 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf after each time I reboot my Pi.

I tried to make this command as a script and use it as a service so it can automatically run each time my pi boots up but without any luck.

If anyone can help me with a solution for this, it would be appreciate it.

My router automatically assigns a DNS server to every client through DHCP.

If you do not want to use DHCP you need to manually enter a DNS server in “My OSMC --> Network”
Does that not work for you? If that does not work you probably need to upload logs so someone can troubleshoot the problem.

1 Like

Having a IP address is not the same thing as having an internet connection. It sounds like you have an issue with either

a) you set a static ip address in OSMC but did not give it a valid DNS server.

b) you left OSMC on its default DHCP settings but there is a problem with your router such that it is not giving out a valid DNS address.

I can SSH into my Pi from a different network. I have two ISP’s in my apartment as I need two internet connections for my projects. I guarantee the Pi itself has internet connection only Kodi won’t work.

a) I have tried to do that in the OSMC panel under Network but it won’t work (eth0 connected, no internet)
b) leaving OSMC in default won’t work either, unless I am running that command after each reboot. I am not using a router on this connection as the ISP cable is directly into the Pi.

When you go into MyOSMC>network and manually set up your connection the “no internet” display may be in error. I just tried it on mine and when I first hit apply it did indeed say that. If you leave that screen and then come back it should refresh and show the actual connection state.

There is no difference between the OS and Kodi in regards to internet connectivity.
When you have the connection issue (before you run your nameserver command) log into OSMC via SSH and run grab-logs -A if that works and you get an URL share the URL here for us to check the logs.

I’m pretty sure the issue here is that he is plugged directly into a modem that has a basic DHCP server built into it and the DNS it hands out redirects to the web interface that configures the modem. I’ve seen it before. This explains why he was able to access the Pi from the internet but he had to change the DNS to get internet access from the Pi. Without a proper DHCP server you have to manually set your settings with this type of setup.

There you go. I plugged the Pi into a router thinking that darwindesign’s solution will fix it but without any success.

Here’s the link for my logs: https://paste.osmc.tv/donojevoju

Ok, first things first. Having OSMC SSH port open to the internet, I hope you know what you are doing!

Secondly it looks like after you establish your VPN connection the local ethernet connection is loosing it’s IP settings and therefore I assume your DNS settings are not working anymore which requires you to set nameserver as 8.8.8.8

eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 169.254.199.71  netmask 255.255.0.0  broadcast 169.254.255.255
        ether b8:27:eb:e2:08:f9  txqueuelen 1000  (Ethernet)
        RX packets 5279572  bytes 1747460645 (1.6 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12091065  bytes 11449192272 (10.6 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I simply outlined your problem and at no point did I tell you that you needed to add a router. What I described is networking 101 and you should really understand it if your plugged directly into the internet without a firewall. This is support for a media center distro, not general networking and Debian support. If you need something more than fairly basic networking then you need to search the internet to learn how ConnMan works.

Looking through your log I noticed these lines:

Log started: 2019-09-06  16:31:17
Removing rbp2-device-osmc (1.5.1) ...
WARNING: You have tried to remove a package that is essential to OSMC's operation.
To undo these changes, run 'sudo apt-get -f install'.
dpkg: error processing package rbp2-device-osmc (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: openvpn: dependency problems, but removing anyway as you requested:
 armv7-connman-osmc depends on openvpn.

Removing openvpn (2.4.0-6+deb9u3) ...
dpkg: armv7-network-osmc: dependency problems, but removing anyway as you requested:
 rbp2-device-osmc depends on armv7-network-osmc.

Removing armv7-network-osmc (1.7.6) ...
WARNING: You have tried to remove a package that is essential to OSMC's operation.
To undo these changes, run 'sudo apt-get -f install'.
dpkg: error processing package armv7-network-osmc (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: armv7-connman-osmc: dependency problems, but removing anyway as you requested:
 armv7-network-osmc depends on armv7-connman-osmc (>= 1.2.9-3).

Removing armv7-connman-osmc (1.3.6-2) ...
Errors were encountered while processing:
 rbp2-device-osmc
 armv7-network-osmc
Log ended: 2019-09-06  16:31:24

and remembered this thread from a few days ago where you managed to bork your system after removing openvpn.

I think it’s probably the case that your system still isn’t working 100% and would definitely recommend a fresh reinstall. I would also strongly recommend (a) that you don’t connect the Pi directly to the ISP (ie use a router) and (b) if you must have SSH connection from the Internet, use a high port number, which will at least reduce the number of Chinese IP addresses trying to get in.