Kod: Zaznacz cały
telnet mx.poczta.onet.pl 25
telnet: cannot connect to remote host (213.180.147.146): Connection timed out
Kod: Zaznacz cały
telnet mx.poczta.onet.pl 25
telnet: cannot connect to remote host (213.180.147.146): Connection timed out
Kod: Zaznacz cały
iptables -A OUTPUT --dport 25 -j DROP
Kod: Zaznacz cały
iptables -A OUTPUT --dport 25 -j DROP
Kod: Zaznacz cały
iptables -L
iptables -S
Kod: Zaznacz cały
$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Kod: Zaznacz cały
# iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-N forward
-N forwarding_lan
-N forwarding_rule
-N forwarding_wan
-N input
-N input_lan
-N input_rule
-N input_wan
-N nat_reflection_fwd
-N output
-N output_rule
-N reject
-N syn_flood
-N zone_lan
-N zone_lan_ACCEPT
-N zone_lan_DROP
-N zone_lan_REJECT
-N zone_lan_forward
-N zone_wan
-N zone_wan_ACCEPT
-N zone_wan_DROP
-N zone_wan_REJECT
-N zone_wan_forward
-A INPUT -m state --state INVALID -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j syn_flood
-A INPUT -j input_rule
-A INPUT -j input
-A FORWARD -m state --state INVALID -j DROP
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -j forwarding_rule
-A FORWARD -j forward
-A OUTPUT -m state --state INVALID -j DROP
-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -j output_rule
-A OUTPUT -j output
-A forward -i br-lan -j zone_lan_forward
-A forward -i eth1 -j zone_wan_forward
-A forwarding_rule -d 192.168.1.2/32 -i eth1 -p tcp -m tcp --dport 22 -j LOG --log-prefix "IPT-ssh32: " --log-level 5
-A forwarding_rule -j nat_reflection_fwd
-A input -i br-lan -j zone_lan
-A input -i eth1 -j zone_wan
-A input_rule -i eth1 -p icmp -m icmp --icmp-type 8 -j LOG --log-prefix "IPT-ping: " --log-level 5
-A input_rule -i eth1 -p tcp -m tcp --dport 31 -j LOG --log-prefix "IPT-ssh31: " --log-level 5
-A input_rule -i eth1 -p tcp -m tcp --dport 22 -j LOG --log-prefix "IPT-ssh22: " --log-level 5
-A output -j zone_lan_ACCEPT
-A output -j zone_wan_ACCEPT
-A reject -p tcp -j REJECT --reject-with tcp-reset
-A reject -j REJECT --reject-with icmp-port-unreachable
-A syn_flood -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m limit --limit 25/sec --limit-burst 50 -j RETURN
-A syn_flood -j DROP
-A zone_lan -j input_lan
-A zone_lan -j zone_lan_ACCEPT
-A zone_lan_ACCEPT -o br-lan -j ACCEPT
-A zone_lan_ACCEPT -i br-lan -j ACCEPT
-A zone_lan_DROP -m limit --limit 10/min -j LOG --log-prefix "DROP(lan):"
-A zone_lan_DROP -o br-lan -j DROP
-A zone_lan_DROP -i br-lan -j DROP
-A zone_lan_REJECT -m limit --limit 10/min -j LOG --log-prefix "REJECT(lan):"
-A zone_lan_REJECT -o br-lan -j reject
-A zone_lan_REJECT -i br-lan -j reject
-A zone_lan_forward -p tcp -m tcp --dport 135:139 -j zone_wan_DROP
-A zone_lan_forward -p udp -m udp --dport 135:139 -j zone_wan_DROP
-A zone_lan_forward -p tcp -m tcp --dport 445 -j zone_wan_DROP
-A zone_lan_forward -p udp -m udp --dport 445 -j zone_wan_DROP
-A zone_lan_forward -j zone_wan_ACCEPT
-A zone_lan_forward -j forwarding_lan
-A zone_lan_forward -j zone_lan_REJECT
-A zone_wan -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 53 -j ACCEPT
-A zone_wan -p udp -m udp --dport 53 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 31 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 80 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 443 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 25 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 110 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 465 -j ACCEPT
-A zone_wan -p tcp -m tcp --dport 995 -j ACCEPT
-A zone_wan -j input_wan
-A zone_wan -j zone_wan_DROP
-A zone_wan_ACCEPT -o eth1 -j ACCEPT
-A zone_wan_ACCEPT -i eth1 -j ACCEPT
-A zone_wan_DROP -o eth1 -j DROP
-A zone_wan_DROP -i eth1 -j DROP
-A zone_wan_REJECT -o eth1 -j reject
-A zone_wan_REJECT -i eth1 -j reject
-A zone_wan_forward -d 192.168.1.2/32 -p tcp -m tcp --dport 22 -j ACCEPT
-A zone_wan_forward -j forwarding_wan
-A zone_wan_forward -j zone_wan_DROP
Kod: Zaznacz cały
# iptables -nL
Chain INPUT (policy DROP)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
syn_flood tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02
input_rule all -- 0.0.0.0/0 0.0.0.0/0
input all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
forwarding_rule all -- 0.0.0.0/0 0.0.0.0/0
forward all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy DROP)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
output_rule all -- 0.0.0.0/0 0.0.0.0/0
output all -- 0.0.0.0/0 0.0.0.0/0
Chain forward (1 references)
target prot opt source destination
zone_lan_forward all -- 0.0.0.0/0 0.0.0.0/0
zone_wan_forward all -- 0.0.0.0/0 0.0.0.0/0
Chain forwarding_lan (1 references)
target prot opt source destination
Chain forwarding_rule (1 references)
target prot opt source destination
LOG tcp -- 0.0.0.0/0 192.168.1.2 tcp dpt:22 LOG flags 0 level 5 prefix `IPT-ssh32: '
nat_reflection_fwd all -- 0.0.0.0/0 0.0.0.0/0
Chain forwarding_wan (1 references)
target prot opt source destination
Chain input (1 references)
target prot opt source destination
zone_lan all -- 0.0.0.0/0 0.0.0.0/0
zone_wan all -- 0.0.0.0/0 0.0.0.0/0
Chain input_lan (1 references)
target prot opt source destination
Chain input_rule (1 references)
target prot opt source destination
LOG icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 8 LOG flags 0 level 5 prefix `IPT-ping: '
LOG tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:31 LOG flags 0 level 5 prefix `IPT-ssh31: '
LOG tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 LOG flags 0 level 5 prefix `IPT-ssh22: '
Chain input_wan (1 references)
target prot opt source destination
Chain nat_reflection_fwd (1 references)
target prot opt source destination
Chain output (1 references)
target prot opt source destination
zone_lan_ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
zone_wan_ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain output_rule (1 references)
target prot opt source destination
Chain reject (4 references)
target prot opt source destination
REJECT tcp -- 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain syn_flood (1 references)
target prot opt source destination
RETURN tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x02 limit: avg 25/sec burst 50
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_lan (1 references)
target prot opt source destination
input_lan all -- 0.0.0.0/0 0.0.0.0/0
zone_lan_ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_ACCEPT (2 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_DROP (0 references)
target prot opt source destination
LOG all -- 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `DROP(lan):'
DROP all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_REJECT (1 references)
target prot opt source destination
LOG all -- 0.0.0.0/0 0.0.0.0/0 limit: avg 10/min burst 5 LOG flags 0 level 4 prefix `REJECT(lan):'
reject all -- 0.0.0.0/0 0.0.0.0/0
reject all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_forward (1 references)
target prot opt source destination
zone_wan_DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:135:139
zone_wan_DROP udp -- 0.0.0.0/0 0.0.0.0/0 udp dpts:135:139
zone_wan_DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:445
zone_wan_DROP udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:445
zone_wan_ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
forwarding_lan all -- 0.0.0.0/0 0.0.0.0/0
zone_lan_REJECT all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_wan (1 references)
target prot opt source destination
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 8
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:31
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:25
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:110
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:465
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:995
input_wan all -- 0.0.0.0/0 0.0.0.0/0
zone_wan_DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_ACCEPT (2 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_DROP (6 references)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_REJECT (0 references)
target prot opt source destination
reject all -- 0.0.0.0/0 0.0.0.0/0
reject all -- 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_forward (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.1.2 tcp dpt:22
forwarding_wan all -- 0.0.0.0/0 0.0.0.0/0
zone_wan_DROP all -- 0.0.0.0/0 0.0.0.0/0