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
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
New contributor
add a comment |
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
New contributor
add a comment |
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
New contributor
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
debian iptables nftables ip6tables
New contributor
New contributor
edited yesterday
GAD3R
27.3k1858113
27.3k1858113
New contributor
asked yesterday
KarthikKarthik
374
374
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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:
file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.
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.v4create a wrapper for
ip6tables-restore
in/usr/local/sbin/ip6tables-restore
doing about the same (and also do the same foriptables-restore
), allowing to keep a single ruleGive 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-multiThe 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 withiptables-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: herenft_nat)
. Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.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
andiptables-restore-translate
/ip6tables-restore-translate
, but the result usually needs reworking anyway (especially with fancy matches likeu32
). Nftables has a family typeinet
which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.
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 likereassign 925343 iptables
+ perhaps anaffects
too
– A.B
13 hours ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.
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.v4create a wrapper for
ip6tables-restore
in/usr/local/sbin/ip6tables-restore
doing about the same (and also do the same foriptables-restore
), allowing to keep a single ruleGive 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-multiThe 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 withiptables-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: herenft_nat)
. Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.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
andiptables-restore-translate
/ip6tables-restore-translate
, but the result usually needs reworking anyway (especially with fancy matches likeu32
). Nftables has a family typeinet
which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.
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 likereassign 925343 iptables
+ perhaps anaffects
too
– A.B
13 hours ago
add a comment |
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:
file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.
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.v4create a wrapper for
ip6tables-restore
in/usr/local/sbin/ip6tables-restore
doing about the same (and also do the same foriptables-restore
), allowing to keep a single ruleGive 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-multiThe 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 withiptables-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: herenft_nat)
. Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.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
andiptables-restore-translate
/ip6tables-restore-translate
, but the result usually needs reworking anyway (especially with fancy matches likeu32
). Nftables has a family typeinet
which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.
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 likereassign 925343 iptables
+ perhaps anaffects
too
– A.B
13 hours ago
add a comment |
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:
file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.
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.v4create a wrapper for
ip6tables-restore
in/usr/local/sbin/ip6tables-restore
doing about the same (and also do the same foriptables-restore
), allowing to keep a single ruleGive 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-multiThe 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 withiptables-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: herenft_nat)
. Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.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
andiptables-restore-translate
/ip6tables-restore-translate
, but the result usually needs reworking anyway (especially with fancy matches likeu32
). Nftables has a family typeinet
which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.
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:
file a bug report, insisting on a regression which would break existing rules and documentation. This would help other people too.
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.v4create a wrapper for
ip6tables-restore
in/usr/local/sbin/ip6tables-restore
doing about the same (and also do the same foriptables-restore
), allowing to keep a single ruleGive 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-multiThe 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 withiptables-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: herenft_nat)
. Better reboot, or know how to flush rules and remove relevant (nat) nftables modules.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
andiptables-restore-translate
/ip6tables-restore-translate
, but the result usually needs reworking anyway (especially with fancy matches likeu32
). Nftables has a family typeinet
which can actually mix IPv4 and IPv6 rules (might require a newer kernel for this in nat), so it would simplify things.
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 likereassign 925343 iptables
+ perhaps anaffects
too
– A.B
13 hours ago
add a comment |
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 likereassign 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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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