Why 'forward' chain, not 'input'?usually all the last rule in the firewall forward prohibits the passage of incoming connections.
IMHO 'standard firewall rules' definition is different for every network administrator .The problem is that I have devices that should accept New connections on the ports set up by UPnP, but standard firewall rules will drop that traffic without the accept rule added for the local subnet.
No, I don't. What is your reason for this rule???ditonet do you have a "drop everything else" rule at the end of your forward chain?
chain=forward action=drop
My basic config for 'forward' chain is:But am I correct that everything is allowed on the forward chain then?
/ip firewall filter add chain=forward comment="default configuration - established" connection-state=established add chain=forward comment="default configuration - related" connection-state=related add action=drop chain=forward comment="default configuration - drop invalid" connection-state=invalidHTH,
No, I accept established and related connections only and drop invalid.you are ACCEPTING ALL TRAFFIC transiting your router via the default ACCEPT policy of the router, i.e. you have no firewall for forwarded traffic.
Could you explain this?Any packet sent to your router with any destination address that is not the router address will be forwarded.
/ip firewall filter add action=drop chain=forward comment="default configuration - drop invalid" connection-state=invalidDid you ever test this???
If you put a more restrictive rule you would eliminate the thread (If I understood you correctly). For instance, allowing forward of all new connections but only when your destination is your internal network (this way no one could route public packets through you)Now I understand why you do not require any additional rules: you are ACCEPTING ALL TRAFFIC transiting your router via the default ACCEPT policy of the router, i.e. you have no firewall for forwarded traffic. Any packet sent to your router with any destination address that is not the router address will be forwarded. So it is possible to source-route packets from any network attached device in the world to any other (public) device as well as all of the devices on your local network.
This is considered to be highly insecure, and could easily be used as a vector to disguise the source of internet based intrusions or attacks.
Almost every network security professional I can think of will tell you that you should terminate every chain with a DROP rule, and only allow traffic that you have explicitly authorized to pass.
There is no matcher for SYN packets in these rules. therefore they follow the default policy of ACCEPT. This is how a new connection is established.No, I accept established and related connections only and drop invalid.
If the packet is a SYN packet (new connection request), then the DROP invalid matcher does not apply and the packet will reach the end of your firewall chain where is is ACCEPT'ed by default. This is why the wiki articles on firewalls include a DROP statement at the end of each chain.IMHO this packet is dropped by rule:ros code
/ip firewall filter add action=drop chain=forward comment="default configuration - drop invalid" connection-state=invalidDid you ever test this???
This is quite correct according to the rules posted above.does not describe the State=new. Packets to initiate a connection you allow?
Yes. This would be the rule allowing new connections to the local subnet that needed to be added to address the issue in the OP. The problem with this is that it effectively opens the local subnet for a similar type of attack vector.If you put a more restrictive rule you would eliminate the thread (If I understood you correctly). For instance, allowing forward of all new connections but only when your destination is your internal network (this way no one could route public packets through you)
Are you sure that these SYN packets from WAN side hit 'forward' chain, not 'input'? For what reason?There is no matcher for SYN packets in these rules. therefore they follow the default policy of ACCEPT. This is how a new connection is established.
firewall,info input: in:ether12-gateway out:(none), src-mac 00:1c:f6:xx:xx:xx, proto TCP (SYN), 208.64.x.x:46070-75.127.x.x:10259, len 60
firewall,info forward: in:ether12-gateway out:bridge1, src-mac 00:1c:f6:xx:xx:xx, proto TCP (SYN), 208.64.x.x:42367->192.168.x.x:38652, NAT 208.64.x.x:42367->(75.127.x.x:38652->192.168.x.x:38652), len 60
Maybe we misunderstood each other because english is not my native language .According to packet-flow diagram if SYN packet hits WAN interface,
first is checked against DST-NAT rules and router's service ports (Winbox, SSH, etc.).
Next this packet flows to 'input' chain, where is dropped (in my case) by filter's last rule.
is true or not. But I'm curious, I'll try to make some tests and let you know results.So of you source-route a packet to the WAN interface with a destination that is not the router IP it will be forwarded not input.
This is obvious for me and always was, read my posts.No DST-NAT = INPUT
DST-NAT = FORWARD
Can you confirm that packet with dst-address 5.6.7.8 will flow through 'forward' chain???E. g. my WAN interface address is 1.2.3.4 and this interface receives packet with dst-address 5.6.7.8.
According to your post this packet will be forwarded by router in case of no drop rule at the end of 'forward' chain.
add chain=forward connection-nat-state=dstnat in-interface=ether1
add chain=forward connection-nat-state=dstnat dst-address=192.168.111.13 in-interface=ether1