Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Network unreachable message driving me crazy!

Status
Not open for further replies.

rebayona

Technical User
Oct 22, 2001
32
CO
Hi, I'm trying to setup a server, and I was able to make it work (the internet connection), but later I changed something (can`t remember what) and I lost the connection. I can ping my router, I can ping my internal IPs and host aliases, but when I ping something outside, the message "connect: Network is unreachable" is always present.
I know it must be something related with netmask or gateway, but can`t figure what's wrong. I've tried dmesg, /var/log/messages and ifconfig -a and everything seems to be fine. I guess it has something to do with bindconf, since I have to run my own DNS. I'm starting to get desperate.
What files would you like to see?

hosts:
127.0.0.1 ridda localhost.localdomain localhost
200.74.133.XXX ns1.mydomain.com ns1
200.74.133.XXX ns2.mydomain.com ns2

resolv.conf:
search mydomain.com attla.net.co
nameserver 127.0.0.1
nameserver 200.14.205.2 (that's my ISP DNS)
nameserver 200.74.133.153 (a reliable one)

/etc/sysconfig/network-scripts/ifcfg-eth0:

device="eth0"
bootproto="none"
IPADDR="200.74.133.XXX"
NETMASK="255.255.255.248"
NETWORK="200.74.133.XXX"
on boot= yes

A friend was curious about how the gateway could be different from my net IPs. Gateway is 200.24.73.201 and my Ips start on 200.74.133.XXX, so it's kind of weird, but connection with those specs works perfects under windows, and it worked fine with linux, until I messed up.

Let's see more files:

/etc/named.conf

zone "." {
type hint;
file "named.ca"
};

zone "0.0.127.in-addr.arpa" {
type master;
file "0.0.127.in-addr.arpa.zone"
};

zone "133.74.200.in-addr.arpa.zone" {
type master;
file "133.74.200.in-addr.arpa.zone"
};

zone "localhost" {
type master;
file "localhost.zone";
};

zone "setecsa.com" {
type master;
file "setecsa.com.zone";
};

And I guess you'd like to see 133.74.200.in-addr.arpa.zone:

$TTL 86400
@ IN SOA @ root.localhost (
2 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; ttk
)

@ IN NS ns1.
@ IN NS trinity.attla.net.co

XXX IN PTR ns1.setecsa.com



So.... please guys, help me?

Do you need any other files to see?

Thanks a million,

Rafael


 
Hi,

This must be a routing problem. What does '/sbin/route' show - especially the default route ? Also can you ping external addresses using the IP (vs name) - for example :

ping -c5 216.148.218.197

instead of

ping -c5
If the first works but second doesn't its a DNS problem....

That should do to start.
Regards
 
Thanks for your reply ifinchman

route:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
200.74.133.152 * 255.255.255.248 U 0 0 0
127.0.0.0 * 255.0.0.0 U 0 0 0

Iface
eth0
lo

Pinging either to an IP or to a name results in:

connect: Network is unreachable

Now, for what I can see it seems to be the Gateway .... how do I fix it?

Thanks a million for your help,

Rafael
 
Hi,

There is no gateway shown (G flag) nor default gateway. Try one of these :


/sbin/route add default gw 200.74.133.152

or (better if dhcp)

/sbin/route add default dev eth0

Regards
 
Didn't work :(

SIOCADDRT: Network is unreachable

Thanks for your reply,

Rafael
 
I think this might me helpful:

When I run linuxconf --status this is the result (By the way, I'm using Redhat 7.1)

List of things required to activate current configuration
? The following command told me something had to be done
? /etc/rc5.d/S10network probe
Executing: /etc/rc5.d/S10network reload
? Service apmd is not running
Executing: /etc/rc5.d/S26apmd start
? Service lpd is not running
Executing: /etc/rc5.d/S60lpd start

But every time I try to start them (using linuxconf, as I don't have any idea on how to start them manually) the messages remain, so I guess it has something to do with it (conflict with something stopping services to go up, just guessin')

What other tests can I run to see what's wrong?

Thank you guys,

Rafael

 
HI, I already figured out what was wrong.
It was, as suspected, the gateway. I put my router IP as the default gateway, and it worked.

Thanks for your support guys,

Rafael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top