All of lore.kernel.org
 help / color / mirror / Atom feed
* bftables and scripts question
@ 2022-12-24  2:30 ToddAndMargo
  2022-12-24  3:40 ` Reindl Harald
  0 siblings, 1 reply; 4+ messages in thread
From: ToddAndMargo @ 2022-12-24  2:30 UTC (permalink / raw)
  To: netfilter

Hi All,

I am currently using iptables but and starting the process
of learning nftables.

Question.  My iptables are in a bash programs (scripts).

For instance:

if [ "$enable_rdp" = "yes" ]; then
    # Warning: this user is given access to SYN's
    # rdp is M$ Terminal Services
    <lots of iptables>
    logger -p user.notice -t firewall "Firewall external rules warning: 
$ts_server (Terminal Server) accepts SYN's on Port $rdp_port"
fi

Will nftables work the same way?

And, will the converters also roll over the bash code?

Many thanks,
-T



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bftables and scripts question
  2022-12-24  2:30 bftables and scripts question ToddAndMargo
@ 2022-12-24  3:40 ` Reindl Harald
  2022-12-24  4:35   ` ToddAndMargo
  0 siblings, 1 reply; 4+ messages in thread
From: Reindl Harald @ 2022-12-24  3:40 UTC (permalink / raw)
  To: ToddAndMargo, netfilter



Am 24.12.22 um 03:30 schrieb ToddAndMargo:
> I am currently using iptables but and starting the process
> of learning nftables.
> 
> Question.  My iptables are in a bash programs (scripts).
> 
> For instance:
> 
> if [ "$enable_rdp" = "yes" ]; then
>     # Warning: this user is given access to SYN's
>     # rdp is M$ Terminal Services
>     <lots of iptables>
>     logger -p user.notice -t firewall "Firewall external rules warning: 
> $ts_server (Terminal Server) accepts SYN's on Port $rdp_port"
> fi
> 
> Will nftables work the same way?

not a single line above is iptables specific at all

> And, will the converters also roll over the bash code?

no - "iptables-restore-translate" or whatever can by definition have no 
clue about whatever bash script - it faces the iptables ruleset no 
matter how it was created

either use iptables-nft or start from scratch with your bash script and 
expect a lot of new learning

--------------------------------------

the kernel only knows about the active ruleset as your "iptables-save" 
file don't contain anything else

iptables-nft -t filter --list --numeric --line-numbers --verbose

iptables-nft -t mangle --list --numeric --line-numbers --verbose

iptables-nft -t raw --list --numeric --line-numbers --verbose



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bftables and scripts question
  2022-12-24  3:40 ` Reindl Harald
@ 2022-12-24  4:35   ` ToddAndMargo
  2022-12-24 17:30     ` Reindl Harald
  0 siblings, 1 reply; 4+ messages in thread
From: ToddAndMargo @ 2022-12-24  4:35 UTC (permalink / raw)
  To: Reindl Harald, netfilter

On 12/23/22 19:40, Reindl Harald wrote:
> not a single line above is iptables specific at all

 >>  <lots of iptables>

I removed them as they were not part of the question.
There were about eight of them.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bftables and scripts question
  2022-12-24  4:35   ` ToddAndMargo
@ 2022-12-24 17:30     ` Reindl Harald
  0 siblings, 0 replies; 4+ messages in thread
From: Reindl Harald @ 2022-12-24 17:30 UTC (permalink / raw)
  To: ToddAndMargo, netfilter



Am 24.12.22 um 05:35 schrieb ToddAndMargo:
> On 12/23/22 19:40, Reindl Harald wrote:
>> not a single line above is iptables specific at all
> 
>  >>  <lots of iptables>
> 
> I removed them as they were not part of the question.
> There were about eight of them

and everything you left has nothing to do with iptables or nftables - 
come on: how you you imagine a converter would rewrite your odd bash 
scripts?

you wrote your bash script for iptables
you write yours for nftables

and with some luck it ends with way less redundant rules as your current 
ruleset which is simply unmaintainable and unauditable

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-24 17:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-24  2:30 bftables and scripts question ToddAndMargo
2022-12-24  3:40 ` Reindl Harald
2022-12-24  4:35   ` ToddAndMargo
2022-12-24 17:30     ` Reindl Harald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.