Firewall with iptables
[Zurück zur aktuellen Version][Diese Version wiederherstellen]

Commands#

> ls -la /usr/sbin/ip*  # list all commands, there are many
> iptables*             # for ipv4 (in debian busters = nft)
> ip6tables*            # for ipv6 (in debian busters = nft)
> iptables-legacy       # former ones, not nft
> iptables-nft          # directly use nft
Notes:
> who -u                      # get all sessions with ip and pid
> sudo netstat -pantW         # list network connections, p=programs,a=all,n=IPs,t=tcp,W=wide(not truncate IP address) 
> ip a                        # list all ips

Syntax#

see docu
> sudo ip6tables -L -v 
> sudo ip6tables -nvL                     # thjis is most compact
> sudo ip6tables -n -v --line-numbers -L  # list all ipv6 rules with numeric IPs and rule number
> sudo service ip6tables start		  # activate firewalling
> sudo chkconfig ip6tables on		  # enable after reboot
ip6tables [-t <table-name>] <command> <chain-name> <parameter-1>  <option-1> <parameter-n> <option-n>