LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-23-2006, 04:12 AM   #1
ERBRMN
Member
 
Registered: Mar 2005
Location: Japan
Distribution: TurboLinux, RHEL, SUSE
Posts: 96

Rep: Reputation: 15
How to routing same destination and ..... help


How to route same destination and different gateway on different device.

*************
My routing table :

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.52.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1
192.168.50.0 192.168.52.1 255.255.255.0 UG 0 0 0 wlan1
192.168.50.0 192.168.51.1 255.255.255.0 UG 0 0 0 wlan0
192.168.51.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo


*************

When I ping other computer (192.168.52.1) to this computer (first card:192.168.52.2),it will use gateway (192.168.52.1), ... (OK) pinging

But when I ping other computer (192.168.51.1) to this computer (second card:192.168.51.2),it will use gateway (192.168.52.1), ... NOT pinging.
After delete routing with gateway "192.168.52.1", It will (OK) pinging.

How can I manage my routing table, ... please help

 
Old 02-23-2006, 08:36 AM   #2
Half_Elf
Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 45
There is something really wrong about your routing table.

-First, you have 2 route for the same ip range :
192.168.50.0 192.168.52.1 255.255.255.0 UG wlan1
192.168.50.0 192.168.51.1 255.255.255.0 UG wlan0

How linux could find where to send? If you try to send something to the 192.168.50.0/24 range, it will fails (or linux will use the first route only?).

-Second, you don't have default route. You have a route for the 192.168.52.0/24 range, two ( !! ) for the 192.168.50.0/24 and one for the 192.168.51.0/24 range (but no gateway on this one?) ? If you try to send something that is not on these 3 routes, where is linux suppose to send? It will probably just drop the packet, or it will use the first route of the list (nb : the "list" you see is maybe not the real order of the list in kernel).
To set a default route, try something like (this example will send all "unknown" trafic to wlan0):
route add default gw 192.168.51.1 dev wlan0


All these problems might seem unrelated to your problem, but to works with broken routing table will often lead to strange bugs and non-sense routing. I suggest that you try to correct these problems and then to try again to see if it helped.
 
Old 02-23-2006, 07:32 PM   #3
ERBRMN
Member
 
Registered: Mar 2005
Location: Japan
Distribution: TurboLinux, RHEL, SUSE
Posts: 96

Original Poster
Rep: Reputation: 15

Thk u, Half_Elf for advice.

I am sending some information.
In my system :
One mobile node with 2 wireless card : wlan0 (192.168.61.2) and wlan1 (192.168.62.2)
Each 2 wireless connecting to Access point with 2 wireless (192.168.61.1 and 192.168.62.1 )
And only gateway (192.168.60.254)
From Gateway to AP (192.168.61.1) connect wired line.

Now, I can ping :

Gateway <-> AP_wlan0
Gateway <-> AP_wlan1
AP_wlan0 <-> MN_wlan0
AP_wlan1 <-> MN_wlan1
Gateway <-> MN_wlan1

Only i could not ping Gateway <-> MN_wlan0
(I think, when I ping from gateway to MN_wlan0, it use first route (it is 192.168.62.1) from routing table.)

Access point - I used "hostapd", OS is SUSE 10 for 64bit.


********************************
Mobile node information:

linux:~/bayar # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.62.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1
192.168.60.0 192.168.62.1 255.255.255.0 UG 0 0 0 wlan1
192.168.60.0 192.168.61.1 255.255.255.0 UG 0 0 0 wlan0
192.168.61.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

linux:~/bayar # ip route show
192.168.62.0/24 dev wlan1 proto kernel scope link src 192.168.62.2
192.168.60.0/24 via 192.168.61.1 dev wlan0
192.168.60.0/24 via 192.168.62.1 dev wlan1
192.168.61.0/24 dev wlan0 proto kernel scope link src 192.168.61.2
127.0.0.0/8 dev lo scope link

linux:~/bayar # ip route show table local
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
local 192.168.62.2 dev wlan1 proto kernel scope host src 192.168.62.2
broadcast 192.168.62.0 dev wlan1 proto kernel scope link src 192.168.62.2
broadcast 192.168.61.255 dev wlan0 proto kernel scope link src 192.168.61.2
local 192.168.61.2 dev wlan0 proto kernel scope host src 192.168.61.2
broadcast 192.168.62.255 dev wlan1 proto kernel scope link src 192.168.62.2
broadcast 192.168.61.0 dev wlan0 proto kernel scope link src 192.168.61.2
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1


wlan0
Link encap:Ethernet HWaddr 00:90:CC:4E:2B:10
inet addr:192.168.61.2 Bcast:192.168.61.255 Mask:255.255.255.0
inet6 addr: fe80::290:ccff:fe4e:2b10/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3000 errors:0 dropped:154 overruns:0 frame:0
TX packets:652 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:243288 (237.5 Kb) TX bytes:70027 (68.3 Kb)
Interrupt:4 Base address:0xc040

wlan1
Link encap:Ethernet HWaddr 00:90:CC:4E:32:06
inet addr:192.168.62.2 Bcast:192.168.62.255 Mask:255.255.255.0
inet6 addr: fe80::290:ccff:fe4e:3206/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:371 errors:0 dropped:50 overruns:0 frame:0
TX packets:359 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17030 (16.6 Kb) TX bytes:37059 (36.1 Kb)
Interrupt:3 Base address:0xc000

******************************

Last edited by ERBRMN; 02-23-2006 at 07:54 PM.
 
  


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
help ! Destination Unreachable ernvb Linux - Hardware 3 10-23-2005 11:09 PM
make destination DESTDIR jkassemi Linux - General 2 09-24-2005 05:06 AM
matrian destination eka Linux - Networking 6 07-19-2005 02:46 PM
Holiday Destination... X11 General 23 04-14-2002 11:53 AM
destination host unreaclable cotzcar Linux - Networking 2 04-12-2001 10:08 AM


All times are GMT -5. The time now is 03:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration