1830225 Members
1780 Online
109999 Solutions
New Discussion

Routing Problem

 
Samarth
Advisor

Routing Problem

Hi all,

I am a new user to Linux. I have installed one Linux Pc with two ethernet cards.

eth0 = 192.168.141.30
eth1= 100.100.61.3
Default gateway = 192.168.141.4 = My DSL Router IP Address

Route table

Destination
192.168.141.0 192.168.141.30
100.100.61.0 100.100.61.3
Default gateway = 192.168.141.4

I have one Pc which is on 192.168.141.X Series.
I have mentioned deafult gateway for this PC as 192.168.141.30 (eth0 on linux box). I can browse net on this PC and iptables rules applied are also working fine.(Blocking of certain sites.)

When I try to access from this Pc and Ip address of 100.100.61.0 I am not able to access.

What default gateway I should mention on 100 series network in order to make internet working.

Can anyone plsssssssssssssssssshelp me and tell me step by step commands to do routing for this setup. Where I can access any PC of 100.100.61.0 series from my 192.168.141.0 network and Vice - Versa.

I have read 100 of things on net but

27 REPLIES 27
The Real MD
Valued Contributor

Re: Routing Problem

Make sure your trying to connect from the correct physical network. Also check your Subnet masks are the same for both the connecting PC and the PC with two Network cards

Hope this Helps

Martin.
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

you should set

net.ipv4.ip_forward = 1

in /etc/sysctl.conf in order to allow routing in your linux box
Sergejs Svitnevs
Honored Contributor

Re: Routing Problem

Do all PC's of 100.100.61.0 series have route to 192.168.141.0 network?
If not, add new entry to the routing table for the all PCs on the network 100.100.61.0:
route add -net 192.168.141.0/24 gw 100.100.61.3.

Also make sure that IP forwarding setting is enabled.
"cat /proc/sys/net/ipv4/ip_forward"

Regards,
Sergejs

The Real MD
Valued Contributor

Re: Routing Problem

It might also be worth removing your security policy until you have the basic routing functionality working, then re-apply it when it's working.

Regards

Martin.
Marco_113
Frequent Advisor

Re: Routing Problem

If you can accesss internet with your configuration, you have only to add a route to the other network:
route add -net 192.168.141.0/24 gw 100.100.61.3

This make your pc acees internet


Samarth
Advisor

Re: Routing Problem

Hi Everyone,

Thnx for your replies.

I do not want to go and add route command on every PC on my network. I want all the request should come to my Linux box from there all the request should be routed automatically. I mean initially all the PC's on both the network should be able to access each other (100 and 192 series).

Could anyone list out all the steps required, like checking IP_Forward command etc. just to check I have not missed out anything.

Moreover when I try to ping 100 series PC from my 192 series network.. it says :

Reply from 192.168.141.30 Destination Host unreachable.

Pls help

Regards
Samarth
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

Samath,
If I understand properly, your network topology is:


100.100.61.x ----- linux box --- Internet
|
|
192.168.141.? PC
If so, you should
1) define default router for all 100.100.61.x boxes = 100.100.61.3
2) add
net.ipv4.ip_forward = 1
to /etc/sysctl.conf file on your linux router and reboot it.
3) add 192.168.141.30 as default router to your computers in 192.168.141 network

Resources:
http://www.homenethelp.com/web/howto/linux-share-internet.asp
Samarth
Advisor

Re: Routing Problem

Its like

192.168.141.x ----Linux box-----100.10061.x
|
|
DSL Router 192.168.141.4

Linux box has 2 NIC :

192.168.141.30
100.100.61.3

IP_Forward is enabled in SYSCTL.CONF

Routing table
192.168.141.x gw is 192.168.141.30
100.100.61.x gw is 100.100.61.3
Default gateway is 192.168.141.4

For eg if I ping 100.100.61.27 from 192.168.141.2 it says :

Reply from 192.168.141.30 Destination host unreachable.. Request timed out.
Fred Ruffet
Honored Contributor

Re: Routing Problem

Could you please post exact output from "route -nv" command ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

as far as I understand, you should set default router on all 192.168.141 machines [except linux itself] to 192.168.141.30
Samarth
Advisor

Re: Routing Problem

Pls find route-nv output attached.
Samarth
Advisor

Re: Routing Problem

Hi Mr. karasik,

You mean to say I should mention 192.168.141.30 as default gateway on all the PC's.?
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

on all PC in 192.168.141 network.

let's do it on one PC and test if this solve routing problem
Samarth
Advisor

Re: Routing Problem

I have tried that also. No luck..

I have mentioned 192.168.141.30 as Default gateway on one PC.But no luck

Thnx
sam
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

can you please send "netstat -rn" output from a box in 100.100.61 network and from 192.168.141 network
Samarth
Advisor

Re: Routing Problem

find attached as reqd by you..

thnx
sam
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

thanks, but I need "netstat -rn" output
Samarth
Advisor

Re: Routing Problem

My apologies

pls find correct netstat
Samarth
Advisor

Re: Routing Problem

pls find attched 100 series netstat
Fred Ruffet
Honored Contributor

Re: Routing Problem

Please do not attach .doc files this may be unusable for some people. A little text file is preferable.

Something seems strange to me : You don't have any default route on your server.

Could you please try to launch this command :
service network restart
and show us output. It should do a call to ifup for your NICs and define a default route.

Regards,

Fred


--

"Reality is just a point of view." (P. K. D.)
Samarth
Advisor

Re: Routing Problem

Hi,

Thnx for your reply.

I have tried that command and output is same:

No default gateway defined.

could you pls help me on this.
Fred Ruffet
Honored Contributor

Re: Routing Problem

Well... default gateway is set up by ifup when mounting an interface. So if using network which calls ifup doesn't bring you a default route. There may be a problem in those scripts. And this sound strange to me...

Send them to verify. We never know. They are in /etc/rc.d/init.d and /etc/sysconfig/network-scripts

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Samarth
Advisor

Re: Routing Problem

Do we need to define default gateway manually and whom should i send these scripts and which all.

Thnx

Sam
Vitaly Karasik_1
Honored Contributor

Re: Routing Problem

As far as I see, you should set default router for all 100.100.61 boxes to 100.100.61.3 because this network connected to others networks via Linux router.
[if I understand properly, your 100.100.61 boxes have only NIC connected to 100.100.61?]