Linux – Container can’t ping github.com but host can

linuxlxcnetworking

I have the following setup:

[ LXC Container running Debian ] <--> virbr0 <--> [Fedora 24 host]

DNS resolve works for every single domain I've tried to so far from the host and from the container. Except "github.com" and any of it's IP addresses (I get a Destination Host Unreachable error).

Again…only for github.com (but also pinging the IP directly). The container has the following /etc/resolv.conf:

nameserver 192.168.122.1

Which is the host. Which is able to both resolve and ping github.com. So does anyone have an idea what might be going on here? Because this is causing the software installed in the container (nextcloud) to not work properly anymore. (Also, this behaviour happens from all my LXC containers).

Best Answer

If you're still having this problem, can you post the /etc/network/interfaces file for the container?

If you have a netmask of 255.0.0.0 that could be a problem, because github.com's IP is 192.30.253.113. Switching the netmask to 255.255.255.0 may resolve this after restarting the container.

I just had a similar problem on a debian VirtualBox machine and this resolved it for me.