Hi ,
I have a network to reach which is 192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( 192.168.0.254) in following way.
ip route add 192.168.2.0/24 via 192.168.0.254
Now, We got another gateway which is 192.168.0.250. Now I want to add a route to the same network which is 192.168.2.0/24 via this gateway (192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary and the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
Indunil Jayasooriya spake the following on 12/29/2006 3:11 AM:
Hi ,
I have a network to reach which is 192.168.2.0/24 . It is a branch of the company. I have currently added a route to that network via one gateway ( 192.168.0.254) in following way.
ip route add 192.168.2.0/24 via 192.168.0.254
Now, We got another gateway which is 192.168.0.250 < Now I want to add a route to the same network which is 192.168.2.0/24 via this gateway ( 192.168.0.250 ) as well.
Then I will have 2 paths to the same network. One path should be primary and the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
When you create a route there is a metric number that does this. But you will need a routing daemon running to use it. Another possibility would be to have a script run every 5 minutes in cron that pings the first gateway, and if the ping fails, change the route. It would also need logic to fix the first route when the primary gateway starts answering pings again.
You can add a second route and weight it as follows: ip route add equalize 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 1
This assumes that:
both gateways are connected to eth0 on your linux box You want equal traffic weight down each gateway to the remote network....
Regards
P.
Indunil Jayasooriya wrote:
Hi ,
I have a network to reach which is *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254) in following way.
ip route add *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254
Now, We got another gateway which is *MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250. Now I want to add a route to the same network which is *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via this gateway (*MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary and the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
-- Thank you Indunil Jayasooriya
-- This message has been scanned for viruses and dangerous content by the *Enhancion* http://www.enhancion.net/ system scanner, and is believed to be clean.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
To achieve the goal of primary path only, you can heavily weight one path over the other, some traffic will still spill into the other, you can remove the equalize parameter to disable this behaviour,
if you take a look at the linux advanced routing howto there are lots of options to play with..
P.
Peter Farrow wrote:
You can add a second route and weight it as follows: ip route add equalize 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 1
This assumes that:
both gateways are connected to eth0 on your linux box You want equal traffic weight down each gateway to the remote network....
Regards
P.
Indunil Jayasooriya wrote:
Hi ,
I have a network to reach which is *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254) in following way.
ip route add *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254
Now, We got another gateway which is *MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250. Now I want to add a route to the same network which is *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via this gateway (*MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary and the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
-- Thank you Indunil Jayasooriya
-- This message has been scanned for viruses and dangerous content by the *Enhancion* http://www.enhancion.net/ system scanner, and is believed to be clean.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Quoting Indunil Jayasooriya indunil75@gmail.com:
Hi ,
I have a network to reach which is 192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( 192.168.0.254) in following way.
ip route add 192.168.2.0/24 via 192.168.0.254
Now, We got another gateway which is 192.168.0.250. Now I want to add a route to the same network which is 192.168.2.0/24 via this gateway (192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary and the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
One possible solution is to enable one of the routing protocols on your routers, instead of using static routing. For example BGP or OSPF. The routers will than discover which paths to every of the networks you have exist and will dynamically change routing rules (instead of using static set of rules) as the network connections go up and down. In the way you requested in your question. It might be an overkill for simple network. But if your network becomes more complex in the future, you'll have infrastructure to handle it. Another advantage of using standard routing protocol is that they tend to be platform independent. You want to replace that Cisco router with Linux router or Linux router with Cisco router. Guess what, you can use BGP or OSPF on both Linux and Cisco based router and your configuration is not specific to single type of router anymore.
HI Peter,
Interesting in deed. You say that You can add a second route and weight it as follows:
ip route add equalize 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 1
I want to know whether I can use the above command , when the below command exists .
ip route add 192.168.2.0/24 via 192.168.0.254
Then I want to know about your second answer which is "To achieve the goal of primary path only, you can heavily weight one path over the other, some traffic will still spill into the other, you can remove the equalize parameter to disable this behaviour "
herein, what is this "you can heavily weight one path over the other"
When weight 1 and weight 1 , Both paths are equal. If I use weight 1 and weight 100 , what would be the primary path ? Is it weight 1 ?
Is it the lower number which becomes primary ?
Then , in my case, is the following coomad is right?
ip route add 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 100
I guess with the above command that traffc will flow via primary, when it fails , traffic will flow via secondary.
That is what I need.
Am I right ? Then can I acheive this goal ?
Thanks Indunil
---------- Forwarded message ---------- From: Aleksandar Milivojevic alex@milivojevic.org Date: Dec 30, 2006 3:37 AM Subject: Re: [CentOS] Fwd: How to add a route to a network via 2 gateways. To: centos@centos.org
Quoting Indunil Jayasooriya indunil75@gmail.com:
Hi ,
I have a network to reach which is 192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( 192.168.0.254) in following way.
ip route add 192.168.2.0/24 via 192.168.0.254
Now, We got another gateway which is 192.168.0.250. Now I want to add a route to the same network which is 192.168.2.0/24 via this gateway (192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary
and
the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
One possible solution is to enable one of the routing protocols on your routers, instead of using static routing. For example BGP or OSPF. The routers will than discover which paths to every of the networks you have exist and will dynamically change routing rules (instead of using static set of rules) as the network connections go up and down. In the way you requested in your question. It might be an overkill for simple network. But if your network becomes more complex in the future, you'll have infrastructure to handle it. Another advantage of using standard routing protocol is that they tend to be platform independent. You want to replace that Cisco router with Linux router or Linux router with Cisco router. Guess what, you can use BGP or OSPF on both Linux and Cisco based router and your configuration is not specific to single type of router anymore.
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi There,
the bigger the weight relative to the other gateway the more likely it is chosen a weight of 1 and 100 will mean the 100 choice is 100x more likely in theory.
If either gateway is down the other is routed automatically,
I have two 8 meg SDSL lines at home and balance them in this way....
P.
Indunil Jayasooriya wrote:
HI Peter,
Interesting in deed. You say that You can add a second route and weight it as follows:
ip route add equalize *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 scope global nexthop via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254/ dev eth0 weight 1 nexthop via *MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250/ dev eth0 weight 1
I want to know whether I can use the above command , when the below command exists .
ip route add *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254/
Then I want to know about your second answer which is "To achieve the goal of primary path only, you can heavily weight one path over the other, some traffic will still spill into the other, you can remove the equalize parameter to disable this behaviour "
herein, what is this "you can heavily weight one path over the other"
When weight 1 and weight 1 , Both paths are equal. If I use weight 1 and weight 100 , what would be the primary path ? Is it weight 1 ?
Is it the lower number which becomes primary ?
Then , in my case, is the following coomad is right?
ip route add *MailScanner warning: numerical links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 scope global nexthop via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254/ dev eth0 weight 1 nexthop via *MailScanner warning: numerical links are often malicious:* 192.168.0.250 http://192.168.0.250/ dev eth0 weight 100
I guess with the above command that traffc will flow via primary, when it fails , traffic will flow via secondary.
That is what I need.
Am I right ? Then can I acheive this goal ?
Thanks Indunil
---------- Forwarded message ---------- From: *Aleksandar Milivojevic* <alex@milivojevic.org mailto:alex@milivojevic.org> Date: Dec 30, 2006 3:37 AM Subject: Re: [CentOS] Fwd: How to add a route to a network via 2 gateways. To: centos@centos.org mailto:centos@centos.org
Quoting Indunil Jayasooriya < indunil75@gmail.com mailto:indunil75@gmail.com>:
Hi ,
I have a network to reach which is *MailScanner warning: numerical
links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24. It is a branch of the
company. I have currently added a route to that network via one
gateway (
*MailScanner warning: numerical links are often malicious:*
192.168.0.254 http://192.168.0.254) in following way.
ip route add *MailScanner warning: numerical links are often
malicious:* 192.168.2.0/24 http://192.168.2.0/24 via *MailScanner warning: numerical links are often malicious:* 192.168.0.254 http://192.168.0.254
Now, We got another gateway which is *MailScanner warning: numerical
links are often malicious:* 192.168.0.250 http://192.168.0.250. Now I want to add a
route to the same network which is *MailScanner warning: numerical
links are often malicious:* 192.168.2.0/24 http://192.168.2.0/24 via this gateway
(*MailScanner warning: numerical links are often malicious:*
192.168.0.250 http://192.168.0.250)
as well.
Then I will have 2 paths to the same network. One path should be
primary and
the other path should be backup. everything should go via primary
path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
One possible solution is to enable one of the routing protocols on your routers, instead of using static routing. For example BGP or OSPF. The routers will than discover which paths to every of the networks you have exist and will dynamically change routing rules (instead of using static set of rules) as the network connections go up and down. In the way you requested in your question. It might be an overkill for simple network. But if your network becomes more complex in the future, you'll have infrastructure to handle it. Another advantage of using standard routing protocol is that they tend to be platform independent. You want to replace that Cisco router with Linux router or Linux router with Cisco router. Guess what, you can use BGP or OSPF on both Linux and Cisco based router and your configuration is not specific to single type of router anymore.
CentOS mailing list CentOS@centos.org mailto:CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- Thank you Indunil Jayasooriya
-- This message has been scanned for viruses and dangerous content by the *Enhancion* http://www.enhancion.net/ system scanner, and is believed to be clean.
On 12/30/06, Indunil Jayasooriya indunil75@gmail.com wrote:
HI Peter,
Interesting in deed. You say that You can add a second route and weight it as follows:
ip route add equalize 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 1
I want to know whether I can use the above command , when the below command exists .
ip route add 192.168.2.0/24 via 192.168.0.254
Then I want to know about your second answer which is "To achieve the goal of primary path only, you can heavily weight one path over the other, some traffic will still spill into the other, you can remove the equalize parameter to disable this behaviour "
herein, what is this "you can heavily weight one path over the other"
When weight 1 and weight 1 , Both paths are equal. If I use weight 1 and weight 100 , what would be the primary path ? Is it weight 1 ?
Is it the lower number which becomes primary ?
Then , in my case, is the following coomad is right?
ip route add 192.168.2.0/24 scope global nexthop via 192.168.0.254 dev eth0 weight 1 nexthop via 192.168.0.250 dev eth0 weight 100
I guess with the above command that traffc will flow via primary, when it fails , traffic will flow via secondary.
That is what I need.
Am I right ? Then can I acheive this goal ?
Hi, Maybe you can use this script http://www.go2linux.org/index.php?option=com_content&task=view&id=16...
best regards,
Guillermo.
Thanks Indunil
---------- Forwarded message ---------- From: Aleksandar Milivojevic <alex@milivojevic.org > Date: Dec 30, 2006 3:37 AM Subject: Re: [CentOS] Fwd: How to add a route to a network via 2 gateways. To: centos@centos.org
Quoting Indunil Jayasooriya < indunil75@gmail.com>:
Hi ,
I have a network to reach which is 192.168.2.0/24. It is a branch of the company. I have currently added a route to that network via one gateway ( 192.168.0.254) in following way.
ip route add 192.168.2.0/24 via 192.168.0.254
Now, We got another gateway which is 192.168.0.250. Now I want to add a route to the same network which is 192.168.2.0/24 via this gateway (192.168.0.250) as well.
Then I will have 2 paths to the same network. One path should be primary
and
the other path should be backup. everything should go via primary path.
if the primary path goes down, the backup path should be active.
That is the purpose of doing this.
Pls let me know whether it is possible or not?
if possible, How can I achieve this goal.
One possible solution is to enable one of the routing protocols on your routers, instead of using static routing. For example BGP or OSPF. The routers will than discover which paths to every of the networks you have exist and will dynamically change routing rules (instead of using static set of rules) as the network connections go up and down. In the way you requested in your question. It might be an overkill for simple network. But if your network becomes more complex in the future, you'll have infrastructure to handle it. Another advantage of using standard routing protocol is that they tend to be platform independent. You want to replace that Cisco router with Linux router or Linux router with Cisco router. Guess what, you can use BGP or OSPF on both Linux and Cisco based router and your configuration is not specific to single type of router anymore.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- Thank you Indunil Jayasooriya
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos