Help me! Why can't I access the internet on a static IP address?
by anamnedelcu from LinuxQuestions.org on (#59JQP)
Hello,
I need some help. I set up a static IP address for my ubuntu 16.04 server and now I don't have an internet connection anymore. I can ping my router but when I try to ping 8.8.8.8 it says "connect: Network is unreachable".
/etc/network/interfaces:
auto enp0s3
iface enp0s3 inet static
address 192.168.101.1
netmask 255.255.255.1
network 192.168.101.0
broadcast 192.168.101.255
gateway 192.168.101.1
dns-nameservers 192.168.101.1 8.8.8.8 8.8.4.4
/etc/resolv.conf
nameserver 192.168.101.1
nameserver 8.8.8.8
nameserver 8.8.4.4


I need some help. I set up a static IP address for my ubuntu 16.04 server and now I don't have an internet connection anymore. I can ping my router but when I try to ping 8.8.8.8 it says "connect: Network is unreachable".
/etc/network/interfaces:
auto enp0s3
iface enp0s3 inet static
address 192.168.101.1
netmask 255.255.255.1
network 192.168.101.0
broadcast 192.168.101.255
gateway 192.168.101.1
dns-nameservers 192.168.101.1 8.8.8.8 8.8.4.4
/etc/resolv.conf
nameserver 192.168.101.1
nameserver 8.8.8.8
nameserver 8.8.4.4