'Delete the interface between router and FloatingIP namespace.'

def delete_rtr_2_fip_link(self, ri):

    LOG.debug('Delete    FIP    link    interfaces    for    router:    %s', ri.router_id)
    rtr_2_fip_name = self.get_rtr_ext_device_name(ri.router_id)
    fip_2_rtr_name = self.get_int_device_name(ri.router_id)
    fip_ns_name = self.get_name()
    if (ri.rtr_fip_subnet is None):
        ri.rtr_fip_subnet = self.local_subnets.lookup(ri.router_id)
    if ri.rtr_fip_subnet:
        (rtr_2_fip, fip_2_rtr) = ri.rtr_fip_subnet.get_pair()
        device = ip_lib.IPDevice(rtr_2_fip_name, namespace=ri.ns_name)
        if device.exists():
            device.route.delete_gateway(str(fip_2_rtr.ip), table=FIP_RT_TBL)
        if self.agent_gateway_port:
            interface_name = self.get_ext_device_name(self.agent_gateway_port['id'])
            fg_device = ip_lib.IPDevice(interface_name, namespace=fip_ns_name)
            if fg_device.exists():
                tbl_index = ri._get_snat_idx(fip_2_rtr)
                fip_rt_rule = ip_lib.IPRule(namespace=fip_ns_name)
                fg_device.route.flush(lib_constants.IP_VERSION_4, table=tbl_index)
                fg_device.route.flush(lib_constants.IP_VERSION_6, table=tbl_index)
                fip_rt_rule.rule.delete(ip=fip_2_rtr.ip, iif=fip_2_rtr_name, table=tbl_index, priority=tbl_index)
        self.local_subnets.release(ri.router_id)
        ri.rtr_fip_subnet = None
    if (not self.destroyed):
        fns_ip = ip_lib.IPWrapper(namespace=fip_ns_name)
        if fns_ip.device(fip_2_rtr_name).exists():
            fns_ip.del_veth(fip_2_rtr_name)
