locked me out from local net

Hello,

I have two hosts. One is connected to internet and the other host.
I've read about sharing the internet connection and now I can open websites from the 2nd host.

But now I can not 'ping' to any other host in local net except of the IP of the host with the internet connection.

I thought about dropping packages from this IP before routing but this target isn't available for 'nat' table.
I also don't know if this is the right way to do?

host1
eth0 : 192.168.5.10 / gw 192.168.5.251
eth1 : 192.168.10.10
---
host2
eth0 : 192.168.10.20

shorted question: How to connect to local net over host1 from host2 with IP-forwarding enabled?

Let me just check I've understood what you're asking correctly.

You want host2 to be able to access resources on the 192.168.5.x subnet by using host1 as a router?
But you can already access the Internet from host2 by using host1 as a router?

Are you able to ping 192.168.5.10? Are you able to ping 192.168.5.251?

What OS are you using?

yes..

yes..

no, I just can ping the IP of eth0 on host1 (192.168.5.10)

ping from host1 to subnet 192.168.5.x works..

dmesg | grep version tells me the following:

host1 : Linux version 2.6.32-33-server [...] Ubuntu 4.4.3-4ubuntu5
host2 : Linux version 3.0.0-16-generic [...] Ubuntu/Linaro 4.6.1-9ubuntu3

I've found out the problem which was created by me and my dummy tries to get my internet share working..

I created a route on host2 route add -net 192.168.0.0 netmask 255.255.0.0 don't ask me why! :smiley:

with this setup the connection to the local subnet connected to host1 isn't possible anymore.

can somebody please explain why and what's going on when this route is set?

I've deleted this route and now everything works fine..

You've added a route without specifying a gateway for it. For the route to work, you'd need to add a gateway parameter too using the gw switch. Also you've set a class C address up as a Class B one, 192.168.xxx.yyy is a Class C subnet with a mask 255.255.255.0 so in effect you were saying both separate subnets (192.168.5.x and 192.168.10.x) were in the same subnet and this messed up your routing.

Glad you got it sorted, sorry I took so long to respond, mad busy weekend!

1 Like

thanks, will have to read about meaning and usage of netmask again...