PDA

View Full Version : [ubuntu] Can't ping IPs or domains in Ubuntu Server 12.04



TBBucs
January 9th, 2013, 07:04 AM
On server...
ping 127.0.0.1 works
ping 192.168.1.104 (server's static IP address) works
ping google.com does not work (unknown host google.com)
ping 8.8.8.8 does not work (destination host unreachable)
ping 192.168.1.147 (local network machine's IP address) does not work (destination host unreachable)
ping 192.168.1.1 (router) does not work (destination host unreachable)

On local network machine...
ping 192.168.1.104 works

/etc/network/interfaces


auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.104
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

/etc/resolv.conf


nameserver 192.168.1.1

Any idea what's going on here?

subco
January 9th, 2013, 07:28 AM
1- check out "iptables"
2- ping 192.168.1.1 and 192.168.1.47 and then check "ARP Cache Table" with command

arp -n

TBBucs
January 9th, 2013, 07:39 AM
iptables -L says lists the policy for INPUT, FORWARD, and OUTPUT as ACCEPT.

arp -n lists both of the IPs I tried to ping and says that the HWaddress is incomplete.

sanderj
January 9th, 2013, 07:42 AM
On the server, what's the out of 'ifconfig'? Post it here.

And is the ethernet cable connected at all?

TBBucs
January 9th, 2013, 08:10 AM
I feel like an idiot. Turns out the ethernet cable was slightly loose. But I'm still not out of the woods just yet. I can now ping Google's IP (8.8.8.8), but ping google.com gives me an unknown host error. I can ping my router and local network computer successfully, and my network computer can ping my server as well.

sanderj
January 9th, 2013, 08:15 AM
I feel like an idiot. Turns out the ethernet cable was slightly loose. But I'm still not out of the woods just yet. I can now ping Google's IP (8.8.8.8), but ping google.com gives me an unknown host error. I can ping my router and local network computer successfully, and my network computer can ping my server as well.

That means your name resolving is not working.

How did your server get its IP address? Via DHCP, or ... ?

TBBucs
January 9th, 2013, 08:21 AM
The server gets a static IP address of 192.168.1.104.

sanderj
January 9th, 2013, 08:23 AM
The server gets a static IP address of 192.168.1.104.

Gets via DHCP, or sets via static config ... ?

TBBucs
January 9th, 2013, 08:31 AM
Via static config.

Cheesemill
January 9th, 2013, 12:06 PM
From 12.04 onwards you shouldn't edit resolv.conf directly as it gets rewritten by the system. Instead you should add the following line to your /etc/network/interfaces file:

auto eth0
iface eth0 inet static
address 192.168.1.104
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1

TBBucs
January 9th, 2013, 08:00 PM
Ah, adding the dns-nameservers line did the trick.

Now the issue is that I can't access the server from my Windows machines through the GUI. Navigating to \\192.168.1.104 in Explorer gives me a "Windows cannot access 192.168.1.104" error. That would suggest that the server isn't allowing connections from other machines, but how do I go about changing that in Ubuntu Server (note that I don't have a firewall enabled on the server yet, so that's not the issue)?

TBBucs
January 9th, 2013, 08:48 PM
Fixed the Explorer problem. I needed to reconfigure my Samba share, as it got messed up during my reinstall of Ubuntu Server. I can now access the sever through the Windows GUI, as well as SSH into the server.

Thanks for your help everybody!

Cheesemill
January 9th, 2013, 08:49 PM
Do you have any services running on the server to connect to?

For example to access shared drives from a Windows machine you would need to install and configure Samba on your server...
https://help.ubuntu.com/12.04/serverguide/samba-fileserver.html