The default gateway will generated automatically after it wasdeleted.

Discussion in 'Linux Networking' started by Hongyi Zhao, Nov 3, 2015.

  1. Hongyi Zhao

    Hongyi Zhao Guest

    Hi all,

    The eth0 is the default network card through which I will access the

    And the default gateway in the main table looks this:

    default via dev eth0 proto static metric 1024

    Now, I want to use the policy-based routing with multiple tables and
    don't need the this default gateway any more. So I use the following
    command to delete it:

    sudo ip route del table main default via dev eth0 proto
    static metric 1024

    But, after I deleted this default gateway, it will be generated
    automatically by the operating system.

    So, how to let the operating system don't generated this default gateway
    automatically after it was deleted.

    Hongyi Zhao, Nov 3, 2015
    1. Advertisements

  2. Hello,

    Hongyi Zhao a écrit :
    Note that a default route may still be required in some cases, otherwise
    the initial routing decision may fail due to the lack of suitable route.
    E.g. : routing based on marks set by iptables on locally generated packets.
    It depends how the interface is managed and configured.
    Pascal Hambourg, Nov 3, 2015
    1. Advertisements

  3. Yes. Why would you want to get rid of the default gateway? Leave it
    there. The computer wants to know what to do with stuff which falls off
    the end of the routing table.
    Especially if your routing table does not cover all eventualities, it
    needs to know what to do with stuff not in the routing table. That has
    nothing to do with policy-based or multiple tables.
    William Unruh, Nov 3, 2015
  4. Hongyi Zhao

    Marc Haber Guest


    Show exactly what happens, and while you're at it, check whether
    you're running network-manager or systemd-networkd or wicd or some
    other IP address manager software. If that is the case, either learn
    how to use it, or get rid of it.

    Marc Haber, Nov 4, 2015
  5. Marc Haber a écrit :
    No ?
    So what ? How would it contradict what the OP wrote ?
    Pascal Hambourg, Nov 4, 2015
  6. I think he is saying that no, the operating system (Linux I presume) is
    not automatically regenerating the default route.
    I think he is suggesting that one of those might be regenerating the
    default route.
    William Unruh, Nov 4, 2015
  7. William Unruh a écrit :
    I think he is wrong.
    So what ? Aren't they part of the system and doing this automatically ?
    Pascal Hambourg, Nov 5, 2015
  8. Hongyi Zhao

    Marc Haber Guest

    Yes, that's what I intended to say.
    Yes. Thanks for understanding and translating me.

    Marc Haber, Nov 5, 2015
  9. Hongyi Zhao

    Marc Haber Guest

    Those tools are userland tools and not part of the operating system
    per se.

    Marc Haber, Nov 5, 2015
  10. Marc Haber a écrit :
    By definition, any software except the kernel is running in userland,
    including softwares such as mdadm (software RAID), LVM, FUSE (filesystem

    Do you claim that the operating system is only the kernel ?
    Pascal Hambourg, Nov 7, 2015
  11. Hongyi Zhao

    Marc Haber Guest

    After posting this article, I spend some time to ponder about that. I
    didn't come up with a usable definition.

    My gut feeling was to distinguish betwen kernel, userland, and
    userland parts that can easily be exchanged with different tools doing
    the same job, network-damager being one example of the latter
    category. For example, I am using network-manager on all machines that
    move and on my UMTS router, all other machines do have plain
    configuration using /etc/network/interfaces or they use

    Marc Haber, Nov 7, 2015
  12. Marc Haber a écrit :
    I disagree. The existence of alternatives is irrelevant. There are
    several alternatives for init, does it mean that init is not part of the
    system ? apt-get can be replaced with aptitude, does it mean it is not
    part of the system ? In my opinion, any software which is essential or
    which purpose it to manage the system is part of the system. Networking
    is a kernel subsystem and NetworkManager serves to manage it, so it is
    definitely a system tool. This is different from pure user applications
    such as browsers, editors, office tools...
    Pascal Hambourg, Nov 8, 2015
  13. Hongyi Zhao

    Marc Haber Guest

    Then we need to agree on that.

    Marc Haber, Nov 8, 2015
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.