Linux Routing Question, more specific route still using default route












1















Trying to route NNN.130.0.0 via NNN.NNN.206.254 however it appears to still be using the default gateway. What am I missing here?



root@xxxxxx ~ # route add -net NNN.130.0.0 netmask 255.255.255.0 gw NNN.NNN.206.254 eth0
root@xxxxxx ~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
NNN.130.0.0 NNN.NNN.206.254 255.255.255.0 UG 0 0 0 eth0
NNN.NNN.240.0 NNN.NNN.192.1 255.255.254.0 UG 0 0 0 eth0
NNN.NNN.248.0 NNN.NNN.193.1 255.255.254.0 UG 0 0 0 eth0
172.21.124.0 NNN.NNN.193.1 255.255.252.0 UG 0 0 0 eth0
172.20.124.0 NNN.NNN.192.1 255.255.252.0 UG 0 0 0 eth0
NNN.NNN.64.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.128.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.0.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.160.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.192.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
NNN.9.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 NNN.NNN.192.1 0.0.0.0 UG 0 0 0 eth0

root@xxxxxx ~ # ip route get NNN.130.20.35
NNN.130.20.35 via NNN.NNN.192.1 dev eth0 src NNN.NNN.192.62









share|improve this question







New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

    – roaima
    3 hours ago













  • All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

    – Brian
    2 hours ago


















1















Trying to route NNN.130.0.0 via NNN.NNN.206.254 however it appears to still be using the default gateway. What am I missing here?



root@xxxxxx ~ # route add -net NNN.130.0.0 netmask 255.255.255.0 gw NNN.NNN.206.254 eth0
root@xxxxxx ~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
NNN.130.0.0 NNN.NNN.206.254 255.255.255.0 UG 0 0 0 eth0
NNN.NNN.240.0 NNN.NNN.192.1 255.255.254.0 UG 0 0 0 eth0
NNN.NNN.248.0 NNN.NNN.193.1 255.255.254.0 UG 0 0 0 eth0
172.21.124.0 NNN.NNN.193.1 255.255.252.0 UG 0 0 0 eth0
172.20.124.0 NNN.NNN.192.1 255.255.252.0 UG 0 0 0 eth0
NNN.NNN.64.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.128.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.0.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.160.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.192.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
NNN.9.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 NNN.NNN.192.1 0.0.0.0 UG 0 0 0 eth0

root@xxxxxx ~ # ip route get NNN.130.20.35
NNN.130.20.35 via NNN.NNN.192.1 dev eth0 src NNN.NNN.192.62









share|improve this question







New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

    – roaima
    3 hours ago













  • All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

    – Brian
    2 hours ago
















1












1








1








Trying to route NNN.130.0.0 via NNN.NNN.206.254 however it appears to still be using the default gateway. What am I missing here?



root@xxxxxx ~ # route add -net NNN.130.0.0 netmask 255.255.255.0 gw NNN.NNN.206.254 eth0
root@xxxxxx ~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
NNN.130.0.0 NNN.NNN.206.254 255.255.255.0 UG 0 0 0 eth0
NNN.NNN.240.0 NNN.NNN.192.1 255.255.254.0 UG 0 0 0 eth0
NNN.NNN.248.0 NNN.NNN.193.1 255.255.254.0 UG 0 0 0 eth0
172.21.124.0 NNN.NNN.193.1 255.255.252.0 UG 0 0 0 eth0
172.20.124.0 NNN.NNN.192.1 255.255.252.0 UG 0 0 0 eth0
NNN.NNN.64.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.128.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.0.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.160.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.192.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
NNN.9.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 NNN.NNN.192.1 0.0.0.0 UG 0 0 0 eth0

root@xxxxxx ~ # ip route get NNN.130.20.35
NNN.130.20.35 via NNN.NNN.192.1 dev eth0 src NNN.NNN.192.62









share|improve this question







New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Trying to route NNN.130.0.0 via NNN.NNN.206.254 however it appears to still be using the default gateway. What am I missing here?



root@xxxxxx ~ # route add -net NNN.130.0.0 netmask 255.255.255.0 gw NNN.NNN.206.254 eth0
root@xxxxxx ~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
NNN.130.0.0 NNN.NNN.206.254 255.255.255.0 UG 0 0 0 eth0
NNN.NNN.240.0 NNN.NNN.192.1 255.255.254.0 UG 0 0 0 eth0
NNN.NNN.248.0 NNN.NNN.193.1 255.255.254.0 UG 0 0 0 eth0
172.21.124.0 NNN.NNN.193.1 255.255.252.0 UG 0 0 0 eth0
172.20.124.0 NNN.NNN.192.1 255.255.252.0 UG 0 0 0 eth0
NNN.NNN.64.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.128.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.0.0 NNN.NNN.192.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.160.0 NNN.NNN.193.1 255.255.248.0 UG 0 0 0 eth0
NNN.NNN.192.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
NNN.9.0.0 0.0.0.0 255.255.240.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
0.0.0.0 NNN.NNN.192.1 0.0.0.0 UG 0 0 0 eth0

root@xxxxxx ~ # ip route get NNN.130.20.35
NNN.130.20.35 via NNN.NNN.192.1 dev eth0 src NNN.NNN.192.62






linux route






share|improve this question







New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









BrianBrian

91




91




New contributor




Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Brian is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

    – roaima
    3 hours ago













  • All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

    – Brian
    2 hours ago





















  • Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

    – roaima
    3 hours ago













  • All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

    – Brian
    2 hours ago



















Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

– roaima
3 hours ago







Are all those NNN exactly the same? If not, please go back and add a set of self-consistent values. So N might be 192 everywhere, and M might be 172 everywhere, and so on, but each letter will never represent anything other than one value.

– roaima
3 hours ago















All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

– Brian
2 hours ago







All values are the same. You can replace with 222. so 222.222.206.254 would be valid for NNN.NNN.206.254.

– Brian
2 hours ago












1 Answer
1






active

oldest

votes


















0














There is no explicit route for the address NNN.130.20.35 so it takes the default.



I wonder if you're muddling NNN.130.20.35 with the unrelated subnet NNN.130.0.0/24.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Brian is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498673%2flinux-routing-question-more-specific-route-still-using-default-route%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    There is no explicit route for the address NNN.130.20.35 so it takes the default.



    I wonder if you're muddling NNN.130.20.35 with the unrelated subnet NNN.130.0.0/24.






    share|improve this answer




























      0














      There is no explicit route for the address NNN.130.20.35 so it takes the default.



      I wonder if you're muddling NNN.130.20.35 with the unrelated subnet NNN.130.0.0/24.






      share|improve this answer


























        0












        0








        0







        There is no explicit route for the address NNN.130.20.35 so it takes the default.



        I wonder if you're muddling NNN.130.20.35 with the unrelated subnet NNN.130.0.0/24.






        share|improve this answer













        There is no explicit route for the address NNN.130.20.35 so it takes the default.



        I wonder if you're muddling NNN.130.20.35 with the unrelated subnet NNN.130.0.0/24.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        roaimaroaima

        44.4k555119




        44.4k555119






















            Brian is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Brian is a new contributor. Be nice, and check out our Code of Conduct.













            Brian is a new contributor. Be nice, and check out our Code of Conduct.












            Brian is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498673%2flinux-routing-question-more-specific-route-still-using-default-route%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Entries order in /etc/network/interfaces

            新発田市

            Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)