'Set the L3 settings for a router interface using data from the port.
ip_cidrs: list of \'X.X.X.X/YY\' strings
preserve_ips: list of ip cidrs that should not be removed from device
clean_connections: Boolean to indicate if we should cleanup connections
associated to removed ips
extra_subnets: An iterable of cidrs to add as routes without address'

def init_router_port(self, device_name, ip_cidrs, namespace, preserve_ips=None, extra_subnets=None, clean_connections=False):

    LOG.debug('init_router_port:    device_name(%s),    namespace(%s)', device_name, namespace)
    self.init_l3(device_name=device_name, ip_cidrs=ip_cidrs, namespace=namespace, preserve_ips=(preserve_ips or []), clean_connections=clean_connections)
    device = ip_lib.IPDevice(device_name, namespace=namespace)
    new_onlink_cidrs = set((s['cidr'] for s in (extra_subnets or [])))
    v4_onlink = device.route.list_onlink_routes(constants.IP_VERSION_4)
    v6_onlink = device.route.list_onlink_routes(constants.IP_VERSION_6)
    existing_onlink_cidrs = set((r['cidr'] for r in (v4_onlink + v6_onlink)))
    for route in (new_onlink_cidrs - existing_onlink_cidrs):
        LOG.debug('adding    onlink    route(%s)', route)
        device.route.add_onlink_route(route)
    for route in ((existing_onlink_cidrs - new_onlink_cidrs) - set((preserve_ips or []))):
        LOG.debug('deleting    onlink    route(%s)', route)
        device.route.delete_onlink_route(route)
