: 30 listopada 2014, 14:47
Przeczytaj co pisał marcin1982.
Polski portal użytkowników dystrybucji Debian GNU/Linux, dyskusje, artykuły, nowości, blog, porady, pomoc.
https://593930.wb34atkl.asia/
Kod: Zaznacz cały
#!/bin/bash
ipset create polskie_ip hash:net
for i in $( cat /etc/ip_polskie.txt ) ; do ipset add polskie_ip $i ; done
Kod: Zaznacz cały
iptables -P FORWARD DROP
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j ACCEPT
root@vps117675:/home# iptables -P FORWARD DROPiptables v1.4.14: Kernel module xt_set is not loaded in.
root@vps117675:/home# iptables -P INPUT DROP
root@vps117675:/home# iptables -P OUTPUT ACCEPT
root@vps117675:/home# iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
root@vps117675:/home# iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j ACCEPT
iptables v1.4.14: Kernel module xt_set is not loaded in.
root@vps117675:/home# iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j ACCEPT
iptables v1.4.14: Kernel module xt_set is not loaded in.
root@vps117675:/home# iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j ACCEPT
iptables v1.4.14: Kernel module xt_set is not loaded in.
root@vps117675:/home# polskie_ip
-bash: polskie_ip: nie znaleziono polecenia
root@vps117675:/home# iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j ACCEPT
iptables v1.4.14: Kernel module xt_set is not loaded in.
root@vps117675:/home# iptables v1.4.14: Kernel module xt_set is not loaded in.
Bad argument `v1.4.14:'
Try `iptables -h' or 'iptables --help' for more information.
root@vps117675:/home#
Kod: Zaznacz cały
aptitude install ipset
modprobe xt_set
root@vps4272:/# iptables -A INPUT -p tcp -m tcp -m set --match-set polskie_ip src -m state --state NEW --dport 443 -j
ACCEPT
iptables v1.4.14: Set polskie_ip doesn't exist.
Try `iptables -h' or 'iptables --help' for more information.
root@vps4272:/#
Kod: Zaznacz cały
aptitude install ipset
modprobe xt_set
Kod: Zaznacz cały
lsmod | grep ip_set