Hallo
Ik weet niet zeker in welk forum ik dit moet dumpen omdat het ook een beetje programmeren is. Ik heb een firewall geschreven in python die gebruik maakt van iptables:
http://www.teux.net/?page_id=8Ik wil een ipblocken voor ALL het verkeer, maar als ik mijn test pc ping met het geblockte ip komen de connecties nog gewoon door. Dit is het block gedeelte van de firewall:
for x in black_list:
iptables('-A OUTPUT -d '+x+' -j DROP')
iptables('-A INPUT -s '+x+' -j DROP')
print "BLACKED "+x
x is dus het ipadress, 192.168.1.5. Het ip van de test pc is 192.168.1.6.
Als ik iptables -L doe ziet het er zo uit:
mickvdv@server2:~/teux-firewall$ sudo iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere state NEW
LOG all -- anywhere anywhere LOG level warning
DROP all -- anywhere anywhere state INVALID
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,PSH,URG
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,SYN,RST,PSH,ACK,URG
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/NONE
DROP tcp -- anywhere anywhere tcp flags:SYN,RST/SYN,RST
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN/FIN,SYN
DROP tcp -- anywhere anywhere tcp flags:FIN,ACK/FIN
DROP tcp -- anywhere anywhere tcp flags:FIN,SYN,RST,PSH,ACK,URG/FIN,SYN,RST,ACK,URG
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:www state NEW
DROP all -- 168.168.1.5 anywhere
Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- anywhere anywhere state INVALID
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere state NEW
ACCEPT udp -- anywhere anywhere udp dpt:domain state NEW
LOG all -- anywhere anywhere LOG level warning
DROP all -- anywhere anywhere state INVALID
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
DROP all -- anywhere 168.168.1.5
Ik weet dat ik iets fout doe, maar ik kom er niet achter wat dat is. Alvarst bedankt voor jullie hulp.