LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to routing same destination and ..... help (https://www.linuxquestions.org/questions/linux-networking-3/how-to-routing-same-destination-and-help-418661/)

ERBRMN 02-23-2006 04:12 AM

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


Half_Elf 02-23-2006 08:36 AM

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.

ERBRMN 02-23-2006 07:32 PM


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

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


All times are GMT -5. The time now is 10:10 PM.