关于路由自动切换的问题

31 views
Skip to first unread message

Yu Changyuan

unread,
Sep 29, 2017, 9:08:38 AM9/29/17
to Shanghai Linux User Group
假如有两个网关A、B都能到达子网C。

目前我配置了通过A到达C的静态路由,但是如果A挂了(ping不通了),有没有什
么办法自动将路由切换到通过B到达C?

--
Best wishes

雷钦

unread,
Sep 29, 2017, 6:05:56 PM9/29/17
to Shanghai Linux User Group
On 2017-09-29 21:08:20 +0800, Yu Changyuan wrote:
> 假如有两个网关A、B都能到达子网C。
>
> 目前我配置了通过A到达C的静态路由,但是如果A挂了(ping不通了),有没有什
> 么办法自动将路由切换到通过B到达C?

ip route add C nexthop via A nexthop via B

Yu Changyuan

unread,
Sep 29, 2017, 8:13:14 PM9/29/17
to sh...@googlegroups.com
觉得这样只能做负载均衡,不能做自动切换。另外,网上建议用脚本切换,据说内
核对路由表有10分钟的缓存。

有没有不用脚本,更加自动(看起来不像临时方案)一些方法?
--
Best wishes

Chaos Eternal

unread,
Sep 29, 2017, 11:30:49 PM9/29/17
to sh...@googlegroups.com
这不就是internet的事么。。。BGP?

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout

Yu Changyuan

unread,
Sep 30, 2017, 1:20:59 AM9/30/17
to sh...@googlegroups.com
有没有家用解决方案?

具体是因为要从外部访问k8s的pods,任意一个节点都是可以的,所以随意选了个
节点,然后在路由器里面加了一条到这个节点的静态路由。但是如果这个节点挂了,
就连不通了。
--
Best wishes

Chaos Eternal

unread,
Sep 30, 2017, 1:35:03 AM9/30/17
to sh...@googlegroups.com
k8s难道不是用keepalived来解决?或者haproxy.. 

Leon Han

unread,
Oct 1, 2017, 7:21:15 AM10/1/17
to sh...@googlegroups.com
我是通过routeros(基于linux)来解决的。不过我不太清楚linux下怎么解决,可能是像你所说的使用脚本来控制。

Shell Xu

unread,
Oct 8, 2017, 3:00:05 AM10/8/17
to shlug
BGP太复杂了,建议交给ISIS。

2017-09-30 13:20 GMT+08:00 Yu Changyuan <rei...@gmail.com>:
有没有家用解决方案?

具体是因为要从外部访问k8s的pods,任意一个节点都是可以的,所以随意选了个
节点,然后在路由器里面加了一条到这个节点的静态路由。但是如果这个节点挂了,
就连不通了。

Chaos Eternal <eterna...@shlug.org> writes:

> 这不就是internet的事么。。。BGP?
>
> On Sat, Sep 30, 2017 at 8:13 AM Yu Changyuan <rei...@gmail.com> wrote:
>
>  雷钦 <leiqi...@gmail.com> writes:
>
>  > On 2017-09-29 21:08:20 +0800, Yu Changyuan wrote:
>  >> 假如有两个网关A、B都能到达子网C。
>  >>
>  >> 目前我配置了通过A到达C的静态路由,但是如果A挂了(ping不通了),有没有什
>  >> 么办法自动将路由切换到通过B到达C?
>  >
>  > ip route add C nexthop via A nexthop via B
>
>  觉得这样只能做负载均衡,不能做自动切换。另外,网上建议用脚本切换,据说内
>  核对路由表有10分钟的缓存。
>
>  有没有不用脚本,更加自动(看起来不像临时方案)一些方法?
>  --
>  Best wishes
>
>  --
>  -- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to
sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at

https://groups.google.com/d/forum/shlug?hl=zh-CN
>  ---
>  您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
>  要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com

>  要查看更多选项,请访问 https://groups.google.com/d/optout

--
Best wishes

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+unsubscribe@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/d/optout



--
彼節者有間,而刀刃者無厚;以無厚入有間,恢恢乎其於游刃必有餘地矣。
blog: http://shell909090.org/
Reply all
Reply to author
Forward
0 new messages