how to setup virtual network interface and using iptables forwarding to route between virtual network...

Did Kevin spill real chili?

I need to find the potential function of a vector field.

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

Is it true to say that an hosting provider's DNS server is what links the entire hosting environment to ICANN?

Is there a service that would inform me whenever a new direct route is scheduled from a given airport?

3 doors, three guards, one stone

How much radiation do nuclear physics experiments expose researchers to nowadays?

How to motivate offshore teams and trust them to deliver?

Letter Boxed validator

Difference between these two cards?

How do I stop a creek from eroding my steep embankment?

Doubts about chords

Sorting numerically

Why does Python start at index -1 when indexing a list from the end?

Why is black pepper both grey and black?

What does the "x" in "x86" represent?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?

Bonus calculation: Am I making a mountain out of a molehill?

How do I mention the quality of my school without bragging

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

Should I discuss the type of campaign with my players?

Why are there no cargo aircraft with "flying wing" design?

How to bypass password on Windows XP account?

Java 8 stream max() function argument type Comparator vs Comparable



how to setup virtual network interface and using iptables forwarding to route between virtual network interfaces?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Is this firewall completely secure?Routing table on Linux not respectedneed iptables rule to accept all incoming trafficHow do I forward traffic between Tun device and eth0?EVIL AP - Internet connection bridging issueRoute/Forward all traffic through deviceLinux box (as router) not forwarding traffic (between interfaces)OpenVPN - redirect-gateway not workingConfigure tunnel adapter for VPN client on Ubuntu 16.04 Desktop?Routing between bridge network and host interface?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am trying to setup mutli network interfaces because I would like to do multi traffic-control at once.

My device only support one physical network interface.



So my thought is to set one network interface and ip route default to it.

Then base on different iptable polcy, the packets can go through different virtual network interfaces which is bond traffic-control policy.

Then all the packets should go through physic network interface to reach wan.



$ sudo ifconfig enp0s5:3 123.123.22.23
$ sudo ip route add 0.0.0.0/0 via 123.123.22.23 dev enp0s5:3

$ sudo iptables -t nat -A POSTROUTING -o enp0s5:3 -j MASQUERADE
$ sudo IPTABLES -A FORWARD -i enp0s5:3 -o enp0s5 -m state --state RELATED,ESTABLISHED -j ACCEPT
$ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -j ACCEPT
$ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -m state --state RELATED,ESTABLISHED -j ACCEPT
$ sudo iptables -A FORWARD -i enp0s5:3 -o enp0s5 -j ACCEPT


However, I setup this but the packets not going outside.

I ping google.com and it said failed no route to host.



enter image description here










share|improve this question





























    0















    I am trying to setup mutli network interfaces because I would like to do multi traffic-control at once.

    My device only support one physical network interface.



    So my thought is to set one network interface and ip route default to it.

    Then base on different iptable polcy, the packets can go through different virtual network interfaces which is bond traffic-control policy.

    Then all the packets should go through physic network interface to reach wan.



    $ sudo ifconfig enp0s5:3 123.123.22.23
    $ sudo ip route add 0.0.0.0/0 via 123.123.22.23 dev enp0s5:3

    $ sudo iptables -t nat -A POSTROUTING -o enp0s5:3 -j MASQUERADE
    $ sudo IPTABLES -A FORWARD -i enp0s5:3 -o enp0s5 -m state --state RELATED,ESTABLISHED -j ACCEPT
    $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -j ACCEPT
    $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -m state --state RELATED,ESTABLISHED -j ACCEPT
    $ sudo iptables -A FORWARD -i enp0s5:3 -o enp0s5 -j ACCEPT


    However, I setup this but the packets not going outside.

    I ping google.com and it said failed no route to host.



    enter image description here










    share|improve this question

























      0












      0








      0








      I am trying to setup mutli network interfaces because I would like to do multi traffic-control at once.

      My device only support one physical network interface.



      So my thought is to set one network interface and ip route default to it.

      Then base on different iptable polcy, the packets can go through different virtual network interfaces which is bond traffic-control policy.

      Then all the packets should go through physic network interface to reach wan.



      $ sudo ifconfig enp0s5:3 123.123.22.23
      $ sudo ip route add 0.0.0.0/0 via 123.123.22.23 dev enp0s5:3

      $ sudo iptables -t nat -A POSTROUTING -o enp0s5:3 -j MASQUERADE
      $ sudo IPTABLES -A FORWARD -i enp0s5:3 -o enp0s5 -m state --state RELATED,ESTABLISHED -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -m state --state RELATED,ESTABLISHED -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5:3 -o enp0s5 -j ACCEPT


      However, I setup this but the packets not going outside.

      I ping google.com and it said failed no route to host.



      enter image description here










      share|improve this question














      I am trying to setup mutli network interfaces because I would like to do multi traffic-control at once.

      My device only support one physical network interface.



      So my thought is to set one network interface and ip route default to it.

      Then base on different iptable polcy, the packets can go through different virtual network interfaces which is bond traffic-control policy.

      Then all the packets should go through physic network interface to reach wan.



      $ sudo ifconfig enp0s5:3 123.123.22.23
      $ sudo ip route add 0.0.0.0/0 via 123.123.22.23 dev enp0s5:3

      $ sudo iptables -t nat -A POSTROUTING -o enp0s5:3 -j MASQUERADE
      $ sudo IPTABLES -A FORWARD -i enp0s5:3 -o enp0s5 -m state --state RELATED,ESTABLISHED -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5 -o enp0s5:3 -m state --state RELATED,ESTABLISHED -j ACCEPT
      $ sudo iptables -A FORWARD -i enp0s5:3 -o enp0s5 -j ACCEPT


      However, I setup this but the packets not going outside.

      I ping google.com and it said failed no route to host.



      enter image description here







      linux networking routing iptables






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      鄭元傑鄭元傑

      1013




      1013






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1425462%2fhow-to-setup-virtual-network-interface-and-using-iptables-forwarding-to-route-be%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1425462%2fhow-to-setup-virtual-network-interface-and-using-iptables-forwarding-to-route-be%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

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...