setting firewall-cmd --permanent is not sticking after reboot












2














I have two network interfaces: eth0, and p2p1. My default zone is set to public. I would like to permanently set p2p1 to be trusted.



In order the achieve this I run:



sudo firewall-cmd --permanent --change-zone=p2p1 --zone=trusted


after that I get this:



The interface is under control of NetworkManager, setting zone to 'trusted'.
success


(I have netplan controlling my network.) To check if all is good I do:



sudo firewall-cmd --get-active-zones
public
interfaces: eth0
trusted
interfaces: p2p1


But after a reboot it is all gone. How can I make this stick?



Update: I found this "To permanently assign the eth0 network interface to the internal zone (a file called internal.xml is created in the /etc/firewalld/zones directory... "



root@me:~# nmcli con show | grep p2p1
netplan-p2p1 44db1fb7-b83f-36aa-8dd1-faa6fb97f6c4 ethernet p2p1
p2p1 3ad65062-db85-4ba6-9104-76644e78a5c4 ethernet --
p2p1 c3297794-7641-4033-9f68-156f26ffe024 ethernet --
root@me:~# nmcli con mod "netplan-p2p1" connection.zone trusted
root@me:~# nmcli con up "netplan-p2p1"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)


... the above calls changed p2p1 to zone=trusted. But same problem -- it is not sticking.



I am on an Ubuntu 18.10 system, so adding a config file like suggested here will not work. Not sure, but I am assuming I need to add some script in "/etc/network/if-up.d" folder.



Update 2: netplan config file 01-netcfg.yaml



network:
version: 2
renderer: NetworkManager
ethernets:
# WAN
eth0:
dhcp4: no
dhcp6: no
addresses: [76.80.54.221/29]
gateway4: 76.80.54.217
nameservers:
addresses: [209.18.47.61,209.18.47.62]
# LAN
p2p1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.99/24]
gateway4: 192.168.1.100









share|improve this question









New contributor




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

























    2














    I have two network interfaces: eth0, and p2p1. My default zone is set to public. I would like to permanently set p2p1 to be trusted.



    In order the achieve this I run:



    sudo firewall-cmd --permanent --change-zone=p2p1 --zone=trusted


    after that I get this:



    The interface is under control of NetworkManager, setting zone to 'trusted'.
    success


    (I have netplan controlling my network.) To check if all is good I do:



    sudo firewall-cmd --get-active-zones
    public
    interfaces: eth0
    trusted
    interfaces: p2p1


    But after a reboot it is all gone. How can I make this stick?



    Update: I found this "To permanently assign the eth0 network interface to the internal zone (a file called internal.xml is created in the /etc/firewalld/zones directory... "



    root@me:~# nmcli con show | grep p2p1
    netplan-p2p1 44db1fb7-b83f-36aa-8dd1-faa6fb97f6c4 ethernet p2p1
    p2p1 3ad65062-db85-4ba6-9104-76644e78a5c4 ethernet --
    p2p1 c3297794-7641-4033-9f68-156f26ffe024 ethernet --
    root@me:~# nmcli con mod "netplan-p2p1" connection.zone trusted
    root@me:~# nmcli con up "netplan-p2p1"
    Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)


    ... the above calls changed p2p1 to zone=trusted. But same problem -- it is not sticking.



    I am on an Ubuntu 18.10 system, so adding a config file like suggested here will not work. Not sure, but I am assuming I need to add some script in "/etc/network/if-up.d" folder.



    Update 2: netplan config file 01-netcfg.yaml



    network:
    version: 2
    renderer: NetworkManager
    ethernets:
    # WAN
    eth0:
    dhcp4: no
    dhcp6: no
    addresses: [76.80.54.221/29]
    gateway4: 76.80.54.217
    nameservers:
    addresses: [209.18.47.61,209.18.47.62]
    # LAN
    p2p1:
    dhcp4: no
    dhcp6: no
    addresses: [192.168.1.99/24]
    gateway4: 192.168.1.100









    share|improve this question









    New contributor




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























      2












      2








      2







      I have two network interfaces: eth0, and p2p1. My default zone is set to public. I would like to permanently set p2p1 to be trusted.



      In order the achieve this I run:



      sudo firewall-cmd --permanent --change-zone=p2p1 --zone=trusted


      after that I get this:



      The interface is under control of NetworkManager, setting zone to 'trusted'.
      success


      (I have netplan controlling my network.) To check if all is good I do:



      sudo firewall-cmd --get-active-zones
      public
      interfaces: eth0
      trusted
      interfaces: p2p1


      But after a reboot it is all gone. How can I make this stick?



      Update: I found this "To permanently assign the eth0 network interface to the internal zone (a file called internal.xml is created in the /etc/firewalld/zones directory... "



      root@me:~# nmcli con show | grep p2p1
      netplan-p2p1 44db1fb7-b83f-36aa-8dd1-faa6fb97f6c4 ethernet p2p1
      p2p1 3ad65062-db85-4ba6-9104-76644e78a5c4 ethernet --
      p2p1 c3297794-7641-4033-9f68-156f26ffe024 ethernet --
      root@me:~# nmcli con mod "netplan-p2p1" connection.zone trusted
      root@me:~# nmcli con up "netplan-p2p1"
      Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)


      ... the above calls changed p2p1 to zone=trusted. But same problem -- it is not sticking.



      I am on an Ubuntu 18.10 system, so adding a config file like suggested here will not work. Not sure, but I am assuming I need to add some script in "/etc/network/if-up.d" folder.



      Update 2: netplan config file 01-netcfg.yaml



      network:
      version: 2
      renderer: NetworkManager
      ethernets:
      # WAN
      eth0:
      dhcp4: no
      dhcp6: no
      addresses: [76.80.54.221/29]
      gateway4: 76.80.54.217
      nameservers:
      addresses: [209.18.47.61,209.18.47.62]
      # LAN
      p2p1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.99/24]
      gateway4: 192.168.1.100









      share|improve this question









      New contributor




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











      I have two network interfaces: eth0, and p2p1. My default zone is set to public. I would like to permanently set p2p1 to be trusted.



      In order the achieve this I run:



      sudo firewall-cmd --permanent --change-zone=p2p1 --zone=trusted


      after that I get this:



      The interface is under control of NetworkManager, setting zone to 'trusted'.
      success


      (I have netplan controlling my network.) To check if all is good I do:



      sudo firewall-cmd --get-active-zones
      public
      interfaces: eth0
      trusted
      interfaces: p2p1


      But after a reboot it is all gone. How can I make this stick?



      Update: I found this "To permanently assign the eth0 network interface to the internal zone (a file called internal.xml is created in the /etc/firewalld/zones directory... "



      root@me:~# nmcli con show | grep p2p1
      netplan-p2p1 44db1fb7-b83f-36aa-8dd1-faa6fb97f6c4 ethernet p2p1
      p2p1 3ad65062-db85-4ba6-9104-76644e78a5c4 ethernet --
      p2p1 c3297794-7641-4033-9f68-156f26ffe024 ethernet --
      root@me:~# nmcli con mod "netplan-p2p1" connection.zone trusted
      root@me:~# nmcli con up "netplan-p2p1"
      Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)


      ... the above calls changed p2p1 to zone=trusted. But same problem -- it is not sticking.



      I am on an Ubuntu 18.10 system, so adding a config file like suggested here will not work. Not sure, but I am assuming I need to add some script in "/etc/network/if-up.d" folder.



      Update 2: netplan config file 01-netcfg.yaml



      network:
      version: 2
      renderer: NetworkManager
      ethernets:
      # WAN
      eth0:
      dhcp4: no
      dhcp6: no
      addresses: [76.80.54.221/29]
      gateway4: 76.80.54.217
      nameservers:
      addresses: [209.18.47.61,209.18.47.62]
      # LAN
      p2p1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.99/24]
      gateway4: 192.168.1.100






      network-interface firewall interface netplan






      share|improve this question









      New contributor




      MeSo2 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




      MeSo2 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 18 hours ago





















      New contributor




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









      asked yesterday









      MeSo2

      113




      113




      New contributor




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





      New contributor





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






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






















          4 Answers
          4






          active

          oldest

          votes


















          1














          I've found a blog post that seems related. Perhaps try to restart the firewall:



          systemctl restart firewalld.service



          This should be done after adding your rule and before rebooting.






          share|improve this answer





















          • I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
            – MeSo2
            22 hours ago












          • It looks like change-zone is not a command that -permanent will support based on this post.
            – MeSo2
            22 hours ago





















          1














          Did you try reloading the firewall instead of restarting it? If not, you can do that as follows:



          firewall-cmd --reload


          In my experience, anytime you use the --permanent switch, you should apply that change using the --reload as stated above.






          share|improve this answer








          New contributor




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


















          • as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
            – MeSo2
            20 hours ago












          • another source that states the same/related problem
            – MeSo2
            20 hours ago





















          1














          Since your interface is controlled by NetworkManager, you can manipulate the connection settings directly using nmcli to permanently set the zone:



          sudo nmcli connection modify p2p1 connection.zone trusted


          The default behaviour for this command is to make the changes in a persistent manner, which will survive across a reboot.






          share|improve this answer





















          • I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
            – MeSo2
            19 hours ago












          • @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
            – Haxiel
            18 hours ago










          • That would be very much appreciated. I will add my netplan info above.
            – MeSo2
            18 hours ago










          • @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
            – Haxiel
            18 hours ago










          • Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
            – MeSo2
            8 mins ago





















          0














          I figured it out -- finally.



          I added a script file zone-for-p2p1 inside the directory /etc/network/if-up.d.



          zone-for-p2p1 script file content:



          #!/bin/sh
          #
          # sets zone for p2p1 adapter to "trusted"
          # to find out adapter name run "nmcli con show | grep p2p1"
          #
          nmcli con mod "netplan-p2p1" connection.zone trusted


          Then I also made sure the file has execution permission:



          sudo chmod +x /etc/network/if-up.d/zone-for-p2p1


          Now doing a reboot the script assigns the proper zone to the adapter. This post helped me add the script.






          share|improve this answer








          New contributor




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


















            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
            });


            }
            });






            MeSo2 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%2f492124%2fsetting-firewall-cmd-permanent-is-not-sticking-after-reboot%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            I've found a blog post that seems related. Perhaps try to restart the firewall:



            systemctl restart firewalld.service



            This should be done after adding your rule and before rebooting.






            share|improve this answer





















            • I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
              – MeSo2
              22 hours ago












            • It looks like change-zone is not a command that -permanent will support based on this post.
              – MeSo2
              22 hours ago


















            1














            I've found a blog post that seems related. Perhaps try to restart the firewall:



            systemctl restart firewalld.service



            This should be done after adding your rule and before rebooting.






            share|improve this answer





















            • I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
              – MeSo2
              22 hours ago












            • It looks like change-zone is not a command that -permanent will support based on this post.
              – MeSo2
              22 hours ago
















            1












            1








            1






            I've found a blog post that seems related. Perhaps try to restart the firewall:



            systemctl restart firewalld.service



            This should be done after adding your rule and before rebooting.






            share|improve this answer












            I've found a blog post that seems related. Perhaps try to restart the firewall:



            systemctl restart firewalld.service



            This should be done after adding your rule and before rebooting.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 23 hours ago









            Crypteya

            545




            545












            • I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
              – MeSo2
              22 hours ago












            • It looks like change-zone is not a command that -permanent will support based on this post.
              – MeSo2
              22 hours ago




















            • I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
              – MeSo2
              22 hours ago












            • It looks like change-zone is not a command that -permanent will support based on this post.
              – MeSo2
              22 hours ago


















            I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
            – MeSo2
            22 hours ago






            I tried what you suggested: "Please note, if you use –permanent switch, the rule will be activate only AFTER the firewall rules have been reloaded or firewalld.service has been restarted." -- but it is not working.
            – MeSo2
            22 hours ago














            It looks like change-zone is not a command that -permanent will support based on this post.
            – MeSo2
            22 hours ago






            It looks like change-zone is not a command that -permanent will support based on this post.
            – MeSo2
            22 hours ago















            1














            Did you try reloading the firewall instead of restarting it? If not, you can do that as follows:



            firewall-cmd --reload


            In my experience, anytime you use the --permanent switch, you should apply that change using the --reload as stated above.






            share|improve this answer








            New contributor




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


















            • as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
              – MeSo2
              20 hours ago












            • another source that states the same/related problem
              – MeSo2
              20 hours ago


















            1














            Did you try reloading the firewall instead of restarting it? If not, you can do that as follows:



            firewall-cmd --reload


            In my experience, anytime you use the --permanent switch, you should apply that change using the --reload as stated above.






            share|improve this answer








            New contributor




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


















            • as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
              – MeSo2
              20 hours ago












            • another source that states the same/related problem
              – MeSo2
              20 hours ago
















            1












            1








            1






            Did you try reloading the firewall instead of restarting it? If not, you can do that as follows:



            firewall-cmd --reload


            In my experience, anytime you use the --permanent switch, you should apply that change using the --reload as stated above.






            share|improve this answer








            New contributor




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









            Did you try reloading the firewall instead of restarting it? If not, you can do that as follows:



            firewall-cmd --reload


            In my experience, anytime you use the --permanent switch, you should apply that change using the --reload as stated above.







            share|improve this answer








            New contributor




            Manuel Florian 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 answer



            share|improve this answer






            New contributor




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









            answered 21 hours ago









            Manuel Florian

            364




            364




            New contributor




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





            New contributor





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






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












            • as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
              – MeSo2
              20 hours ago












            • another source that states the same/related problem
              – MeSo2
              20 hours ago




















            • as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
              – MeSo2
              20 hours ago












            • another source that states the same/related problem
              – MeSo2
              20 hours ago


















            as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
            – MeSo2
            20 hours ago






            as stated above in the link to the post --permanent switch will not work with a --change-zone=p2p1 call. I tried your suggestion, but it too did not work/stick.
            – MeSo2
            20 hours ago














            another source that states the same/related problem
            – MeSo2
            20 hours ago






            another source that states the same/related problem
            – MeSo2
            20 hours ago













            1














            Since your interface is controlled by NetworkManager, you can manipulate the connection settings directly using nmcli to permanently set the zone:



            sudo nmcli connection modify p2p1 connection.zone trusted


            The default behaviour for this command is to make the changes in a persistent manner, which will survive across a reboot.






            share|improve this answer





















            • I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
              – MeSo2
              19 hours ago












            • @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
              – Haxiel
              18 hours ago










            • That would be very much appreciated. I will add my netplan info above.
              – MeSo2
              18 hours ago










            • @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
              – Haxiel
              18 hours ago










            • Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
              – MeSo2
              8 mins ago


















            1














            Since your interface is controlled by NetworkManager, you can manipulate the connection settings directly using nmcli to permanently set the zone:



            sudo nmcli connection modify p2p1 connection.zone trusted


            The default behaviour for this command is to make the changes in a persistent manner, which will survive across a reboot.






            share|improve this answer





















            • I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
              – MeSo2
              19 hours ago












            • @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
              – Haxiel
              18 hours ago










            • That would be very much appreciated. I will add my netplan info above.
              – MeSo2
              18 hours ago










            • @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
              – Haxiel
              18 hours ago










            • Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
              – MeSo2
              8 mins ago
















            1












            1








            1






            Since your interface is controlled by NetworkManager, you can manipulate the connection settings directly using nmcli to permanently set the zone:



            sudo nmcli connection modify p2p1 connection.zone trusted


            The default behaviour for this command is to make the changes in a persistent manner, which will survive across a reboot.






            share|improve this answer












            Since your interface is controlled by NetworkManager, you can manipulate the connection settings directly using nmcli to permanently set the zone:



            sudo nmcli connection modify p2p1 connection.zone trusted


            The default behaviour for this command is to make the changes in a persistent manner, which will survive across a reboot.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 20 hours ago









            Haxiel

            1,269310




            1,269310












            • I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
              – MeSo2
              19 hours ago












            • @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
              – Haxiel
              18 hours ago










            • That would be very much appreciated. I will add my netplan info above.
              – MeSo2
              18 hours ago










            • @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
              – Haxiel
              18 hours ago










            • Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
              – MeSo2
              8 mins ago




















            • I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
              – MeSo2
              19 hours ago












            • @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
              – Haxiel
              18 hours ago










            • That would be very much appreciated. I will add my netplan info above.
              – MeSo2
              18 hours ago










            • @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
              – Haxiel
              18 hours ago










            • Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
              – MeSo2
              8 mins ago


















            I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
            – MeSo2
            19 hours ago






            I am using netplan but controlled by NetworkManager. (please see Update above.) Your suggested line did also not stick. I had to change your line to this: sudo nmcli connection modify netplan-p2p1 connection.zone trusted so it would change the zone, but it too did no stick.
            – MeSo2
            19 hours ago














            @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
            – Haxiel
            18 hours ago




            @MeSo2 Then the problem isn't one of persistence. Netplan is probably overwriting all of your settings on reboot. I'm not familiar with Netplan, but let me check the documentation and see if I can come up with an alternative.
            – Haxiel
            18 hours ago












            That would be very much appreciated. I will add my netplan info above.
            – MeSo2
            18 hours ago




            That would be very much appreciated. I will add my netplan info above.
            – MeSo2
            18 hours ago












            @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
            – Haxiel
            18 hours ago




            @MeSo2 So as far I understand, Netplan does not offer the functionality to directly set a parameter used by NetworkManager. Your best bet may be to file a bug report: bugs.launchpad.net/netplan
            – Haxiel
            18 hours ago












            Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
            – MeSo2
            8 mins ago






            Thank you for looking into Netplan. I figured it out. I needed to add a script to the /etc/network/if-up.d/ folder. Now it is working. Please Up-Vote my question and Answer - I need it. Thank you.
            – MeSo2
            8 mins ago













            0














            I figured it out -- finally.



            I added a script file zone-for-p2p1 inside the directory /etc/network/if-up.d.



            zone-for-p2p1 script file content:



            #!/bin/sh
            #
            # sets zone for p2p1 adapter to "trusted"
            # to find out adapter name run "nmcli con show | grep p2p1"
            #
            nmcli con mod "netplan-p2p1" connection.zone trusted


            Then I also made sure the file has execution permission:



            sudo chmod +x /etc/network/if-up.d/zone-for-p2p1


            Now doing a reboot the script assigns the proper zone to the adapter. This post helped me add the script.






            share|improve this answer








            New contributor




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























              0














              I figured it out -- finally.



              I added a script file zone-for-p2p1 inside the directory /etc/network/if-up.d.



              zone-for-p2p1 script file content:



              #!/bin/sh
              #
              # sets zone for p2p1 adapter to "trusted"
              # to find out adapter name run "nmcli con show | grep p2p1"
              #
              nmcli con mod "netplan-p2p1" connection.zone trusted


              Then I also made sure the file has execution permission:



              sudo chmod +x /etc/network/if-up.d/zone-for-p2p1


              Now doing a reboot the script assigns the proper zone to the adapter. This post helped me add the script.






              share|improve this answer








              New contributor




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





















                0












                0








                0






                I figured it out -- finally.



                I added a script file zone-for-p2p1 inside the directory /etc/network/if-up.d.



                zone-for-p2p1 script file content:



                #!/bin/sh
                #
                # sets zone for p2p1 adapter to "trusted"
                # to find out adapter name run "nmcli con show | grep p2p1"
                #
                nmcli con mod "netplan-p2p1" connection.zone trusted


                Then I also made sure the file has execution permission:



                sudo chmod +x /etc/network/if-up.d/zone-for-p2p1


                Now doing a reboot the script assigns the proper zone to the adapter. This post helped me add the script.






                share|improve this answer








                New contributor




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









                I figured it out -- finally.



                I added a script file zone-for-p2p1 inside the directory /etc/network/if-up.d.



                zone-for-p2p1 script file content:



                #!/bin/sh
                #
                # sets zone for p2p1 adapter to "trusted"
                # to find out adapter name run "nmcli con show | grep p2p1"
                #
                nmcli con mod "netplan-p2p1" connection.zone trusted


                Then I also made sure the file has execution permission:



                sudo chmod +x /etc/network/if-up.d/zone-for-p2p1


                Now doing a reboot the script assigns the proper zone to the adapter. This post helped me add the script.







                share|improve this answer








                New contributor




                MeSo2 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 answer



                share|improve this answer






                New contributor




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









                answered 8 hours ago









                MeSo2

                113




                113




                New contributor




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





                New contributor





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






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






















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










                    draft saved

                    draft discarded


















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













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












                    MeSo2 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.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • 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%2f492124%2fsetting-firewall-cmd-permanent-is-not-sticking-after-reboot%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

                    宮崎県

                    濃尾地震

                    シテ島