Hi Moeen,
The multiple gateways never work as it will check only the first one from the routing table. The solution is create multiple routing tables and have 1 gateways for each of them. The only matter is how we can set the rule to identify the traffic.
I got the suse 10 today and started trying on that.
Regards
Jaison
On 11/1/05, Jaison Jose <[EMAIL PROTECTED]> wrote:
Hi Dirk,In the diagram just imagine that eth1 and 2 also connected with 2 other routers. What I need is I want to ping from 'something' (In the diagram,Can be a PC) to the connected interface of our linux box.Multiple default gateways will not work as it will only check the first one.Could you please guide me is there any applications to make the diagram which you made her so that I can explain little bit more as my english is so weak.RegardsJaison.
On 11/1/05, Dirk Tilger <[EMAIL PROTECTED] > wrote:On Tue, Nov 01, 2005 at 03:51:15AM -0800, Moeen Alinaghian wrote:
> ifconfig eth0 10.0.1.10 netmask 255.255.255.0 up
> ifconfig eth1 10.0.2.10 netmask 255.255.255.0 up
> ifconfig eth2 10.0.3.10 netmask 255.255.255.0 up
> route add default gw 10.0.1.1 dev eth0
> route add default gw 10.0.2.1 dev eth1
> route add default gw 10.0.3.1 dev eth2
>
> what's the result, now ?
He should have three different default routes. The system will try to
use the first one and only if the interface is down, it will try the
second. It might be with a very modern scheduler the packets will be
distributed in round-robin fashion.
Routing as shown above is destination only routing. The system should
have a routing table like...
10.0.1.0/24 -> eth0
10.0.2.0/24 -> eth1
10.0.3.0/24 -> eth2
...just from the ifconfig (ifconfig adds routes to interfaces fitting
their destination). 'default' is a special target which should map to
0.0.0.0/0. When I issue the first routing command, I would expect
something like
0.0.0.0/0 -> 10.0.1.1 via eth0
The other two would add
0.0.0.0/0 -> 10.0.2.1 via eth1
0.0.0.0/0 -> 10.0.3.1 via eth2
When we order the routing table as the kernel would do: smaller netmasks
first, we would get:
Target Bits of Netmask Gateway Interface
10.0.1.0 24 direct(ARP) eth0
10.0.2.0 24 direct(ARP) eth1
10.0.3.0 24 direct(ARP) eth2
0.0.0.0 0 10.0.1.1 eth0
0.0.0.0 0 10.0.2.1 eth1
0.0.0.0 0 10.0.3.1 eth2
I'm a kernel and want to deliver a packet to 10.0.2.6, I go down the
table and do:
- Is (10.0.2.6 AND 255.255.255.0) == 10.0.1.0?
--> 10.0.2.0 == 10.0.1.0?
--> No
- Is (( 10.0.2.6 AND 255.255.255.0) == 10.0.2.0?
--> 10.0.2.0 == 10.0.2.0?
--> Yes
- What is the gateway and interface? Gateway is local(ARP) via eth1
- Sending ARP packet to eth1 to lookup address of network card for
10.0.2.6
- (getting the address)
- Sending the packet.
When I do the same thing for 217.17.202.242 , then the first rule to hit
is number four, because every packet would match that destination. This
is why it is called the default route. As long as the interface is up,
rule 5+6 will never be checked. I'm not sure, but some operating systems
will even ignore 5+6 when eth0 is down, as their routing mechanism might
have no concept of interfaces that are down.
Dirk Tilger
Advanced Technologies ME FZ LLC
Tel +971 4 367 1071
Fax +971 4 367 2529
Mob +971 50 8809132
+966 55 1650025
SPONSORED LINKS
Linux operating system Linux os Hosting linux unix web Free linux operating system Linux migration Linux user
YAHOO! GROUPS LINKS
- Visit your group "dubailug" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
YAHOO! GROUPS LINKS
- Visit your group "dubailug" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
