Why is my 443 port blocked
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · Adhi Laksono
OK, thank you very much for the help... I will try it...
Can I write the rules like this too :
Quoted 7 lines
$IPTABLES -A LAN-Internet -p tcp -s $NET_LSN -d 0/0 --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT $IPTABLES -A LAN-Internet -p tcp -s 0/0 --sport 443 -d $NET_LAN -m state --state RELATED,ESTABLISHED -j ACCEPT
It's the same right??? or it's different???
[quote from previous post:]
Quoted 4 lines
Quoted 4 lines
$ipt -A LAN-Internet -m state --state RELATED,ESTABLISHED \
-j ACCEPT
$ipt -A LAN-Internet -m state --state NEW -s $NET_LAN \
-m multiport -p tcp --dports 80,443 -j ACCEPT
As you can see: no, the rules are not the same and do not act the same (well, they might, but they might not).
You only need to match packets in state NEW (optionally you can also use --syn when matching tcp packets). After that, packets in a connection that is validated by such rule are either ESTABLISHED or RELATED.
There's no need to specify -d 0/0. If you omit it, it is asumed.
What is the reason you're using a user defined chain "LAN-Internet"? It doesn't sound like your ruleset is that complex.
Also, you don't show the rest of your ruleset. It may be irrelevant, but rules in it could also be preventing the rules you show from working.
Quoted 4 lines
Oh yeah... I have a task in my campus to make a firewall with a default policy ACCEPT, but I still don't know witch port to block... can you help me with this,
I'm sorry but I can't because you don't specify what has to be firewalled.
Quoted 6 lines
or is there any reference that I can read... my block script is this :
dropport="137:138 5050" <this is where I put my ports to block>
Quoted 7 lines
#this is my rule
for ports in $dropport;do
$IPTABLES -A LAN-Internet -p tcp -s 0/0 -d $NET_LAN --dport $ports -j DROPLOG
$IPTABLES -A LAN-Internet -p udp -s 0/0 -d $NET_LAN --dport $ports -j DROPLOG
done;
Here you don't specify a state where in previous rules you do. Perhaps you want to be consistent in this throughout the script, but that's your call..
There's no need to specify -s 0/0; you don't specify -d 0/0 either (so it is assumed). Personally I think it just clutters the line to be executed with useless information.
Quoted 4 lines
DROPLOG is my LOG chain with DROP policy... Is this script save??? well, it's easy to block port though, I can just add the ports I like to block in the "dropport" variable...
I don't consider it safe: you only block the specified tcp and udp ports. All other traffic is allowed and IMHO a firewall should block everything that I don't specifically allow.
But again: I don't know what it is you need to achieve.
If you have to make a firewall with policy set to ACCEPT, why not make the **last** rule in a chain a DROP rule:
$ipt -P <chain> -j ACCEPT
$ipt <stuff to allow>
...
$ipt -A <chain> -j DROP
Here you have an ACCEPT policy but the ruleset will act the same way when doing this:
$ipt -P <chain> -j DROP
$ipt <stuff to allow>
...
Gr,
Rob
Quoted 38 lines
Quoted 36 lines · --- Rob Sterenborg
Quoted 10 lines
I made a script for my firewall, one of the rules is
$IPTABLES -A LAN-Internet -p tcp -s $NET_LSN -d 0/0 --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT
$IPTABLES -A LAN-Internet -p tcp -s 0/0 --sport 443 -d $NET_LAN -m state --state ESTABLISHED -j ACCEPT
with my default policy DROP..
Quoted 7 lines
I can open http://www.yahoo.com, but how come I can't open the mail.yahoo.com???
In my log list, it says that the packet for port 443 is blocked, and sometimes port 80 is blocked to??? what's wrong with my firewall??? why isn't it stable...
Try this:
$ipt -A LAN-Internet -m state --state
RELATED,ESTABLISHED \
-j ACCEPT
$ipt -A LAN-Internet -m state --state NEW -s
$NET_LAN \
-m multiport -p tcp --dports 80,443 -j ACCEPTWhy not have the RELATED,ESTABLISHED rule in your
FORWARD chain? This
rule will match most traffic so you want it to be
one of the first rules
to be checked.Gr,
Rob