On my Ubuntu Server 16.04(it is a virtual machine), after I set the IP to static as follows:
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.70.10
netmask 255.255.255.0
gateway 192.168.70.1
dns-nameservers 8.8.8.8 8.8.4.4
I have no access to the internet. The following ping does not work:
dockerize@containerize:~$ ping www.google.ch
ping: unknown host www.google.ch
Then I set back to DHCP, the ping works:
dockerize@containerize:~$ ping www.google.ch
PING www.google.ch (216.58.213.195) 56(84) bytes of data.
64 bytes from ham02s15-in-f195.1e100.net (216.58.213.195): icmp_seq=1 ttl=128 time=29.8 ms
64 bytes from ham02s15-in-f195.1e100.net (216.58.213.195): icmp_seq=2 ttl=128 time=30.1 ms
^C
--- www.google.ch ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 29.882/30.001/30.121/0.210 ms
I've got following IP from DHCP:
dockerize@containerize:~$ ifconfig
ens33 Link encap:Ethernet HWaddr 00:0c:29:bf:cf:78
inet addr:192.168.70.135 Bcast:192.168.70.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:febf:cf78/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:230 errors:0 dropped:0 overruns:0 frame:0
TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:22864 (22.8 KB) TX bytes:14513 (14.5 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:160 errors:0 dropped:0 overruns:0 frame:0
TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:11840 (11.8 KB) TX bytes:11840 (11.8 KB)
I can access the server via ssh. What is wrong?
Update
Network information with DHCP:
dockerize@containerize:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.70.2
search localdomain
dockerize@containerize:~$ ip route
default via 192.168.70.2 dev ens33
192.168.70.0/24 dev ens33 proto kernel scope link src 192.168.70.135
Then I change interfaces to:
# The primary network interface
auto ens33
iface ens33 inet static
address 192.168.70.10
netmask 255.255.255.0
gateway 192.168.70.1
dns-nameservers 192.168.70.2
ssh
, the machine is obviously connected to the internet and the issue is somewhere else.cat /etc/resolv.conf
) and what is the route you get (ip route
)? Is it possible outgoing DNS probes are blocked? Try using the same DNS as handed per DHCP.