iptables
2019-01-22 本文已影响5人
Jelif
This is the firewall tool in Linux.
The default table it uses is filter
.
To empty a table:
iptables -t nat -F
To list all rules in a table:
iptables -t nat -L -n
Forward packet
iptables -t nat -A PREROUTING -d 192.168.0.110 -p tcp --dport 80 -j DNAT --to-destination 192.168.0.105
iptables -t nat -A POSTROUTING -d 192.168.0.105 -p tcp --dport 80 -j SNAT --to 192.168.0.110
Other options
-i
can be used to identify the input network interface.
-j
can be used to identify the output network interface.