Listing 1. 2.4.x iptable Command Sequence
iptables -F
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -p tcp -d 10.0.1.0/24 \
--dport 23 -j LOG \
--log-prefix "Packet log: " \
--log-level info
iptables -A INPUT -p tcp -d 10.0.1.0/24 \
--dport 23 -j DROP
iptables -A INPUT -p tcp -s 10.0.1.0/24 \
--dport 80 -j LOG \
--log-prefix "Packet log: " \
--log-level info
iptables -A INPUT -p tcp -s 10.0.1.0/24 \
--dport 80 -j ACCEPT
iptables -P INPUT ACCEPT
Copyright © 1994 - 2018 Linux Journal. All rights reserved.