-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Could nf_tables be enabled in raspbian #2177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To be clear, are you requesting |
Probably yes - however I consider myself rather an end-user of linux (gnu cli rather). So I don't know much about the in and outs of the linux kernel used for raspbian but I was simply wondering why nft wasn't working with Raspbian Stretch (as it was officially announced for Debian Stretch to become the replacement of iptables etc.). Looking for the reason why nft didn't work after I manually installed it from the repo, I can see e.g. that the modul is not loaded:
whereas iptables is for example:
|
For nft to actually be usable will require more than just CONFIG_NF_TABLES=m. Ideally, most of the options under that in the config menu should be enabled as well, otherwise you can't really do much with nft. |
Just as a start and to provide some hints what might be required in the kernel config (copied from https://home.regit.org/netfilter-en/nftables-quick-howto/): `$ make oldconfig Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES) [M/y/?] m IPv4 nf_tables support (NF_TABLES_IPV4) [N/m] (NEW) m IPv6 nf_tables support (NF_TABLES_IPV6) [M/n] m Ethernet Bridge nf_tables support (NF_TABLES_BRIDGE) [N/m/y] (NEW) m` |
I experience the same issue. All calls fail. For example:
|
I have the same issue when I try nftables. |
EDIT: Figured what I needed was already available as a module, and figured out how to load it. You can disregard the rest of my message. Sorry for the useless intervention. Hi, I seem to have a similar issue with iptables/netfilter functionalities not working due to missing kernel flags. In addition to the above flags, my need would be mainly for Netfilter Xtables support > "recent" match support (something like that anyway, haven't compiled a kernel recently). It's useful to pick and drop brute-force attempts. Many thanks. |
bump |
I hope this gets added in soon, I really despise using iptables and really love using nftables after using Cisco IOS for some time. The syntax is similar which makes it easer for me to alternate between them. |
We are wary of adding large amount of modules to the system, without knowing the impact. So has anyone found out how much storage is taken up, how much the kernel bloats when it is added, and whether there are performance impacts? |
Total: around 143 kB I probably have not compiled everything in but as you can see, it is not too large (compiled for x86_64). |
Ok, Forgot about the nf_tables modules:
Total: 165 kB So the total of both: 308 kB |
How to compile and install these kernel modules to make nftables work ? |
Follow this guide: http://lostindetails.com/blog/post/Compiling-a-kernel-module-for-the-raspberry-pi-2 Download build tools: https://github.com/raspberrypi/tools Then I cross-compile a kernel and install and run it. I'm running
Before build the kernel, use Then nftables works fine:
Here is my kernel config:
|
Is there anything we can do, to bring this issue forward? |
Hi, Debian Buster will use nftables instead of iptables, see https://wiki.debian.org/nftables
Raspbian Kernel 4.19 doesn't have the nf_* kernel modules for this right now.
Debian Buster alpha5 has:
IMHO we might end up with having no working firewall solutions when Raspbian switches to Buster. |
@XECDesign Any comment on the firewall in buster comment? |
This seems to be purely a kernel issue. If, for whatever reason, we can't enable nftables in the kernel, then I'd have to figure out how to work around that and make sure iptables still works. It is my understanding that nftables is the standard and iptables use is discouraged now. Diverging from upstream distros tends to create headaches, but I'm sure it's possible if required. |
Actually, there are tools[0] to use the "new" (available since kernel 3.13!) nf_tables kernel backend with the iptables frontend, but not vice versa. Hence, moving from iptables to nftables should be smooth. Sticking to iptables will create troubles in near-/mid-future. [0] https://wiki.nftables.org/wiki-nftables/index.php/Legacy_xtables_tools |
I don't think the plan would be to support nftables syntax through iptables, but to remove Anyway, this is up to the kernel guys. If the answer is no, I suspect we'll be able to find a solution before Buster is stable. |
@XECDesign sorry, I may expressed myself mistakable: What I intent to propose is to support iptables syntax support through nftables. |
That seems to be the default on Buster. |
The problem is that with Buster we'll still have a /usr/sbin/iptables binary, but it'll use the nf_* kernel modules. There's still a xt_* kernel modules iptables, but it's called /usr/sbin/iptables-legacy though. So option A seems to be: compile/provide nf_ kernel modules |
What exactly is the blocker for this issue? |
As buster is approaching, I've had a closer look at the cost of these options. Basically little effect on kernel.img size or free memory from boot. Suggest going for "full" option. This will be in next rpi-update kernel build for testing. |
kernel: BCM270X_DT: Create bcm2708-rpi-zero.dts See: raspberrypi/linux#2990 kernel: overlays: Fix mmc-related overlays after refactor See: #1145 kernel: of: overlay: set node fields from properties when add new overlay node See: raspberrypi/linux#2995 kernel: config: Add NF_TABLES support See: raspberrypi/linux#2177
kernel: BCM270X_DT: Create bcm2708-rpi-zero.dts See: raspberrypi/linux#2990 kernel: overlays: Fix mmc-related overlays after refactor See: raspberrypi/firmware#1145 kernel: of: overlay: set node fields from properties when add new overlay node See: raspberrypi/linux#2995 kernel: config: Add NF_TABLES support See: raspberrypi/linux#2177
Latest rpi-update should have NF_TABLES enabled. |
Unfortunately it doesn't. So no working iptables and no working Nftables. |
Can you say exactly what is missing?
|
Not sure what is missing. Could take a look on my desktop, I guess. That was upgraded from stretch to buster at the same time and no problems with that. What I have done is alias ipt=iptables-legacy and iptables seems to work but iptables-restore does not seem to. I dislike iptables, but need a firewall till nftables works. (I did the alias to save typing) |
modprobe: FATAL: Module nf_tables not found in directory /lib/modules/4.19.42-v7+ |
@keithwilliamsnp did you reboot after running rpi-update? |
Yes, rebooted to ensure newest kernel being used
…On Mon, 17 Jun 2019 at 21:54, popcornmix ***@***.***> wrote:
@keithwilliamsnp <https://github.com/keithwilliamsnp> did you reboot
after running rpi-update?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2177?email_source=notifications&email_token=AK2HO4IVXIG7HIHZVTSAOE3P272YJA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4NLZQ#issuecomment-502846950>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK2HO4OFJB3G3MTMAL53GRLP272YJANCNFSM4DYPNCIA>
.
|
And you ran rpi-update first? You don't have the kernel version with the fix in. |
Linux piebox 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l
GNU/Linux
…On Mon, 17 Jun 2019 at 23:39, popcornmix ***@***.***> wrote:
And you ran rpi-update first? You don't have the kernel version with the
fix in.
Report output of uname -a
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2177?email_source=notifications&email_token=AK2HO4IV5YO4MFHMH55MPFLP3AHDDA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4UWFY#issuecomment-502876951>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK2HO4MYVRG5V2WQT4ZIDI3P3AHDDANCNFSM4DYPNCIA>
.
|
That is the stable kernel from apt. That doesn't contain the NF_TABLES support. |
just noticed the date/time is horridly wildly out of date. Could that
affect things?
Will reset that
On Mon, 17 Jun 2019 at 23:41, Keith Williams <[email protected]>
wrote:
… Linux piebox 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l
GNU/Linux
On Mon, 17 Jun 2019 at 23:39, popcornmix ***@***.***> wrote:
> And you ran rpi-update first? You don't have the kernel version with the
> fix in.
> Report output of uname -a
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2177?email_source=notifications&email_token=AK2HO4IV5YO4MFHMH55MPFLP3AHDDA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4UWFY#issuecomment-502876951>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AK2HO4MYVRG5V2WQT4ZIDI3P3AHDDANCNFSM4DYPNCIA>
> .
>
|
yes. will rerun it
…On Mon, 17 Jun 2019 at 23:45, popcornmix ***@***.***> wrote:
That is the stable kernel from apt. That doesn't contain the NF_TABLES
support.
Have you run rpi-update?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2177?email_source=notifications&email_token=AK2HO4L4OL2FUHQPQ2ND5VTP3AHXDA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4U7NY#issuecomment-502878135>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK2HO4OYUNE2VFDXSJJTL43P3AHXDANCNFSM4DYPNCIA>
.
|
*** Performing self-update
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- 0:02:09 --:--:--
0curl: (7) Failed to connect to raw.githubusercontent.com port 443:
Connection timed out
!!! Failed to download update for rpi-update!
!!! Make sure you have ca-certificates installed and that the time is set
correctly
Will need to look at ca-certs, then have another go in the morning. It is
midnight now
On Mon, 17 Jun 2019 at 23:47, Keith Williams <[email protected]>
wrote:
… yes. will rerun it
On Mon, 17 Jun 2019 at 23:45, popcornmix ***@***.***> wrote:
> That is the stable kernel from apt. That doesn't contain the NF_TABLES
> support.
> Have you run rpi-update?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2177?email_source=notifications&email_token=AK2HO4L4OL2FUHQPQ2ND5VTP3AHXDA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4U7NY#issuecomment-502878135>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AK2HO4OYUNE2VFDXSJJTL43P3AHXDANCNFSM4DYPNCIA>
> .
>
|
~# apt-get install ca-certificates
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20190110).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
On Mon, 17 Jun 2019 at 23:49, Keith Williams <[email protected]>
wrote:
… *** Performing self-update
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 0 0 0 0 0 0 0 --:--:-- 0:02:09 --:--:--
0curl: (7) Failed to connect to raw.githubusercontent.com port 443:
Connection timed out
!!! Failed to download update for rpi-update!
!!! Make sure you have ca-certificates installed and that the time is set
correctly
Will need to look at ca-certs, then have another go in the morning. It is
midnight now
On Mon, 17 Jun 2019 at 23:47, Keith Williams ***@***.***>
wrote:
> yes. will rerun it
>
>
> On Mon, 17 Jun 2019 at 23:45, popcornmix ***@***.***>
> wrote:
>
>> That is the stable kernel from apt. That doesn't contain the NF_TABLES
>> support.
>> Have you run rpi-update?
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#2177?email_source=notifications&email_token=AK2HO4L4OL2FUHQPQ2ND5VTP3AHXDA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4U7NY#issuecomment-502878135>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/AK2HO4OYUNE2VFDXSJJTL43P3AHXDANCNFSM4DYPNCIA>
>> .
>>
>
|
You mentioned the time was wrong - that can stop https connections from working. |
SOLVED
Thanks popcornmix.
OK here is what I did. Firstly, I have to apologise as yes I had tried
running rpi-update when I had upgraded earlier in the day, but as it had
not run properly, in fact it had hung at 2 minutes in, it had not done its
job and I like every bad workman blamed my tools.
1. Check that there were no firewall blocks on port 443 between Pi and the
outside world. There were none. As I run Pi headless through an SSH
connection I did this by using wget to download from a HTTPS site that I
run on a remote server
2. check time on system clock, it seemed to be more or less right but I had
got a mention of time as a possible error. so a) install npt b) synchronise
system clock with ntp servers
3. I had done a distribution upgrade over a previous install, so I did a
bit of cleaning up. I had some non standard programs installed - no idea
whether these could cause conflicts or not. Apt-get autoremove and a clean
did get rid of a lot of junk
4. Checked through ethernet connection once more
5. rpi-update and reboot
6. service nftables start - SUCCESS
7. nft list ruleset - output contents of /etc/nftables.conf
Thanks again popcornmix. The error was obviously mine
…On Tue, 18 Jun 2019 at 00:02, popcornmix ***@***.***> wrote:
You mentioned the time was wrong - that can stop https connections from
working.
Also check you have basic internet connectivity (e.g. from browser in
raspbian).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2177?email_source=notifications&email_token=AK2HO4NX66ADOJ3SXYWPKJLP3AJZPA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4V6CY#issuecomment-502882059>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK2HO4L6B6YPXXDKISYO6R3P3AJZPANCNFSM4DYPNCIA>
.
|
A further problem has arisen which suggests that I may not have been
totally wrong.
I had to do a further reboot this morning due to physically moving the
hardware. I got exactly the same results as I was getting yesterday when I
tried to get the nftables service started. It would not start. Lots of
fiddling around afterwards showed that it was attempting to load a config
file that I had not put there, ipv6 NAT. This, of course was referencing
non-existent commands. Further investigation showed that
netfilter-persistent was attempting to load this.
With NFTables this is not only unnecessary but it interferes. So I did a
apt-get purge netfilter-persistent. Followed by a reboot. NFTables then was
able to start and automatically load /etc/nftables.conf which contains all
the firewall rules I had written
On Tue, 18 Jun 2019 at 09:01, Keith Williams <[email protected]>
wrote:
… SOLVED
Thanks popcornmix.
OK here is what I did. Firstly, I have to apologise as yes I had tried
running rpi-update when I had upgraded earlier in the day, but as it had
not run properly, in fact it had hung at 2 minutes in, it had not done its
job and I like every bad workman blamed my tools.
1. Check that there were no firewall blocks on port 443 between Pi and the
outside world. There were none. As I run Pi headless through an SSH
connection I did this by using wget to download from a HTTPS site that I
run on a remote server
2. check time on system clock, it seemed to be more or less right but I
had got a mention of time as a possible error. so a) install npt b)
synchronise system clock with ntp servers
3. I had done a distribution upgrade over a previous install, so I did a
bit of cleaning up. I had some non standard programs installed - no idea
whether these could cause conflicts or not. Apt-get autoremove and a clean
did get rid of a lot of junk
4. Checked through ethernet connection once more
5. rpi-update and reboot
6. service nftables start - SUCCESS
7. nft list ruleset - output contents of /etc/nftables.conf
Thanks again popcornmix. The error was obviously mine
On Tue, 18 Jun 2019 at 00:02, popcornmix ***@***.***> wrote:
> You mentioned the time was wrong - that can stop https connections from
> working.
> Also check you have basic internet connectivity (e.g. from browser in
> raspbian).
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#2177?email_source=notifications&email_token=AK2HO4NX66ADOJ3SXYWPKJLP3AJZPA5CNFSM4DYPNCIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX4V6CY#issuecomment-502882059>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AK2HO4L6B6YPXXDKISYO6R3P3AJZPANCNFSM4DYPNCIA>
> .
>
|
Closing this issue as questions answered/issue resolved. NF_TABLES now enabled by default in the kernel. |
When will the nftables fix and the kernel including them become available from the apt repos? |
Have you tried a recent Raspbian? The last two images (2019-06-24 and 2019-07-10/12) both contain kernels with NF_TABLES enabled. |
I have a pi in the field (so can't deploy a new image), recently upgraded to raspbian buster successfully. Still, the current kernel is 4.14.98-v7+ and the one available from apt repo as follows: :~$ apt-cache show raspberrypi-kernel neither of which have nftables enabled. |
That doesn't look very upgraded to me - is it perhaps the last Stretch kernel? Did you change "stretch" to "buster" in all the necessary places before the upgrade? |
My bad! It seems the rpi specific apt sources in /etc/apt/sources.list.d/raspi.list had been commented out (I can't remember if by me manually during upgrade from stretch or automatically as part of the upgrade). Uncommenting these (and changing to buster) have provided a load of upgrades including the recent kernel. Apologies for the noise. |
crypto: Fix divide error in do_xor_speed() From: Kirill Tkhai <[email protected]> Latest (but not only latest) linux-next panics with divide error on my QEMU setup. The patch at the bottom of this message fixes the problem. xor: measuring software checksum speed divide error: 0000 [#1] PREEMPT SMP KASAN PREEMPT SMP KASAN CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.10.0-next-20201223+ #2177 RIP: 0010:do_xor_speed+0xbb/0xf3 Code: 41 ff cc 75 b5 bf 01 00 00 00 e8 3d 23 8b fe 65 8b 05 f6 49 83 7d 85 c0 75 05 e8 84 70 81 fe b8 00 00 50 c3 31 d2 48 8d 7b 10 <f7> f5 41 89 c4 e8 58 07 a2 fe 44 89 63 10 48 8d 7b 08 e8 cb 07 a2 RSP: 0000:ffff888100137dc8 EFLAGS: 00010246 RAX: 00000000c3500000 RBX: ffffffff823f0160 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000808 RDI: ffffffff823f0170 RBP: 0000000000000000 R08: ffffffff8109c50f R09: ffffffff824bb6f7 R10: fffffbfff04976de R11: 0000000000000001 R12: 0000000000000000 R13: ffff888101997000 R14: ffff888101994000 R15: ffffffff823f0178 FS: 0000000000000000(0000) GS:ffff8881f7780000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000220e000 CR4: 00000000000006a0 Call Trace: calibrate_xor_blocks+0x13c/0x1c4 ? do_xor_speed+0xf3/0xf3 do_one_initcall+0xc1/0x1b7 ? start_kernel+0x373/0x373 ? unpoison_range+0x3a/0x60 kernel_init_freeable+0x1dd/0x238 ? rest_init+0xc6/0xc6 kernel_init+0x8/0x10a ret_from_fork+0x1f/0x30 ---[ end trace 5bd3c1d0b77772da ]--- Fixes: c055e3e ("crypto: xor - use ktime for template benchmarking") Cc: <[email protected]> Signed-off-by: Kirill Tkhai <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
commit 3c02e04 upstream. crypto: Fix divide error in do_xor_speed() From: Kirill Tkhai <[email protected]> Latest (but not only latest) linux-next panics with divide error on my QEMU setup. The patch at the bottom of this message fixes the problem. xor: measuring software checksum speed divide error: 0000 [#1] PREEMPT SMP KASAN PREEMPT SMP KASAN CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.10.0-next-20201223+ #2177 RIP: 0010:do_xor_speed+0xbb/0xf3 Code: 41 ff cc 75 b5 bf 01 00 00 00 e8 3d 23 8b fe 65 8b 05 f6 49 83 7d 85 c0 75 05 e8 84 70 81 fe b8 00 00 50 c3 31 d2 48 8d 7b 10 <f7> f5 41 89 c4 e8 58 07 a2 fe 44 89 63 10 48 8d 7b 08 e8 cb 07 a2 RSP: 0000:ffff888100137dc8 EFLAGS: 00010246 RAX: 00000000c3500000 RBX: ffffffff823f0160 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000808 RDI: ffffffff823f0170 RBP: 0000000000000000 R08: ffffffff8109c50f R09: ffffffff824bb6f7 R10: fffffbfff04976de R11: 0000000000000001 R12: 0000000000000000 R13: ffff888101997000 R14: ffff888101994000 R15: ffffffff823f0178 FS: 0000000000000000(0000) GS:ffff8881f7780000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000220e000 CR4: 00000000000006a0 Call Trace: calibrate_xor_blocks+0x13c/0x1c4 ? do_xor_speed+0xf3/0xf3 do_one_initcall+0xc1/0x1b7 ? start_kernel+0x373/0x373 ? unpoison_range+0x3a/0x60 kernel_init_freeable+0x1dd/0x238 ? rest_init+0xc6/0xc6 kernel_init+0x8/0x10a ret_from_fork+0x1f/0x30 ---[ end trace 5bd3c1d0b77772da ]--- Fixes: c055e3e ("crypto: xor - use ktime for template benchmarking") Cc: <[email protected]> Signed-off-by: Kirill Tkhai <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Hello all,
the module for nf_tables (and it's possible dependencies) is not loaded in the latest Raspbian Stretch. I thought it would be (based on the announcement that it will become available with Debian Stretch). Since netfiltering should be moved from iptables etc. over to nftables in the long run I thought this would be a good start now with Stretch being released.
Are there any plans to enable nft (nftables) by standard for Raspbian as well ?
The text was updated successfully, but these errors were encountered: