ip6table-restore failed in Debian buster/sid2019 Community Moderator Electioniptables will match the following ICMP request packet as ESTABLISHED state after the first reply packet is sentISC DHCP Server - A Client's Uplink Is Not WorkingUsing IPTables to block all connections but still be able to backup vServerDebian network disappearingWhy do some TCP reset packets show up in my iptables log?Problem with lilypond upgrade on Debian “buster/sid”Internet access in LXC container with nftablesPort forwarding in Linux for UDP doesn't workPackage libmysql++-dev is not found in Debian buster/sidiptables-restore failed in Debian buster/sid if it has --multiport option in the rules file

Why did the Mercure fail?

Is it better practice to read straight from sheet music rather than memorize it?

Is there a single word describing earning money through any means?

Energy measurement from position eigenstate

Which one is correct as adjective “protruding” or “protruded”?

Problem with TransformedDistribution

Non-trope happy ending?

How to explain what's wrong with this application of the chain rule?

It grows, but water kills it

why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?

How to indicate a cut out for a product window

The IT department bottlenecks progress. How should I handle this?

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

WiFi Thermostat, No C Terminal on Furnace

Count the occurrence of each unique word in the file

What is this called? Old film camera viewer?

What if a revenant (monster) gains fire resistance?

Where does the bonus feat in the cleric starting package come from?

Creature in Shazam mid-credits scene?

Aragorn's "guise" in the Orthanc Stone

What should you do if you miss a job interview (deliberately)?

How to bake one texture for one mesh with multiple textures blender 2.8

If a character has darkvision, can they see through an area of nonmagical darkness filled with lightly obscuring gas?

Drawing ramified coverings with tikz



ip6table-restore failed in Debian buster/sid



2019 Community Moderator Electioniptables will match the following ICMP request packet as ESTABLISHED state after the first reply packet is sentISC DHCP Server - A Client's Uplink Is Not WorkingUsing IPTables to block all connections but still be able to backup vServerDebian network disappearingWhy do some TCP reset packets show up in my iptables log?Problem with lilypond upgrade on Debian “buster/sid”Internet access in LXC container with nftablesPort forwarding in Linux for UDP doesn't workPackage libmysql++-dev is not found in Debian buster/sidiptables-restore failed in Debian buster/sid if it has --multiport option in the rules file










2















I have the below iptable rule in /etc/iptables/rule.V6 and /etc/iptables/rule.V4



-4 -A INPUT -p icmp -j ACCEPT
-6 -A INPUT -p ipv6-icmp -j ACCEPT


when I tried to restart the netfilter-persistent, it internally calls the iptables-restore and ip6tables-restore.



ip6tables-restore failed because it couldn't understand the below rule



-4 -A INPUT -p icmp -j ACCEPT


Below is the error



root@rs-dal:/etc/iptables# ip6tables-restore rules.q
Error occurred at line: 15
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.


Ideally the rule that starts with -4 will be ignored by the ip6tables-restore, but that doesn't seems to be working in Debian Buster.



But, iptables-restore worked fine, it is only the issue with ip6tables-restore.
How to fix this issue?










share|improve this question









New contributor




Karthik 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 the below iptable rule in /etc/iptables/rule.V6 and /etc/iptables/rule.V4



    -4 -A INPUT -p icmp -j ACCEPT
    -6 -A INPUT -p ipv6-icmp -j ACCEPT


    when I tried to restart the netfilter-persistent, it internally calls the iptables-restore and ip6tables-restore.



    ip6tables-restore failed because it couldn't understand the below rule



    -4 -A INPUT -p icmp -j ACCEPT


    Below is the error



    root@rs-dal:/etc/iptables# ip6tables-restore rules.q
    Error occurred at line: 15
    Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.


    Ideally the rule that starts with -4 will be ignored by the ip6tables-restore, but that doesn't seems to be working in Debian Buster.



    But, iptables-restore worked fine, it is only the issue with ip6tables-restore.
    How to fix this issue?










    share|improve this question









    New contributor




    Karthik 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 the below iptable rule in /etc/iptables/rule.V6 and /etc/iptables/rule.V4



      -4 -A INPUT -p icmp -j ACCEPT
      -6 -A INPUT -p ipv6-icmp -j ACCEPT


      when I tried to restart the netfilter-persistent, it internally calls the iptables-restore and ip6tables-restore.



      ip6tables-restore failed because it couldn't understand the below rule



      -4 -A INPUT -p icmp -j ACCEPT


      Below is the error



      root@rs-dal:/etc/iptables# ip6tables-restore rules.q
      Error occurred at line: 15
      Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.


      Ideally the rule that starts with -4 will be ignored by the ip6tables-restore, but that doesn't seems to be working in Debian Buster.



      But, iptables-restore worked fine, it is only the issue with ip6tables-restore.
      How to fix this issue?










      share|improve this question









      New contributor




      Karthik 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 below iptable rule in /etc/iptables/rule.V6 and /etc/iptables/rule.V4



      -4 -A INPUT -p icmp -j ACCEPT
      -6 -A INPUT -p ipv6-icmp -j ACCEPT


      when I tried to restart the netfilter-persistent, it internally calls the iptables-restore and ip6tables-restore.



      ip6tables-restore failed because it couldn't understand the below rule



      -4 -A INPUT -p icmp -j ACCEPT


      Below is the error



      root@rs-dal:/etc/iptables# ip6tables-restore rules.q
      Error occurred at line: 15
      Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.


      Ideally the rule that starts with -4 will be ignored by the ip6tables-restore, but that doesn't seems to be working in Debian Buster.



      But, iptables-restore worked fine, it is only the issue with ip6tables-restore.
      How to fix this issue?







      debian iptables nftables ip6tables






      share|improve this question









      New contributor




      Karthik 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




      Karthik 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 yesterday









      GAD3R

      27.3k1858113




      27.3k1858113






      New contributor




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









      asked yesterday









      KarthikKarthik

      374




      374




      New contributor




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





      New contributor





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






      Karthik 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


















          2














          You are most certainly running iptables over nftables, as this is the default on Debian buster. To confirm this is the case, check for (nf_tables):



          # ip6tables-restore --version
          ip6tables-restore v1.8.2 (nf_tables)


          Now in the ip6tables manual, there always has been:




          -4, --ipv4

          This option has no effect in iptables and iptables-restore. If a rule using the -4 option is inserted with (and only with)
          ip6tables-restore, it will be silently ignored. Any other uses will
          throw an error. This option allows IPv4 and IPv6 rules in a single
          rule file for use with both iptables-restore and ip6tables-restore.




          The trouble is that you're now running ip6tables-nft-restore rather than ip6tables-legacy-restore.



          There is no mention of -4 in differences to legacy iptables, meaning there shouldn't be a difference about it, but here it is. This really looks like a bug: either the new version ip6tables-nft-restore should cope with it, or the documentation should reflect it as an additional difference to be acceptable.



          By the way the other way around (-6 with iptables-nft-restore) doesn't look better: it's accepted instead of ignored, leading to -A INPUT -p ipv6-icmp -j ACCEPT in addition to -A INPUT -p icmp -j ACCEPT in IPv4 protocol (this will never happen, except maybe with a custom test, and the IP stack will ignore it anyway).



          Possible workarounds:



          1. file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.



          2. split rules



            split your file into two files but apply a different filter to each, something like:



            grep -v -- '^ *-4 ' < before > after.v6
            grep -v -- '^ *-6 ' < before > after.v4


          3. create a wrapper for ip6tables-restore in /usr/local/sbin/ip6tables-restore doing about the same (and also do the same for iptables-restore), allowing to keep a single rule



          4. Give up (for now) iptables over nftables and revert to legacy iptables:



            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-nft-multi
            # update-alternatives --config ip6tables
            There are 2 choices for the alternative ip6tables (providing /usr/sbin/ip6tables).

            Selection Path Priority Status
            ------------------------------------------------------------
            * 0 /usr/sbin/ip6tables-nft 20 auto mode
            1 /usr/sbin/ip6tables-legacy 10 manual mode
            2 /usr/sbin/ip6tables-nft 20 manual mode

            Press <enter> to keep the current choice[*], or type selection number: 1
            update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-legacy-multi


            The link of the related command also changed, fine.



            Do the same with iptables.



            Current rules are still running over nftables. You can dump them with iptables-nft-save + ip6tables-nft-save and restore them with iptables-save + ip6tables-save. This will result in rules running twice: once with kernel's iptables backend, once with kernel's nftables backend, and NAT might not always work correctly with this on kernel 4.19 (usually the first loaded module wins: here nft_nat). Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.




          5. embrace the new features and use directly nft.



            There are commands available to help here (but they have the same problem as above): iptables-translate / ip6tables-translate and iptables-restore-translate / ip6tables-restore-translate, but the result usually needs reworking anyway (especially with fancy matches like u32). Nftables has a family type inet which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.







          share|improve this answer























          • Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

            – Karthik
            18 hours ago











          • I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

            – Karthik
            14 hours ago











          • Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

            – A.B
            14 hours ago











          • The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

            – Karthik
            14 hours ago











          • debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

            – A.B
            13 hours ago










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



          );






          Karthik 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%2f508019%2fip6table-restore-failed-in-debian-buster-sid%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









          2














          You are most certainly running iptables over nftables, as this is the default on Debian buster. To confirm this is the case, check for (nf_tables):



          # ip6tables-restore --version
          ip6tables-restore v1.8.2 (nf_tables)


          Now in the ip6tables manual, there always has been:




          -4, --ipv4

          This option has no effect in iptables and iptables-restore. If a rule using the -4 option is inserted with (and only with)
          ip6tables-restore, it will be silently ignored. Any other uses will
          throw an error. This option allows IPv4 and IPv6 rules in a single
          rule file for use with both iptables-restore and ip6tables-restore.




          The trouble is that you're now running ip6tables-nft-restore rather than ip6tables-legacy-restore.



          There is no mention of -4 in differences to legacy iptables, meaning there shouldn't be a difference about it, but here it is. This really looks like a bug: either the new version ip6tables-nft-restore should cope with it, or the documentation should reflect it as an additional difference to be acceptable.



          By the way the other way around (-6 with iptables-nft-restore) doesn't look better: it's accepted instead of ignored, leading to -A INPUT -p ipv6-icmp -j ACCEPT in addition to -A INPUT -p icmp -j ACCEPT in IPv4 protocol (this will never happen, except maybe with a custom test, and the IP stack will ignore it anyway).



          Possible workarounds:



          1. file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.



          2. split rules



            split your file into two files but apply a different filter to each, something like:



            grep -v -- '^ *-4 ' < before > after.v6
            grep -v -- '^ *-6 ' < before > after.v4


          3. create a wrapper for ip6tables-restore in /usr/local/sbin/ip6tables-restore doing about the same (and also do the same for iptables-restore), allowing to keep a single rule



          4. Give up (for now) iptables over nftables and revert to legacy iptables:



            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-nft-multi
            # update-alternatives --config ip6tables
            There are 2 choices for the alternative ip6tables (providing /usr/sbin/ip6tables).

            Selection Path Priority Status
            ------------------------------------------------------------
            * 0 /usr/sbin/ip6tables-nft 20 auto mode
            1 /usr/sbin/ip6tables-legacy 10 manual mode
            2 /usr/sbin/ip6tables-nft 20 manual mode

            Press <enter> to keep the current choice[*], or type selection number: 1
            update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-legacy-multi


            The link of the related command also changed, fine.



            Do the same with iptables.



            Current rules are still running over nftables. You can dump them with iptables-nft-save + ip6tables-nft-save and restore them with iptables-save + ip6tables-save. This will result in rules running twice: once with kernel's iptables backend, once with kernel's nftables backend, and NAT might not always work correctly with this on kernel 4.19 (usually the first loaded module wins: here nft_nat). Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.




          5. embrace the new features and use directly nft.



            There are commands available to help here (but they have the same problem as above): iptables-translate / ip6tables-translate and iptables-restore-translate / ip6tables-restore-translate, but the result usually needs reworking anyway (especially with fancy matches like u32). Nftables has a family type inet which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.







          share|improve this answer























          • Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

            – Karthik
            18 hours ago











          • I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

            – Karthik
            14 hours ago











          • Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

            – A.B
            14 hours ago











          • The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

            – Karthik
            14 hours ago











          • debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

            – A.B
            13 hours ago















          2














          You are most certainly running iptables over nftables, as this is the default on Debian buster. To confirm this is the case, check for (nf_tables):



          # ip6tables-restore --version
          ip6tables-restore v1.8.2 (nf_tables)


          Now in the ip6tables manual, there always has been:




          -4, --ipv4

          This option has no effect in iptables and iptables-restore. If a rule using the -4 option is inserted with (and only with)
          ip6tables-restore, it will be silently ignored. Any other uses will
          throw an error. This option allows IPv4 and IPv6 rules in a single
          rule file for use with both iptables-restore and ip6tables-restore.




          The trouble is that you're now running ip6tables-nft-restore rather than ip6tables-legacy-restore.



          There is no mention of -4 in differences to legacy iptables, meaning there shouldn't be a difference about it, but here it is. This really looks like a bug: either the new version ip6tables-nft-restore should cope with it, or the documentation should reflect it as an additional difference to be acceptable.



          By the way the other way around (-6 with iptables-nft-restore) doesn't look better: it's accepted instead of ignored, leading to -A INPUT -p ipv6-icmp -j ACCEPT in addition to -A INPUT -p icmp -j ACCEPT in IPv4 protocol (this will never happen, except maybe with a custom test, and the IP stack will ignore it anyway).



          Possible workarounds:



          1. file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.



          2. split rules



            split your file into two files but apply a different filter to each, something like:



            grep -v -- '^ *-4 ' < before > after.v6
            grep -v -- '^ *-6 ' < before > after.v4


          3. create a wrapper for ip6tables-restore in /usr/local/sbin/ip6tables-restore doing about the same (and also do the same for iptables-restore), allowing to keep a single rule



          4. Give up (for now) iptables over nftables and revert to legacy iptables:



            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-nft-multi
            # update-alternatives --config ip6tables
            There are 2 choices for the alternative ip6tables (providing /usr/sbin/ip6tables).

            Selection Path Priority Status
            ------------------------------------------------------------
            * 0 /usr/sbin/ip6tables-nft 20 auto mode
            1 /usr/sbin/ip6tables-legacy 10 manual mode
            2 /usr/sbin/ip6tables-nft 20 manual mode

            Press <enter> to keep the current choice[*], or type selection number: 1
            update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-legacy-multi


            The link of the related command also changed, fine.



            Do the same with iptables.



            Current rules are still running over nftables. You can dump them with iptables-nft-save + ip6tables-nft-save and restore them with iptables-save + ip6tables-save. This will result in rules running twice: once with kernel's iptables backend, once with kernel's nftables backend, and NAT might not always work correctly with this on kernel 4.19 (usually the first loaded module wins: here nft_nat). Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.




          5. embrace the new features and use directly nft.



            There are commands available to help here (but they have the same problem as above): iptables-translate / ip6tables-translate and iptables-restore-translate / ip6tables-restore-translate, but the result usually needs reworking anyway (especially with fancy matches like u32). Nftables has a family type inet which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.







          share|improve this answer























          • Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

            – Karthik
            18 hours ago











          • I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

            – Karthik
            14 hours ago











          • Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

            – A.B
            14 hours ago











          • The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

            – Karthik
            14 hours ago











          • debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

            – A.B
            13 hours ago













          2












          2








          2







          You are most certainly running iptables over nftables, as this is the default on Debian buster. To confirm this is the case, check for (nf_tables):



          # ip6tables-restore --version
          ip6tables-restore v1.8.2 (nf_tables)


          Now in the ip6tables manual, there always has been:




          -4, --ipv4

          This option has no effect in iptables and iptables-restore. If a rule using the -4 option is inserted with (and only with)
          ip6tables-restore, it will be silently ignored. Any other uses will
          throw an error. This option allows IPv4 and IPv6 rules in a single
          rule file for use with both iptables-restore and ip6tables-restore.




          The trouble is that you're now running ip6tables-nft-restore rather than ip6tables-legacy-restore.



          There is no mention of -4 in differences to legacy iptables, meaning there shouldn't be a difference about it, but here it is. This really looks like a bug: either the new version ip6tables-nft-restore should cope with it, or the documentation should reflect it as an additional difference to be acceptable.



          By the way the other way around (-6 with iptables-nft-restore) doesn't look better: it's accepted instead of ignored, leading to -A INPUT -p ipv6-icmp -j ACCEPT in addition to -A INPUT -p icmp -j ACCEPT in IPv4 protocol (this will never happen, except maybe with a custom test, and the IP stack will ignore it anyway).



          Possible workarounds:



          1. file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.



          2. split rules



            split your file into two files but apply a different filter to each, something like:



            grep -v -- '^ *-4 ' < before > after.v6
            grep -v -- '^ *-6 ' < before > after.v4


          3. create a wrapper for ip6tables-restore in /usr/local/sbin/ip6tables-restore doing about the same (and also do the same for iptables-restore), allowing to keep a single rule



          4. Give up (for now) iptables over nftables and revert to legacy iptables:



            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-nft-multi
            # update-alternatives --config ip6tables
            There are 2 choices for the alternative ip6tables (providing /usr/sbin/ip6tables).

            Selection Path Priority Status
            ------------------------------------------------------------
            * 0 /usr/sbin/ip6tables-nft 20 auto mode
            1 /usr/sbin/ip6tables-legacy 10 manual mode
            2 /usr/sbin/ip6tables-nft 20 manual mode

            Press <enter> to keep the current choice[*], or type selection number: 1
            update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-legacy-multi


            The link of the related command also changed, fine.



            Do the same with iptables.



            Current rules are still running over nftables. You can dump them with iptables-nft-save + ip6tables-nft-save and restore them with iptables-save + ip6tables-save. This will result in rules running twice: once with kernel's iptables backend, once with kernel's nftables backend, and NAT might not always work correctly with this on kernel 4.19 (usually the first loaded module wins: here nft_nat). Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.




          5. embrace the new features and use directly nft.



            There are commands available to help here (but they have the same problem as above): iptables-translate / ip6tables-translate and iptables-restore-translate / ip6tables-restore-translate, but the result usually needs reworking anyway (especially with fancy matches like u32). Nftables has a family type inet which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.







          share|improve this answer













          You are most certainly running iptables over nftables, as this is the default on Debian buster. To confirm this is the case, check for (nf_tables):



          # ip6tables-restore --version
          ip6tables-restore v1.8.2 (nf_tables)


          Now in the ip6tables manual, there always has been:




          -4, --ipv4

          This option has no effect in iptables and iptables-restore. If a rule using the -4 option is inserted with (and only with)
          ip6tables-restore, it will be silently ignored. Any other uses will
          throw an error. This option allows IPv4 and IPv6 rules in a single
          rule file for use with both iptables-restore and ip6tables-restore.




          The trouble is that you're now running ip6tables-nft-restore rather than ip6tables-legacy-restore.



          There is no mention of -4 in differences to legacy iptables, meaning there shouldn't be a difference about it, but here it is. This really looks like a bug: either the new version ip6tables-nft-restore should cope with it, or the documentation should reflect it as an additional difference to be acceptable.



          By the way the other way around (-6 with iptables-nft-restore) doesn't look better: it's accepted instead of ignored, leading to -A INPUT -p ipv6-icmp -j ACCEPT in addition to -A INPUT -p icmp -j ACCEPT in IPv4 protocol (this will never happen, except maybe with a custom test, and the IP stack will ignore it anyway).



          Possible workarounds:



          1. file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.



          2. split rules



            split your file into two files but apply a different filter to each, something like:



            grep -v -- '^ *-4 ' < before > after.v6
            grep -v -- '^ *-6 ' < before > after.v4


          3. create a wrapper for ip6tables-restore in /usr/local/sbin/ip6tables-restore doing about the same (and also do the same for iptables-restore), allowing to keep a single rule



          4. Give up (for now) iptables over nftables and revert to legacy iptables:



            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-nft-multi
            # update-alternatives --config ip6tables
            There are 2 choices for the alternative ip6tables (providing /usr/sbin/ip6tables).

            Selection Path Priority Status
            ------------------------------------------------------------
            * 0 /usr/sbin/ip6tables-nft 20 auto mode
            1 /usr/sbin/ip6tables-legacy 10 manual mode
            2 /usr/sbin/ip6tables-nft 20 manual mode

            Press <enter> to keep the current choice[*], or type selection number: 1
            update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in manual mode
            # readlink -f $(which ip6tables-restore)
            /usr/sbin/xtables-legacy-multi


            The link of the related command also changed, fine.



            Do the same with iptables.



            Current rules are still running over nftables. You can dump them with iptables-nft-save + ip6tables-nft-save and restore them with iptables-save + ip6tables-save. This will result in rules running twice: once with kernel's iptables backend, once with kernel's nftables backend, and NAT might not always work correctly with this on kernel 4.19 (usually the first loaded module wins: here nft_nat). Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.




          5. embrace the new features and use directly nft.



            There are commands available to help here (but they have the same problem as above): iptables-translate / ip6tables-translate and iptables-restore-translate / ip6tables-restore-translate, but the result usually needs reworking anyway (especially with fancy matches like u32). Nftables has a family type inet which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered yesterday









          A.BA.B

          5,4421829




          5,4421829












          • Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

            – Karthik
            18 hours ago











          • I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

            – Karthik
            14 hours ago











          • Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

            – A.B
            14 hours ago











          • The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

            – Karthik
            14 hours ago











          • debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

            – A.B
            13 hours ago

















          • Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

            – Karthik
            18 hours ago











          • I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

            – Karthik
            14 hours ago











          • Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

            – A.B
            14 hours ago











          • The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

            – Karthik
            14 hours ago











          • debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

            – A.B
            13 hours ago
















          Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

          – Karthik
          18 hours ago





          Thanks a lot the detailed explanation, will analyse all the workaround and update the thread about my next step.

          – Karthik
          18 hours ago













          I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

          – Karthik
          14 hours ago





          I have raised a bug below is the link bugs.debian.org/cgi-bin/bugreport.cgi?bug=925343

          – Karthik
          14 hours ago













          Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

          – A.B
          14 hours ago





          Good. The only possible missing thing is that you should show the documentation related to the -4 option (from man iptables or man ip6tables), to insist this is a documented expected behaviour. Also understand that this report will probably be brought upstream at netfilter's team so this will take some delay anyway. Also the actual package is iptables, not iptables-persistent

          – A.B
          14 hours ago













          The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

          – Karthik
          14 hours ago





          The whole issue is started when I restarted netfilter-persistent. netfilter-persistent is in iptables-persistent package. the problem is actually on ip6table-restore, I should have specified the package as iptables. my bad it is my mistake. I will change it if possible

          – Karthik
          14 hours ago













          debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

          – A.B
          13 hours ago





          debian.org/Bugs/server-control probably something like reassign 925343 iptables + perhaps anaffects too

          – A.B
          13 hours ago










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









          draft saved

          draft discarded


















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












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











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




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f508019%2fip6table-restore-failed-in-debian-buster-sid%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

          getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

          Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

          Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.