Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Routing to internal network not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bakreule
Apprentice
Apprentice


Joined: 27 Aug 2003
Posts: 233
Location: Paris, France

PostPosted: Wed Dec 15, 2004 2:04 pm    Post subject: Routing to internal network not working Reply with quote

Hello all,

I've got my computer set up as a IPMasq gateway to my internal network. Eth0 is my internal interface, and eth1 points outside. The masq'ing is configured correctly as boxes hooked up can reach the internet no problem. They can also connect directly to the internal IP of my box (192.168.0.1).

For some reason that I haven't figured out, my box can't connect to any IPs on the lan. If I try to SSH to a box, I get the following error:

Code:
bkbox root # ping 192.168.0.21
PING 192.168.0.21 (192.168.0.21) 56(84) bytes of data.
From 192.168.0.1 icmp_seq=1 Destination Host Unreachable
From 192.168.0.1 icmp_seq=2 Destination Host Unreachable
From 192.168.0.1 icmp_seq=3 Destination Host Unreachable

--- 192.168.0.21 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3998ms

bkbox root # ssh 192.168.0.21
ssh: connect to host 192.168.0.21 port 22: No route to host


I thought that maybe my routing table was messed up, so I tried the 'route' command, which gave me this:

Code:
bkbox root # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
network.net81-6 *               255.255.254.0   U     0      0        0 eth1
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         gw.net81-64-178 0.0.0.0         UG    0      0        0 eth1


So it seems it was the routing table. However, doing this doesn't help:

Code:

bkbox root # route add -net 192.168.0.0/24 gw 255.255.255.0 dev eth0


gives this:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
network.net81-6 *               255.255.254.0   U     0      0        0 eth1
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         gw.net81-64-178 0.0.0.0         UG    0      0        0 eth1


but I still can't connect out. I don't think it's a firewall issue as my /var/log/messages file doesn't show any rejected packets when I'm doing all of this.

Does anyone have any suggestions?? Thanks!
Back to top
View user's profile Send private message
primero.gentoo
Guru
Guru


Joined: 23 Dec 2003
Posts: 402

PostPosted: Wed Dec 15, 2004 3:06 pm    Post subject: Re: Routing to internal network not working Reply with quote

bakreule wrote:


So it seems it was the routing table. However, doing this doesn't help:

Code:

bkbox root # route add -net 192.168.0.0/24 gw 255.255.255.0 dev eth0



You should not need this line cause configuring your eth0 interface up on 192.168.0.1 should put this route in your routing table. is very weird that u don't have it. what about if you

Code:

#ifconfig eth0 down

#ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up

#route


?
Does the route appear in your routing table?

BTW your ROUTE rule is wrong.
you can't specify "gw 255.255.255.0" cause simply it does not mean anything ;)

use a more simple

Code:

#route add -net 192.168.0.0/24 dev eth0


bye
_________________
"Linux, the choice of a GNU generation"
==Micro$oft - just say NO==
(L#USER 353039)
Back to top
View user's profile Send private message
bakreule
Apprentice
Apprentice


Joined: 27 Aug 2003
Posts: 233
Location: Paris, France

PostPosted: Wed Dec 15, 2004 6:17 pm    Post subject: Reply with quote

Thanks for the reply.

After deleting manually my 192.x.x.x table entry, doing as you suggested did indeed add a line to the routing table, like this:

Code:
bkbox root # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
network.net81-6 *               255.255.254.0   U     0      0        0 eth1
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         gw.net81-64-178 0.0.0.0         UG    0      0        0 eth1


however I'm still unable to go to the 192.168.0 network:

Code:
bkbox root # ssh 192.168.0.21
ssh: connect to host 192.168.0.21 port 22: No route to host


Is it possible this is a firewall issue? I wouldn't think so, because it doesn't even get as far as sending packets, as far as I can see, but I'm short of ideas.....
Back to top
View user's profile Send private message
primero.gentoo
Guru
Guru


Joined: 23 Dec 2003
Posts: 402

PostPosted: Thu Dec 16, 2004 9:26 am    Post subject: Reply with quote

bakreule wrote:
Thanks for the reply.

After deleting manually my 192.x.x.x table entry, doing as you suggested did indeed add a line to the routing table, like this:

Code:
bkbox root # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
network.net81-6 *               255.255.254.0   U     0      0        0 eth1
loopback        localhost       255.0.0.0       UG    0      0        0 lo
default         gw.net81-64-178 0.0.0.0         UG    0      0        0 eth1




Now your routing table seems good. btw , just as hint, use the "-n" option to force the "not-resolve names" options ... just numbers is really better in this kind of speeches ;)



Quote:

however I'm still unable to go to the 192.168.0 network:

Code:
bkbox root # ssh 192.168.0.21
ssh: connect to host 192.168.0.21 port 22: No route to host


Is it possible this is a firewall issue? I wouldn't think so, because it doesn't even get as far as sending packets, as far as I can see, but I'm short of ideas.....


Probably it is ... cause if your network interface is working well, as i think since your lan hosts can connect without problems to Internet, the only problem can be some iptables rules in the OUTPUT chain of your firewall ... maybe a simple DROP policy ? ... post out a

Code:

#iptables -L -n


bye
_________________
"Linux, the choice of a GNU generation"
==Micro$oft - just say NO==
(L#USER 353039)
Back to top
View user's profile Send private message
bakreule
Apprentice
Apprentice


Joined: 27 Aug 2003
Posts: 233
Location: Paris, France

PostPosted: Thu Dec 16, 2004 1:57 pm    Post subject: Reply with quote

Well, I've found the problem, and it was neither of these problems. When I left for work yesterday, I verified that the client computer in question was up and running. All of my testing yesterday I was doing during breaks at work, and it seemed that the DHCP lease for the box (given by my server) timed out before I had started, and thus the box no longer had an ip address. A simple dhcpd eth0 fixed the problem when I got home

I'm sure I'm missing something in there, but the fact remains that it works.... Thanks for your help...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum