How to load saved iptables rules on rebootingiptables-restore failing to load my rulesiptables-persistent doesn't load rules on bootCorosync & Pacemaker IPTables RulesList active rules in IptablesMasquerade over USB Ethernet ProblemHow do I stop iptables restoring to an earlier version every reboot?boot 14.04 iptables fails intermittentlyRules in iptablesHow to route VLAN subnetworks to my DSL ppp0Long iptables rules efficiency & performance

What are the balance implications behind making invisible things auto-hide?

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

Is there a way to get `mathscr' with lower case letters in pdfLaTeX?

Quoting Keynes in a lecture

Creepy dinosaur pc game identification

Are Captain Marvel's powers affected by Thanos' actions in Infinity War

Does malloc reserve more space while allocating memory?

Why did the EU agree to delay the Brexit deadline?

Multiplicative persistence

Can I still be respawned if I die by falling off the map?

How can mimic phobia be cured?

Does the Linux kernel need a file system to run?

How do I delete all blank lines in a buffer?

What are the advantages of simplicial model categories over non-simplicial ones?

Pre-mixing cryogenic fuels and using only one fuel tank

How do you make your own symbol when Detexify fails?

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

Temporarily disable WLAN internet access for children, but allow it for adults

Plot of a tornado-shaped surface

putting logo on same line but after title, latex

PTIJ: Haman's bad computer

How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?

Angel of Condemnation - Exile creature with second ability

How should I respond when I lied about my education and the company finds out through background check?



How to load saved iptables rules on rebooting


iptables-restore failing to load my rulesiptables-persistent doesn't load rules on bootCorosync & Pacemaker IPTables RulesList active rules in IptablesMasquerade over USB Ethernet ProblemHow do I stop iptables restoring to an earlier version every reboot?boot 14.04 iptables fails intermittentlyRules in iptablesHow to route VLAN subnetworks to my DSL ppp0Long iptables rules efficiency & performance













1















I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.



This is the /etc/network/interfaces on my PC



# ifupdown has been replaced by netplan(5) on this system. See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
# sudo apt install ifupdown

auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
provider dsl-provider

#auto eno1
#iface eno1 inet manual

pre-up iptables-restore < /etc/iptables.rules


This is the /etc/network/interfaces on my VPS



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

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
pre-up iptables-restore < /etc/iptables.rules

source /etc/network/interfaces.d/*









share|improve this question


























    1















    I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.



    This is the /etc/network/interfaces on my PC



    # ifupdown has been replaced by netplan(5) on this system. See
    # /etc/netplan for current configuration.
    # To re-enable ifupdown on this system, you can run:
    # sudo apt install ifupdown

    auto dsl-provider
    iface dsl-provider inet ppp
    pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
    provider dsl-provider

    #auto eno1
    #iface eno1 inet manual

    pre-up iptables-restore < /etc/iptables.rules


    This is the /etc/network/interfaces on my VPS



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

    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    pre-up iptables-restore < /etc/iptables.rules

    source /etc/network/interfaces.d/*









    share|improve this question
























      1












      1








      1








      I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.



      This is the /etc/network/interfaces on my PC



      # ifupdown has been replaced by netplan(5) on this system. See
      # /etc/netplan for current configuration.
      # To re-enable ifupdown on this system, you can run:
      # sudo apt install ifupdown

      auto dsl-provider
      iface dsl-provider inet ppp
      pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
      provider dsl-provider

      #auto eno1
      #iface eno1 inet manual

      pre-up iptables-restore < /etc/iptables.rules


      This is the /etc/network/interfaces on my VPS



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

      # The loopback network interface
      auto lo
      iface lo inet loopback

      auto eth0
      iface eth0 inet static
      pre-up iptables-restore < /etc/iptables.rules

      source /etc/network/interfaces.d/*









      share|improve this question














      I used pre-up in /etc/network/interfaces. It's strange, I have two Ubuntu server, one a PC and another a VPS. This method works on my PC but not on my VPS.



      This is the /etc/network/interfaces on my PC



      # ifupdown has been replaced by netplan(5) on this system. See
      # /etc/netplan for current configuration.
      # To re-enable ifupdown on this system, you can run:
      # sudo apt install ifupdown

      auto dsl-provider
      iface dsl-provider inet ppp
      pre-up /bin/ip link set eno1 up # line maintained by pppoeconf
      provider dsl-provider

      #auto eno1
      #iface eno1 inet manual

      pre-up iptables-restore < /etc/iptables.rules


      This is the /etc/network/interfaces on my VPS



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

      # The loopback network interface
      auto lo
      iface lo inet loopback

      auto eth0
      iface eth0 inet static
      pre-up iptables-restore < /etc/iptables.rules

      source /etc/network/interfaces.d/*






      iptables netplan






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 18 at 15:34









      Tom HsiungTom Hsiung

      61




      61




















          1 Answer
          1






          active

          oldest

          votes


















          0














          Netplan does not support hook scripts:



          https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts



          The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.



          The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:



          #!/bin/sh

          for d in up post-up; do
          hookdir=/etc/network/if-$d.d
          [ -e $hookdir ] && /bin/run-parts $hookdir
          done
          exit 0


          Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:



          #!/bin/sh

          for d in down post-down; do
          hookdir=/etc/network/if-$d.d
          [ -e $hookdir ] && /bin/run-parts $hookdir
          done
          exit 0





          share|improve this answer






















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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%2faskubuntu.com%2fquestions%2f1119257%2fhow-to-load-saved-iptables-rules-on-rebooting%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














            Netplan does not support hook scripts:



            https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts



            The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.



            The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:



            #!/bin/sh

            for d in up post-up; do
            hookdir=/etc/network/if-$d.d
            [ -e $hookdir ] && /bin/run-parts $hookdir
            done
            exit 0


            Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:



            #!/bin/sh

            for d in down post-down; do
            hookdir=/etc/network/if-$d.d
            [ -e $hookdir ] && /bin/run-parts $hookdir
            done
            exit 0





            share|improve this answer



























              0














              Netplan does not support hook scripts:



              https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts



              The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.



              The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:



              #!/bin/sh

              for d in up post-up; do
              hookdir=/etc/network/if-$d.d
              [ -e $hookdir ] && /bin/run-parts $hookdir
              done
              exit 0


              Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:



              #!/bin/sh

              for d in down post-down; do
              hookdir=/etc/network/if-$d.d
              [ -e $hookdir ] && /bin/run-parts $hookdir
              done
              exit 0





              share|improve this answer

























                0












                0








                0







                Netplan does not support hook scripts:



                https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts



                The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.



                The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:



                #!/bin/sh

                for d in up post-up; do
                hookdir=/etc/network/if-$d.d
                [ -e $hookdir ] && /bin/run-parts $hookdir
                done
                exit 0


                Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:



                #!/bin/sh

                for d in down post-down; do
                hookdir=/etc/network/if-$d.d
                [ -e $hookdir ] && /bin/run-parts $hookdir
                done
                exit 0





                share|improve this answer













                Netplan does not support hook scripts:



                https://netplan.io/faq#use-pre-up-post-up-etc-hook-scripts



                The workaround is to use networkd-dispatcher. The above FAQ gives an example on how to do it.



                The following is an example of using networkd-dispatcher to run existing ifup hooks via a script installed in /etc/networkd-dispatcher/routable.d/50-ifup-hooks:



                #!/bin/sh

                for d in up post-up; do
                hookdir=/etc/network/if-$d.d
                [ -e $hookdir ] && /bin/run-parts $hookdir
                done
                exit 0


                Similarly, here is an example of an ifdown hook installed in /etc/networkd-dispatcher/off.d/50-ifdown-hooks:



                #!/bin/sh

                for d in down post-down; do
                hookdir=/etc/network/if-$d.d
                [ -e $hookdir ] && /bin/run-parts $hookdir
                done
                exit 0






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                whbogadowhbogado

                1012




                1012



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f1119257%2fhow-to-load-saved-iptables-rules-on-rebooting%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

                    Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

                    Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch

                    fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap