'Creates external route table and adds routing rules.'

def _add_rtr_ext_route_rule_to_route_table(self, ri, fip_2_rtr, fip_2_rtr_name):

    rt_tbl_index = ri._get_snat_idx(fip_2_rtr)
    interface_name = self.get_ext_device_name(self.agent_gateway_port['id'])
    try:
        with self._fip_port_lock(interface_name):
            self._update_gateway_route(self.agent_gateway_port, interface_name, tbl_index=rt_tbl_index)
    except Exception:
        with excutils.save_and_reraise_exception():
            self.unsubscribe(self.agent_gateway_port['network_id'])
            self.agent_gateway_port = None
            LOG.exception(_LE('DVR:    Gateway    setup    in    FIP    namespace    failed'))
    ip_rule = ip_lib.IPRule(namespace=self.get_name())
    ip_rule.rule.add(ip=str(fip_2_rtr.ip), iif=fip_2_rtr_name, table=rt_tbl_index, priority=rt_tbl_index)
