I can ping my gateway but I can't access internet and LAN
I was trying to make my server IP static so I changed my /etc/network/interfaces to this:
auto lo eth0 iface lo inet loopback iface eth0 inet static address 10.1.1.10 netmask 255.0.0.0 gateway 10.1.1.1Now I can't access my LAN. My Samba server was working fine before this change and now nobody in LAN can see it. I can ping my gateway (10.1.1.1) but I can't access internet.
Route command: route -n
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.1.1.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 * 25.0.0.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0UPDATE:
After restarting my server I can see my samba folders from other computers. Now the only problem that remains is that I can't access internet from it.
92 Answers
You entered the same IP address as the server's address and your gateway. That's probably wrong and if your router's/gateway's IP address is really 10.1.1.1 you now have two devices with the same IP address in your net segment.
I suppose you want to change the server's IP to 10.1.1.2 or 10.1.1.10, depending on your network plan, leaving the address of the gateway to 10.1.1.1
Also, a subnet mask of 255.0.0.0 seems to be horribly, unnecessary big. It's not really a problem, but in the long run you can run into problems with that setting, e.g. if you want to set up some kind of routed VPN. You probably want it to be 255.255.255.0. Check the subnet mast settings on your gateway and set the same on your server.
5I had the same problem with my ubuntu server, i can ping the gateway but not internet. I solved the problem like this:
-sudo systemctl restart networking