LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-22-2004, 02:02 PM   #1
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Rep: Reputation: 15
Question routing issue..


to help try and explain the problem i've tried to textulise my network below. Basically two subnets, with subnet 1 beig connected to the internet through a ADSL wireless router. each subnet has two hosts sitting on it with the RH server having to interfaces one in each subnet.

192.168.2.0 (subnet 2) 192.168.1.0 (subnet 1)
----------------------------- ------------------------------

RH 9.0 client (192.168.2.11) eth0




RH 9.0 server (192.168.2.10) eth0 <----> RH 9.0 server (192.168.1.11) wlan0




ADSL wireless router (192.168.1.1) <---> internet




MacOS X ibook (192.168.1.12) en1



now, i want to be able to ping anything on the 192.168.1.0 subnet from the RH 9 client on 192.168.2.11

If I run "ping 192.168.1.11" on the RH client its fine.
If I run "ping 192.168.1.12" on the RH client it just hangs.
ping 192.168.1.1 also hangs.

(IPtables on all RH hosts were stopped while testing/pinging)

If i run "tcpdump -i wlan0 | grep icmp" on the RH server i can see the ping being received and being replied to. However if I run
"tcpdump -i eth0 | grep icmp" on the RH server I only see the ping being sent, and no reply coming back. So the ping reply seems to be being dropped between the interfaces on the RH server, or dropped at the wlan0, and not "forwarded" to the eth0 and back to the client.

Not sure what to enable to correct this situation ??????

Below are the outputs from route -n on the client and the server

RH client :-

[root@hansolo root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 192.168.1.11 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

RH server :-

[root@vader root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
 
Old 02-22-2004, 03:30 PM   #2
bnice
Member
 
Registered: Feb 2004
Location: Sacramento, CA
Distribution: Slack 9.1, slackware-current
Posts: 284

Rep: Reputation: 30
Quote:
RH server :-

[root@vader root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

route to 192.168.2.0 not defined properly

try this on vader

Code:
route del 192.168.2.0
route add -net 192.168.2.0 netmask 255.255.255.0 dev eth0
 
Old 02-22-2004, 04:02 PM   #3
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
hmm, not sure what mean by 192.168.2.0 not defined properly,

route del 192.168.2.0 wouldnt work, had to do

route del -net 192.168.2.0 netmask 255.255.255.0 dev eth0 to remove the entry, i then did the 2nd line you posted, which put the entry back in, route -n now shos the same -

[root@vader root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0


??? ping / tcdump test shows the same problem.
 
Old 02-22-2004, 04:35 PM   #4
bnice
Member
 
Registered: Feb 2004
Location: Sacramento, CA
Distribution: Slack 9.1, slackware-current
Posts: 284

Rep: Reputation: 30
Edit:
Quote:
hmm, not sure what mean by 192.168.2.0 not defined properly,
brainfart, sorry.



are you runnung gated?

you need something to tell the server to route the traffic between wlan0 & eth0

there used to be a kernel config option for ip forwarding, but it seems to have gone away...

I'd do some homework on gated, or Firestarter http://firestarter.sourceforge.net

it's either that or turn on advanced routing in the kernel &

Last edited by bnice; 02-22-2004 at 04:38 PM.
 
Old 02-23-2004, 12:39 AM   #5
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
Thanks, hmm, I did already switch the IP_forwarding on , i.e, set it to "1" on the server (vader), before i did that i had "host is unreachable" error when i did the ping, after adding that ping just hangs. So to me it seems that the IP_forwarding is only working in one direction, from eth0 to wlan0, and not forwrding the traffic back. soo, wlan0 doesnt know what to do with traffic coming from 192.168.1.0. it doesnt know to send it to eth0 if its for 192.168.2.0... which is wierd, coz its in the rouing table.
 
Old 02-23-2004, 01:18 AM   #6
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
Do the ADSL/802.11 router and the ibook know how to route back (through 192.168.1.11) to 192.168.2.0/24? You probably need to add a static route on both.

Have fun,
chris
 
Old 02-23-2004, 10:49 AM   #7
bnice
Member
 
Registered: Feb 2004
Location: Sacramento, CA
Distribution: Slack 9.1, slackware-current
Posts: 284

Rep: Reputation: 30
Quote:
Originally posted by inode100
Thanks, hmm, I did already switch the IP_forwarding on , i.e, set it to "1" on the server (vader), before i did that i had "host is unreachable" error when i did the ping, after adding that ping just hangs. So to me it seems that the IP_forwarding is only working in one direction, from eth0 to wlan0, and not forwrding the traffic back. soo, wlan0 doesnt know what to do with traffic coming from 192.168.1.0. it doesnt know to send it to eth0 if its for 192.168.2.0... which is wierd, coz its in the rouing table.
That's what caught my attention the first time...


seems like
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

should be
192.168.2.0 0.0.0.0 255.255.255.0 UG 0 0 0 eth0

but I'm not sure if the second field should be
0.0.0.0

or

192.168.2.10

since it's free try dropping the route again

route del -net 192.168.2.0 netmask 255.255.255.0 dev eth0
then
route add -net 192.168.2.0 netmask 255.255.254.0 gw 192.168.2.10 dev eth0


if you tell it in this fashion that the route to 192.168.2.0 is through 192.168.2.10, it may figure it out...

I've never used a linux box as a router, but have set up multiple subnets using Cisco dedicated routers
 
Old 02-23-2004, 03:47 PM   #8
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
HEY!!! I made it work.

here are the routing tables :-

hansolo (client, 192.168.2.11) :-

[root@hansolo root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 192.168.2.11 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 192.168.1.11 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

vader (server, 192.168.2.10 and 192.168.1.11) :-

[root@vader root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 192.168.2.10 255.255.255.0 UG 0 0 0 eth0
192.168.1.0 192.168.1.11 255.255.255.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0

ibook (balrog, 192.168.1.12) :-

[balrog]:[root] >> route get 192.168.2.11
route to: 192.168.2.11
destination: 192.168.2.0
mask: 255.255.255.0
gateway: 192.168.1.11
interface: en1
flags: <UP,GATEWAY,DONE,STATIC,PRCLONING>
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0

running the cmd :- route add -net 192.168.2.0 192.168.1.11 255.255.255.0 on the ibook (balrog), was the final thing i did that made it work, as soon as i did that the ping on hansolo stopped hanging and started getting a reply.

The reason i didnt do that earlier was coz i could see the ping coming in on 192.168.1.11 (wlan0) on vader. BUT... I now realise that because ibook didnt know about 192.168.2.0 it couldnt send the packet with that network dest, the packet dest must have just had 192.168.1.0 network info, which is why it stopped at wlan0 (192.168.1.11), and vader couldnt forward it to 192.168.2.10 and onto 192.168.2.11 !!

phew.

well thanks to all your help, incl.. especially to bnice and bastard23 (are you sure you are not alter egos ? )) )

later,

inode100
 
Old 02-23-2004, 03:58 PM   #9
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
and.... i just added a static route to the ADSL wireless router, dest addr 192.168.2.0, netmask 255.255.255.0 and gateway 192.168.1.11, now i can ping that box also from hansolo...

woo-hoo! :JAWA:
 
Old 02-24-2004, 10:05 AM   #10
bnice
Member
 
Registered: Feb 2004
Location: Sacramento, CA
Distribution: Slack 9.1, slackware-current
Posts: 284

Rep: Reputation: 30
I love it when things work!
Have Fun
 
Old 02-24-2004, 04:16 PM   #11
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
yeah! its great when you get that little bit of success... but now I want to look at setting up the Linux server as a "router" rather than just an IP forwarder.. if thats possible..i'm thinking that then i wont have to have a static route entry config'd on each and every host.. watch this space!!!
 
Old 02-25-2004, 03:49 AM   #12
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
What do you see is the difference between a router and ip_forwarder?
 
Old 02-25-2004, 03:52 PM   #13
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
Not sure yet So far i've had to enter details about the gateways and subnets in the route table of each host on my 2 subnets, to get inter-subnet traffic to find its way. I'm sure in large networks this isnt done, so i'm thinking that there must be a different method of routing the traffic ? Maybe i'm wrong. Do you know if there is more i can do here with the routing than just "IP_Forwarding" ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing Issue marc hall Linux - Networking 4 07-18-2004 10:59 AM
routing issue RyPingu Linux - Networking 1 08-15-2003 01:39 PM
again: routing issue! mule Linux - Networking 4 08-07-2003 08:43 AM
routing issue tanmaya Linux - Networking 1 10-13-2002 10:36 AM
Routing Issue jrmann1999 Linux - Networking 1 01-15-2002 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration