Iptables

From My Notepad
Jump to: navigation, search

Listing all current firewall rules

iptables --list -v -t mangle
iptables --list -v -t filter
iptables --list -v -t nat
tc qdisc show

tc class show tc filter show

Filter by source or destination address

iptables -t filter -A FORWARD -s 1.1.1.1/255.255.255.255 -j DROP
itpables -t filter -A FORWARD -d 2.2.2.2/255.255.255.255 -j DROP

BOGONS

http://www.team-cymru.org/Services/Bogons/

http://www.team-cymru.org/Services/Bogons/bogon-bn.html

:FILTER-BOGONS - [0:0]

-A INPUT -i eth0 -j FILTER-BOGONS

#
# FILTER-BOGONS
# http://www.team-cymru.org/Services/Bogons/bogon-bn.html
#
-A FILTER-BOGONS -s 0.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 5.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 10.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 23.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 36.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 37.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 39.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 42.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 49.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 100.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 101.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 102.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 103.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 104.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 105.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 106.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 127.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 169.254.0.0/16 -j DROP
-A FILTER-BOGONS -s 172.16.0.0/12 -j DROP
-A FILTER-BOGONS -s 179.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 185.0.0.0/8 -j DROP
-A FILTER-BOGONS -s 192.0.0.0/24 -j DROP
-A FILTER-BOGONS -s 192.0.2.0/24 -j DROP
-A FILTER-BOGONS -s 192.168.0.0/16 -j DROP
-A FILTER-BOGONS -s 198.18.0.0/15 -j DROP
-A FILTER-BOGONS -s 198.51.100.0/24 -j DROP
-A FILTER-BOGONS -s 203.0.113.0/24 -j DROP
-A FILTER-BOGONS -s 224.0.0.0/3 -j DROP
-A FILTER-BOGONS -j RETURN
#
# END FILTER-BOGONS
#