Defauft gateway permanent change in centos 7

Multi tool use
Multi tool use

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











up vote
1
down vote

favorite












i have 2 nic attached to my VM(centos 7) 1st is NAT, and 2nd is Host only adapter.
the hostonly adapter has become the default gateway, and is restricting my internet access, i want to make my NAT (1st enp0s3) to become the default gateway.
i have tried this, but still upon reboot the host only becomes the default gateway.



# route del default gw 192.168.43.1
# route add default gw 10.0.2.2 metric 100
# route add default gw 192.168.43.1 metric 101


current scenario.



[root@node1 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.43.1 0.0.0.0 UG 100 0 0 enp0s8
0.0.0.0 10.0.2.2 0.0.0.0 UG 101 0 0 enp0s3
10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
192.168.43.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8






share|improve this question
























    up vote
    1
    down vote

    favorite












    i have 2 nic attached to my VM(centos 7) 1st is NAT, and 2nd is Host only adapter.
    the hostonly adapter has become the default gateway, and is restricting my internet access, i want to make my NAT (1st enp0s3) to become the default gateway.
    i have tried this, but still upon reboot the host only becomes the default gateway.



    # route del default gw 192.168.43.1
    # route add default gw 10.0.2.2 metric 100
    # route add default gw 192.168.43.1 metric 101


    current scenario.



    [root@node1 ~]# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.43.1 0.0.0.0 UG 100 0 0 enp0s8
    0.0.0.0 10.0.2.2 0.0.0.0 UG 101 0 0 enp0s3
    10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
    192.168.43.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8






    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      i have 2 nic attached to my VM(centos 7) 1st is NAT, and 2nd is Host only adapter.
      the hostonly adapter has become the default gateway, and is restricting my internet access, i want to make my NAT (1st enp0s3) to become the default gateway.
      i have tried this, but still upon reboot the host only becomes the default gateway.



      # route del default gw 192.168.43.1
      # route add default gw 10.0.2.2 metric 100
      # route add default gw 192.168.43.1 metric 101


      current scenario.



      [root@node1 ~]# route -n
      Kernel IP routing table
      Destination Gateway Genmask Flags Metric Ref Use Iface
      0.0.0.0 192.168.43.1 0.0.0.0 UG 100 0 0 enp0s8
      0.0.0.0 10.0.2.2 0.0.0.0 UG 101 0 0 enp0s3
      10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
      192.168.43.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8






      share|improve this question












      i have 2 nic attached to my VM(centos 7) 1st is NAT, and 2nd is Host only adapter.
      the hostonly adapter has become the default gateway, and is restricting my internet access, i want to make my NAT (1st enp0s3) to become the default gateway.
      i have tried this, but still upon reboot the host only becomes the default gateway.



      # route del default gw 192.168.43.1
      # route add default gw 10.0.2.2 metric 100
      # route add default gw 192.168.43.1 metric 101


      current scenario.



      [root@node1 ~]# route -n
      Kernel IP routing table
      Destination Gateway Genmask Flags Metric Ref Use Iface
      0.0.0.0 192.168.43.1 0.0.0.0 UG 100 0 0 enp0s8
      0.0.0.0 10.0.2.2 0.0.0.0 UG 101 0 0 enp0s3
      10.0.2.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
      192.168.43.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8








      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 25 '17 at 9:56









      Mohd

      146114




      146114

























          active

          oldest

          votes











          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412924%2fdefauft-gateway-permanent-change-in-centos-7%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412924%2fdefauft-gateway-permanent-change-in-centos-7%23new-answer', 'question_page');

          );

          Post as a guest













































































          C,1ah ukJo,5r7oO9t,JKGTIhQ1SSJVbjUiBhA6Qjk ovf9YTHQTSf
          BVE0NG0oiw9s,iZ RRWoPlZ,cK5qQR4 ROOrs svVXl460Corux6

          Popular posts from this blog

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

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS