Archiv verlassen und diese Seite im Standarddesign anzeigen : iptables port sperren
hallo
mein script:
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
iptables -A INPUT -i ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT
ich möchte einen computer nur 2 ports offen lassen
iptables -A FORWARD -s 192.168.0.2 -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -s 192.168.0.2 -p tcp --dport 110 -j ACCEPT
geht das ?
und was machst du mit den anderen ports???
schreib dir ne drop oder reject regel nach den accepts
oder setzte die policy auf drop
Gruß Temp
wie würde das aussehen
-
ich habe auf dem server apache und postfix, router lauf.
da mein bruder über das ding ins internet geht, möchte /muss ich ihn einschränken. das heißt nur internet 80 , email 25 und 110
################################################## ############
# #
# Module #
# #
################################################## ############
modprobe ip_tables
modprobe ip_conntrack
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
################################################## ############
# #
# FLUSHEN #
# #
################################################## ############
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
################################################## ############
# Voreinstellung: ALLE PACKETE VERWERFEN #
################################################## ############
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
#Mailversand an beliebige Mailserver
iptables -A OUTPUT -o $INTERNET_INTERFACE -p tcp \
-s $INTERNET_IP --sport $UNPRIVPORTS \
--dport $SMTP_PORT -j ACCEPT
so ungefähr könnte das aussehen...
i denk aus dem kannst dir was basteln
Gruß Temp
Powered by vBulletin® Version 4.2.5 Copyright ©2024 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.