PDA

View Full Version : [SOLVED] Cannot PING default gateway and adresses outside LAN, but can ping inside lan



renatospc
February 24th, 2010, 12:20 AM
I'm having a problem with my ubuntu server (9.04). I can't ping my gateway nor addresses outside my network, but I can ping other addresses in my network. I can't connect to the internet from it (tried sudo apt-get update) but I can ssh into the server and apache is working.

It was set behind two routers 192.168.0.1->192.168.1.1->server(192.168.1.200)) and it was working almost all right (I couldn't direct port 80 requests to the server). However, I had to change the first router and its IP so now I have 192.168.1.1->192.168.0.1->server. In order to configure the new static IP I've made changes to /etc/network/interfaces and /etc/resolv.conf. Now this files look like:


cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp

iface eth0 inet static
address 192.168.0.200
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
# dns-nameservers 192.168.0.1

#auto eth0


and:



domain lan
search lan
nameserver 192.168.1.1


I've tryed using 192.168.0.1 in nameserver, but it didn't worked either. My /etc/hosts looks like:


127.0.0.1 localhost
#127.0.1.1 sofis.lan sofis
192.168.0.200 sofis.lan sofis

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts



The outputs for ifconfig -a and route -n are:


renatospc@sofis:~$ ifconfig -a
eth0 Link encap:Ethernet Endereço de HW 00:40:d0:65:e3:59
inet end.: 192.168.0.200 Bcast:192.168.0.255 Masc:255.255.255.0
endereço inet6: fe80::240:d0ff:fe65:e359/64 Escopo:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Métrica:1
pacotes RX:642 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:223 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:1000
RX bytes:167184 (167.1 KB) TX bytes:29796 (29.7 KB)
IRQ:11 Endereço de E/S:0x8800

lo Link encap:Loopback Local
inet end.: 127.0.0.1 Masc:255.0.0.0
endereço inet6: ::1/128 Escopo:Máquina
UP LOOPBACK RUNNING MTU:16436 Métrica:1
pacotes RX:14 erros:0 descartados:0 excesso:0 quadro:0
Pacotes TX:14 erros:0 descartados:0 excesso:0 portadora:0
colisões:0 txqueuelen:0
RX bytes:984 (984.0 B) TX bytes:984 (984.0 B)



renatospc@sofis:~$ route -n
Tabela de Roteamento IP do Kernel
Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 eth0



Well, I don't know if I've forgot to change some file (I've made the working configuration a long time ago) or what's happening. I would really appreciate some help. Sorry if I've posted too much information, but usually posts don't have enough information. I've already tried to stop the firewall (shorewall) but it didn't helped.

Thanks

gombadi
February 24th, 2010, 02:52 AM
I can't ping my gateway nor addresses outside my network, but I can ping other addresses in my network.


What happens when you try and ping your gateway or external addresses? - No route to host message, no response message?

192.168.0.1 is on the same lan as your server so it should respond if you ping it. Is the router configured correctly.

bruno9779
February 24th, 2010, 02:58 AM
For several reasons I have set my router so it doesn't ping.

You may have too and do not remember it...

tgalati4
February 24th, 2010, 05:50 AM
tgalati4@tpad-Gloria7 ~ $ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 208.67.220.220
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.
nameserver 208.67.222.222
nameserver 68.94.156.1
nameserver 68.94.157.1
nameserver 192.168.1.1

------------------

Your gateway is actually 192.168.1.1. The modem handles the routing between LAN and WAN.

You can change it in the network preferences dialog.

Also your settings don't match your intentions:

iface eth0 inet static
address 192.168.0.200

192.168.1.200 perhaps?

renatospc
February 24th, 2010, 01:17 PM
@Gombadi and bruno9779:
When I try to ping the gateway or addresses outside my network I don't get any message back. All packets are lost. I know the router accepts ping because I can ping it from other computers in the network.

My server doesn't support pings, but when I disable the firewall I can ping it from other computers in the network (but not the getaway router).

@tgalati4:
I think that by the way the network is configured it should be 192.168.0.200 because it's in the subnet 192.168.0.x, that is connected to the 192.168.1.x network by the 192.168.0.1 router (the router is known as 192.168.1.2 in the other network). Anyway, I have another computer set to 192.168.0.201 and the internet works great (I'm writing from it), so I think this is not the problem.


Thanks for the help guys

Iowan
February 24th, 2010, 11:59 PM
To reiterate - you cannot ping 192.168.0.1?

renatospc
February 25th, 2010, 12:17 AM
To reiterate - you cannot ping 192.168.0.1?
Yes, neither 192.168.0.1 nor 192.168.1.1.

joberly
February 25th, 2010, 01:49 AM
I'm kind of jumping in here and have not read the entire thread in depth, but let me just clarify that you are using 2 routers? How are they configured and where do they sit on the network? A network diagram with IP's would help.

renatospc
February 25th, 2010, 02:09 PM
I'm kind of jumping in here and have not read the entire thread in depth, but let me just clarify that you are using 2 routers? How are they configured and where do they sit on the network? A network diagram with IP's would help.
Yes, that's a good idea. Here is a diagram of the network. There are a few more computers in each network, but they all have dynamically assigned IPs (in the range 100-150, so they are not conflicting with the static IPs).

http://img641.imageshack.us/img641/3737/lank.jpg

joberly
February 25th, 2010, 03:34 PM
Is .200 the only static box behind Router 2?

Have you fully disabled ANY and ALL firewall software or other traffic shaping setup for testing purposes?

Have you compared configuration files between .200 and another working box behind Router 2?

Router 2 is set to bridged mode right?

renatospc
March 3rd, 2010, 01:10 PM
Sorry, I've been away for the past few days. I'll try to answer your questions joberly.
Is .200 the only static box behind Router 2?
No, I have a box running Ubuntu 9.10 that works great with the fixed IP 192.168.0.201.


Have you compared configuration files between .200 and another working box behind Router 2?
The .201 box is configured trough Nm, so the configuration files are very different. I've compared the output of ifconfig -a and it looks the same on both computers. The output of route -n has one extra line in the working box. It reads:

169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0


Have you fully disabled ANY and ALL firewall software or other traffic shaping setup for testing purposes?
The only firewall I haven't disabled is the one in the router, because it doesn't let me.

Router 2 is set to bridged mode right?
I didn't found an option like this anywhere in the routers configuration interface (I'm using a trendnet router by the way). So I'm guessing that it's not on bridged mode.

renatospc
April 5th, 2010, 05:51 PM
Ok, so here's a strange thing. I had no time to change the server settings since the last post. I was only using it to do the backup of the computers in the 192.168.0.* network. I had to refresh all routers once and the server. Today I tried to ping outside the lan and it worked. I don't know what happened since I'd already rebooted everything when I posted the thread, but now the server is working (I'm still having some trouble to redirect requests in port 80 from the outside world to the server, but if I can't solve it I'll create another thread). Anyway, thanks for the help.