Return ip routing information for Linux distros
    (netstat is deprecated and may not be available)

def _ip_route_linux():
    '''
    Return ip routing information for Linux distros
    (netstat is deprecated and may not be available)
    '''
    # table main closest to old netstat inet output
    ret = []
    cmd = 'ip -4 route show table main'
    out = __salt__['cmd.run'](cmd, python_shell=True)
    for line in out.splitlines():
        comps = line.split()

        # need to fake similar output to that provided by netstat
        # to maintain output format
        if comps[0] == "unreachable":
            continue

        if comps[0] == "default":
            ip_interface = ''
            if comps[3] == "dev":
                ip_interface = comps[4]

            ret.append({
                'addr_family': 'inet',
                'destination': '0.0.0.0',
                'gateway': comps[2],
                'netmask': '0.0.0.0',
                'flags': 'UG',
                'interface': ip_interface})
        else:
            address_mask = convert_cidr(comps[0])
            ip_interface = ''
            if comps[1] == "dev":
                ip_interface = comps[2]

            ret.append({
                'addr_family': 'inet',
                'destination': address_mask['network'],
                'gateway': '0.0.0.0',
                'netmask': address_mask['netmask'],
                'flags': 'U',
                'interface': ip_interface})

    # table all closest to old netstat inet6 output
    cmd = 'ip -6 route show table all'
    out = __salt__['cmd.run'](cmd, python_shell=True)
    for line in out.splitlines():
        comps = line.split()

        # need to fake similar output to that provided by netstat
        # to maintain output format
        if comps[0] == "unreachable":
            continue

        if comps[0] == "default":
            ip_interface = ''
            if comps[3] == "dev":
                ip_interface = comps[4]

            ret.append({
                'addr_family': 'inet6',
                'destination': '::/0',
                'gateway': comps[2],
                'netmask': '',
                'flags': 'UG',
                'interface': ip_interface})

        elif comps[0] == "local":
            ip_interface = ''
            if comps[2] == "dev":
                ip_interface = comps[3]

            local_address = comps[1] + "/128"
            ret.append({
                'addr_family': 'inet6',
                'destination': local_address,
                'gateway': '::',
                'netmask': '',
                'flags': 'U',
                'interface': ip_interface})
        else:
            address_mask = convert_cidr(comps[0])
            ip_interface = ''
            if comps[1] == "dev":
                ip_interface = comps[2]

            ret.append({
                'addr_family': 'inet6',
                'destination': comps[0],
                'gateway': '::',
                'netmask': '',
                'flags': 'U',
                'interface': ip_interface})
    return ret