Difference between revisions of "Iptables"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 12: Line 12:
 
  sysctl -w net.ipv4.ip_forward=1
 
  sysctl -w net.ipv4.ip_forward=1
 
  sysctl -p /etc/sysctl.conf
 
  sysctl -p /etc/sysctl.conf
 +
 +
 +
* Block all output traffic: <code>iptables -A OUTPUT -o eth1 -j DROP</code>
  
 
== Activities ==
 
== Activities ==

Revision as of 14:31, 19 March 2020

iptables command line utility allows to modify Linux kernel firewall rules.


Basic commands

  • sudo iptables -L
  • iptables-save and iptables-restore


Examples

KVM VNC remote viewer
iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 5900 -j DNAT --to 127.0.0.1:5900
sysctl -w net.ipv4.ip_forward=1
sysctl -p /etc/sysctl.conf


  • Block all output traffic: iptables -A OUTPUT -o eth1 -j DROP

Activities

  1. Read iptables Ubuntu howto: https://help.ubuntu.com/community/IptablesHowTo
  2. Read archlinux documentation: https://wiki.archlinux.org/index.php/iptables
  3. Read Stackoverflow iptables questions: https://stackoverflow.com/questions/tagged/iptables?tab=Votes
  4. Review your current iptables configuration

See also

  • https://serverfault.com/a/608976
  • Advertising: