Routing with two different gateways

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have the following problem. I cant ping 8.8.4.4



ping -I ens192 8.8.4.4

PING 8.8.4.4 (8.8.4.4) from 192.168.4.44 ens192: 56(84) bytes of data.
^C
--- 8.8.4.4 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1023ms


ping -I ens192:1 8.8.4.4
ping: invalid source address ens192:1


My network consist of 1 Network interface and on second virtual on top of it. And two gateways for it. Both gateways need to be configuerd.



I checked befor and the google server is reachable with the normal gateway line in Debian. From both Gateways.
So how do i get it to work ?



My interface config file



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens192
allow-hotplug ens192
iface ens192 inet static
address 192.168.4.44
netmask 255.255.255.0
post-up ip route add 192.168.4.0/24 dev ens192 src 192.168.4.44 table rt1
post-up ip route add default via 192.168.4.1 dev ens192 table rt1
post-up ip rule add from 192.168.4.44/32 table rt1
post-up ip rule add to 192.168.4.44/32 table rt1

auto ens192:1
allow-hotplug ens192:1
iface ens192:1 inet static
address 192.168.4.201
netmask 255.255.255.0
post-up ip route add 192.168.4.0/24 dev ens192:1 src 192.168.4.201 table rt2
post-up ip route add default via 192.168.4.3 dev ens192 table rt2
post-up ip rule add from 192.168.4.201/32 table rt2
post-up ip rule add to 192.168.4.201/32 table rt2









share|improve this question









New contributor




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























    up vote
    0
    down vote

    favorite












    I have the following problem. I cant ping 8.8.4.4



    ping -I ens192 8.8.4.4

    PING 8.8.4.4 (8.8.4.4) from 192.168.4.44 ens192: 56(84) bytes of data.
    ^C
    --- 8.8.4.4 ping statistics ---
    2 packets transmitted, 0 received, 100% packet loss, time 1023ms


    ping -I ens192:1 8.8.4.4
    ping: invalid source address ens192:1


    My network consist of 1 Network interface and on second virtual on top of it. And two gateways for it. Both gateways need to be configuerd.



    I checked befor and the google server is reachable with the normal gateway line in Debian. From both Gateways.
    So how do i get it to work ?



    My interface config file



    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    source /etc/network/interfaces.d/*

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    auto ens192
    allow-hotplug ens192
    iface ens192 inet static
    address 192.168.4.44
    netmask 255.255.255.0
    post-up ip route add 192.168.4.0/24 dev ens192 src 192.168.4.44 table rt1
    post-up ip route add default via 192.168.4.1 dev ens192 table rt1
    post-up ip rule add from 192.168.4.44/32 table rt1
    post-up ip rule add to 192.168.4.44/32 table rt1

    auto ens192:1
    allow-hotplug ens192:1
    iface ens192:1 inet static
    address 192.168.4.201
    netmask 255.255.255.0
    post-up ip route add 192.168.4.0/24 dev ens192:1 src 192.168.4.201 table rt2
    post-up ip route add default via 192.168.4.3 dev ens192 table rt2
    post-up ip rule add from 192.168.4.201/32 table rt2
    post-up ip rule add to 192.168.4.201/32 table rt2









    share|improve this question









    New contributor




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





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have the following problem. I cant ping 8.8.4.4



      ping -I ens192 8.8.4.4

      PING 8.8.4.4 (8.8.4.4) from 192.168.4.44 ens192: 56(84) bytes of data.
      ^C
      --- 8.8.4.4 ping statistics ---
      2 packets transmitted, 0 received, 100% packet loss, time 1023ms


      ping -I ens192:1 8.8.4.4
      ping: invalid source address ens192:1


      My network consist of 1 Network interface and on second virtual on top of it. And two gateways for it. Both gateways need to be configuerd.



      I checked befor and the google server is reachable with the normal gateway line in Debian. From both Gateways.
      So how do i get it to work ?



      My interface config file



      # This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).

      source /etc/network/interfaces.d/*

      # The loopback network interface
      auto lo
      iface lo inet loopback

      # The primary network interface
      auto ens192
      allow-hotplug ens192
      iface ens192 inet static
      address 192.168.4.44
      netmask 255.255.255.0
      post-up ip route add 192.168.4.0/24 dev ens192 src 192.168.4.44 table rt1
      post-up ip route add default via 192.168.4.1 dev ens192 table rt1
      post-up ip rule add from 192.168.4.44/32 table rt1
      post-up ip rule add to 192.168.4.44/32 table rt1

      auto ens192:1
      allow-hotplug ens192:1
      iface ens192:1 inet static
      address 192.168.4.201
      netmask 255.255.255.0
      post-up ip route add 192.168.4.0/24 dev ens192:1 src 192.168.4.201 table rt2
      post-up ip route add default via 192.168.4.3 dev ens192 table rt2
      post-up ip rule add from 192.168.4.201/32 table rt2
      post-up ip rule add to 192.168.4.201/32 table rt2









      share|improve this question









      New contributor




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











      I have the following problem. I cant ping 8.8.4.4



      ping -I ens192 8.8.4.4

      PING 8.8.4.4 (8.8.4.4) from 192.168.4.44 ens192: 56(84) bytes of data.
      ^C
      --- 8.8.4.4 ping statistics ---
      2 packets transmitted, 0 received, 100% packet loss, time 1023ms


      ping -I ens192:1 8.8.4.4
      ping: invalid source address ens192:1


      My network consist of 1 Network interface and on second virtual on top of it. And two gateways for it. Both gateways need to be configuerd.



      I checked befor and the google server is reachable with the normal gateway line in Debian. From both Gateways.
      So how do i get it to work ?



      My interface config file



      # This file describes the network interfaces available on your system
      # and how to activate them. For more information, see interfaces(5).

      source /etc/network/interfaces.d/*

      # The loopback network interface
      auto lo
      iface lo inet loopback

      # The primary network interface
      auto ens192
      allow-hotplug ens192
      iface ens192 inet static
      address 192.168.4.44
      netmask 255.255.255.0
      post-up ip route add 192.168.4.0/24 dev ens192 src 192.168.4.44 table rt1
      post-up ip route add default via 192.168.4.1 dev ens192 table rt1
      post-up ip rule add from 192.168.4.44/32 table rt1
      post-up ip rule add to 192.168.4.44/32 table rt1

      auto ens192:1
      allow-hotplug ens192:1
      iface ens192:1 inet static
      address 192.168.4.201
      netmask 255.255.255.0
      post-up ip route add 192.168.4.0/24 dev ens192:1 src 192.168.4.201 table rt2
      post-up ip route add default via 192.168.4.3 dev ens192 table rt2
      post-up ip rule add from 192.168.4.201/32 table rt2
      post-up ip rule add to 192.168.4.201/32 table rt2






      networking gateway






      share|improve this question









      New contributor




      Freaky 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




      Freaky 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








      edited 46 mins ago









      Rui F Ribeiro

      38k1475123




      38k1475123






      New contributor




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









      asked 2 hours ago









      Freaky

      1




      1




      New contributor




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





      New contributor





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






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




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          A couple of things:



          • Pass the IP address of the interface on -I. I.e. -I 192.168.4.201

          • The default route on the second interface says dev ens192 instead of dev ens192:1

          • I guess that you either can't ping 192.168.4.1 and 192.168.4.3 or there is some additional configuration that's not shown here.





          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',
            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
            );



            );






            Freaky 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%2f481021%2frouting-with-two-different-gateways%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            A couple of things:



            • Pass the IP address of the interface on -I. I.e. -I 192.168.4.201

            • The default route on the second interface says dev ens192 instead of dev ens192:1

            • I guess that you either can't ping 192.168.4.1 and 192.168.4.3 or there is some additional configuration that's not shown here.





            share|improve this answer
























              up vote
              0
              down vote













              A couple of things:



              • Pass the IP address of the interface on -I. I.e. -I 192.168.4.201

              • The default route on the second interface says dev ens192 instead of dev ens192:1

              • I guess that you either can't ping 192.168.4.1 and 192.168.4.3 or there is some additional configuration that's not shown here.





              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                A couple of things:



                • Pass the IP address of the interface on -I. I.e. -I 192.168.4.201

                • The default route on the second interface says dev ens192 instead of dev ens192:1

                • I guess that you either can't ping 192.168.4.1 and 192.168.4.3 or there is some additional configuration that's not shown here.





                share|improve this answer












                A couple of things:



                • Pass the IP address of the interface on -I. I.e. -I 192.168.4.201

                • The default route on the second interface says dev ens192 instead of dev ens192:1

                • I guess that you either can't ping 192.168.4.1 and 192.168.4.3 or there is some additional configuration that's not shown here.






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                V13

                2,593613




                2,593613




















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









                     

                    draft saved


                    draft discarded


















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












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











                    Freaky 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%2f481021%2frouting-with-two-different-gateways%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?