在debian上添加一个default的路线

我们在一个networking之外的两个防火墙之间进行心跳切换,切换发生的接口默认没有IP设置,并且只有在切换发生时才获得这个IP。 这也恰好是这个networking的默认路由(机器被用作防火墙),我们没有IP空间给每台机器分配一个IP地址。 但是,当尝试将stream量路由到WAN端口以外的任何位置时,这会造成问题。

我该如何去添加一个默认路由到当前没有IP地址的接口(这个接口在启动时是通过system.d服务来实现的),还是我可以通过IP在切换时添加一个路由?

您可以使用ocf:heartbeat:Route资源代理添加/删除路由。

Route资源代理的描述是:

 Manages network routes (ocf:heartbeat:Route) Enables and disables network routes. Supports host and net routes, routes via a gateway address, and routes using specific source addresses. This resource agent is useful if a node's routing table needs to be manipulated based on node role assignment. Consider the following example use case: - One cluster node serves as an IPsec tunnel endpoint. - All other nodes use the IPsec tunnel to reach hosts in a specific remote network. Then, here is how you would implement this scheme making use of the Route resource agent: - Configure an ipsec LSB resource. - Configure a cloned Route OCF resource. - Create an order constraint to ensure that ipsec is started before Route. - Create a colocation constraint between the ipsec and Route resources, to make sure no instance of your cloned Route resource is started on the tunnel endpoint itself. Parameters (*: required, []: default): destination* (string): Destination network The destination network (or host) to be configured for the route. Specify the netmask suffix in CIDR notation (eg "/24"). If no suffix is given, a host route will be created. Specify "0.0.0.0/0" or "default" if you want this resource to set the system default route. device (string): Outgoing network device The outgoing network device to use for this route. gateway (string): Gateway IP address The gateway IP address to use for this route. source (string): Source IP address The source IP address to be configured for the route. table (string): Routing table The routing table to be configured for the route. Operations' defaults (advisory minimum): start timeout=20 stop timeout=20 monitor timeout=20 interval=10 reload timeout=20 

在你的IP后面定义你的configuration,一旦有IP,路由就会被添加。

不使用心脏起搏器而使用心跳是不build议使用的,因此find任何当前的文档都很困难。 如果可以的话,你应该看看在你的设置中joinPacemaker。