User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
gentoo:nft [2025/02/05 14:38] – created willygentoo:nft [2025/03/13 13:26] (current) – [NFTtables] willy
Line 1: Line 1:
-====== NFTtables ======+====== I) NFTtables ======
  
 Linux has very advanced and powerful low-level networking management capabilities. Historically, it was //iptables//, but it has evolved to **NFTables**. Linux has very advanced and powerful low-level networking management capabilities. Historically, it was //iptables//, but it has evolved to **NFTables**.
Line 50: Line 50:
 A quick cheatsheet: A quick cheatsheet:
 <code> <code>
-nft list tables # list all tables +nft -a 'list tables# list all tables 
-nft add table ip myTable # create a new table +nft 'add table ip myTable# create a new table 
-nft list table myTable # list chains and rules in myTable +nft -a 'list table myTable# list chains and rules in myTable 
-nft delete table myTable # delete a table+nft 'delete table myTable# delete a table
 </code> </code>
  
Line 84: Line 84:
 To delete chains: To delete chains:
 <code bash> <code bash>
-nft delete chain ip myTable myChain+nft 'delete chain ip myTable myChain'
 </code> </code>
  
Line 95: Line 95:
 To list rules: To list rules:
 <code bash> <code bash>
-nft -a list table myTable # by table +nft -a 'list table myTable# by table 
-nft -a list chain myTable mychain # by chain in table+nft -a 'list chain myTable mychain# by chain in table
 </code> </code>
  
Line 142: Line 142:
  
  
- 
- 
-nft list tables 
-nft add table ip wg 
-nft -- add chain ip wg prerouting { type nat hook prerouting priority -100 \; } 
-nft add chain ip wg  postrouting { type nat hook postrouting priority 100 \; } 
-nft add rule ip wg prerouting tcp dport 2022 dnat to 10.70.0.1 dport 22 
-nft add rule ip wg prerouting tcp dport 22 dnat to 10.70.0.1  
-nft add rule ip wg postrouting ip daddr 10.70.0.1 masquerade 
-   
-nft add ip wg prerouting 'dnat to tcp dport map { 2022 : 10.70.0.1 . 22 }' 
  

This website uses technical cookies only. No information is shared with anybody or used in any way but provide the website in your browser.

More information