drop fin packet with iptables ruleiptables rules to block ssh remote forwarded portsHow to test if SYN and FIN are both dropped at the same time in hping3?iptables rule to block incoming/outgoing traffic to a Xen containerWhy is our firewall (Ubuntu 8.04) rejecting the final packet (FIN, ACK, PSH) with a RSTUFW/IPTables: how to securely allow authenticated git access with githubTranslating IPTables rule to UFWiptables mysterious DROP --sport 80 [ACK FIN]Iptables - Drop or Reject the whole connectionCan iptables automatically drop established session after certain seconds?Debugging iptables and common firewall pitfalls?

Theorem won't go to multiple lines and is causing text to run off the page

Should one double the thirds or the fifth in chords?

When and why did journal article titles become descriptive, rather than creatively allusive?

Do I really need diodes to receive MIDI?

What is a "listed natural gas appliance"?

How would adding a darkvision racial trait to Dragonborn affect balance?

Is Jon mad at Ghost for some reason and is that why he won't acknowledge him?

How to give very negative feedback gracefully?

To customize a predefined symbol with different colors

What does this colon mean? It is not labeling, it is not ternary operator

Identifying a transmission to myself

Father and Son and Grandsons

Sed Usage to update GRUB file

CRT Oscilloscope - part of the plot is missing

Moving the subject of the sentence into a dangling participle

SQL Server Management Studio SSMS 18.0 General Availability release (GA) install fails

Can fracking help reduce CO2?

For a benzene shown in a skeletal structure, what does a substituent to the center of the ring mean?

What actually is the vector of angular momentum?

Which industry am I working in? Software development or financial services?

Upside-Down Pyramid Addition...REVERSED!

In Endgame, why were these characters still around?

Was there ever a Kickstart that took advantage of 68020+ instructions that would work on an A2000?

How do I tell my manager that his code review comment is wrong?



drop fin packet with iptables rule


iptables rules to block ssh remote forwarded portsHow to test if SYN and FIN are both dropped at the same time in hping3?iptables rule to block incoming/outgoing traffic to a Xen containerWhy is our firewall (Ubuntu 8.04) rejecting the final packet (FIN, ACK, PSH) with a RSTUFW/IPTables: how to securely allow authenticated git access with githubTranslating IPTables rule to UFWiptables mysterious DROP --sport 80 [ACK FIN]Iptables - Drop or Reject the whole connectionCan iptables automatically drop established session after certain seconds?Debugging iptables and common firewall pitfalls?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Os is linux mint 19, i want to setup a rule in iptables to drop the incomming FIN packet as a response of the FIN_WAIT_2 state.
This for a given port. I want to test an application and need some connections staying in the FIN_WAIT_2 tcp state.
Firewall is ufw










share|improve this question




























    0















    Os is linux mint 19, i want to setup a rule in iptables to drop the incomming FIN packet as a response of the FIN_WAIT_2 state.
    This for a given port. I want to test an application and need some connections staying in the FIN_WAIT_2 tcp state.
    Firewall is ufw










    share|improve this question
























      0












      0








      0








      Os is linux mint 19, i want to setup a rule in iptables to drop the incomming FIN packet as a response of the FIN_WAIT_2 state.
      This for a given port. I want to test an application and need some connections staying in the FIN_WAIT_2 tcp state.
      Firewall is ufw










      share|improve this question














      Os is linux mint 19, i want to setup a rule in iptables to drop the incomming FIN packet as a response of the FIN_WAIT_2 state.
      This for a given port. I want to test an application and need some connections staying in the FIN_WAIT_2 tcp state.
      Firewall is ufw







      iptables firewall ufw






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 23 at 9:28









      reisreis

      11




      11




















          2 Answers
          2






          active

          oldest

          votes


















          0














          If you just want to drop the incoming FIN packet when you always initiate the shutdown of the connection, then a rule such as the following should suffice:



          iptables -I INPUT --protocol tcp --destination-port 1337 --tcp-flags FIN FIN -j DROP


          However this will mess up closing of connections by the other end of the connection. I don't think that it's possible to only drop the FIN if preceded by an ACK.






          share|improve this answer























          • At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

            – reis
            Apr 24 at 5:34


















          0














          Unfortunately I haven't found any notes about checking the tcp flags in the ufw manual.



          In iptables your scenario can be implemented in some complex way using the ipset, but there are some limitations. I guess, your host is the tcp client, and server port number is 1234 (free to change it).



          # create the ipset list for fin_wait sockets.
          # every entry is tuple (local-ip,local-port,remote-ip)
          ipset create fin_wait hash:ip,port,ip timeout 3000

          # if local host sends the fin packet inside established connection
          # add entry into fin_wait list
          iptables -A OUTPUT
          -p tcp --tcp-flags FIN FIN
          --dport 1234
          -m conntrack --ctstate ESTABLISHED
          -j SET --add-set fin_wait src,src,dst --exist

          # if local host receives the fin packet for fin wait socket
          # drop it before tcp stack processing
          iptables -A INPUT
          -p tcp --tcp-flags FIN FIN
          --sport 1234
          -m set --match-set fin_wait dst,dst,src
          -j DROP


          For server there is difference.



          # create list for test clients
          ipset create test_clients hash:ip

          # add addresses of test clients
          ipset add test_clients 192.168.100.10

          # create list for clients in fin wait state
          # server ip,port is known, so ip,port type is enough
          ipset create fin_wait_clients hash:ip,port timeout 3000

          # if server receives fin from test client
          # add client's ip,port into set
          iptables -A INPUT -p tcp
          --dport 1234
          --tcp-flags FIN FIN
          -m set --match-set test_clients src
          -j SET --add-set fin_wait_clients src,src --exist

          # if server sends fin to test client as reply
          # block this fin
          iptables -A OUTPUT -p tcp
          --sport 1234
          --tcp-flags FIN FIN
          -m set --match-set fin_wait_clients dst,dst
          -j DROP


          Some notes:



          • Use ipset list fin_wait command to list the current blocked entries from iptables' point of view


          • Use ss -t4 state fin-wait-2 command to list sockets in fin wait 2 state


          • Order of rules is very important.


          • Better use the iptables-save / iptables-restore / iptables-apply tools to safety rule set changing.






          share|improve this answer

























          • i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

            – reis
            Apr 23 at 13:39











          • ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

            – Anton Danilov
            Apr 23 at 13:43












          • >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

            – reis
            Apr 24 at 5:54












          • For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

            – Anton Danilov
            Apr 24 at 6:49












          • I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

            – reis
            Apr 24 at 8:04











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "2"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964178%2fdrop-fin-packet-with-iptables-rule%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you just want to drop the incoming FIN packet when you always initiate the shutdown of the connection, then a rule such as the following should suffice:



          iptables -I INPUT --protocol tcp --destination-port 1337 --tcp-flags FIN FIN -j DROP


          However this will mess up closing of connections by the other end of the connection. I don't think that it's possible to only drop the FIN if preceded by an ACK.






          share|improve this answer























          • At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

            – reis
            Apr 24 at 5:34















          0














          If you just want to drop the incoming FIN packet when you always initiate the shutdown of the connection, then a rule such as the following should suffice:



          iptables -I INPUT --protocol tcp --destination-port 1337 --tcp-flags FIN FIN -j DROP


          However this will mess up closing of connections by the other end of the connection. I don't think that it's possible to only drop the FIN if preceded by an ACK.






          share|improve this answer























          • At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

            – reis
            Apr 24 at 5:34













          0












          0








          0







          If you just want to drop the incoming FIN packet when you always initiate the shutdown of the connection, then a rule such as the following should suffice:



          iptables -I INPUT --protocol tcp --destination-port 1337 --tcp-flags FIN FIN -j DROP


          However this will mess up closing of connections by the other end of the connection. I don't think that it's possible to only drop the FIN if preceded by an ACK.






          share|improve this answer













          If you just want to drop the incoming FIN packet when you always initiate the shutdown of the connection, then a rule such as the following should suffice:



          iptables -I INPUT --protocol tcp --destination-port 1337 --tcp-flags FIN FIN -j DROP


          However this will mess up closing of connections by the other end of the connection. I don't think that it's possible to only drop the FIN if preceded by an ACK.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 23 at 11:31









          wurtelwurtel

          3,038512




          3,038512












          • At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

            – reis
            Apr 24 at 5:34

















          • At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

            – reis
            Apr 24 at 5:34
















          At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

          – reis
          Apr 24 at 5:34





          At the client site the connection stays in FIN_WAIT1. This is one of the states i want the client to stay in for testing purpose.

          – reis
          Apr 24 at 5:34













          0














          Unfortunately I haven't found any notes about checking the tcp flags in the ufw manual.



          In iptables your scenario can be implemented in some complex way using the ipset, but there are some limitations. I guess, your host is the tcp client, and server port number is 1234 (free to change it).



          # create the ipset list for fin_wait sockets.
          # every entry is tuple (local-ip,local-port,remote-ip)
          ipset create fin_wait hash:ip,port,ip timeout 3000

          # if local host sends the fin packet inside established connection
          # add entry into fin_wait list
          iptables -A OUTPUT
          -p tcp --tcp-flags FIN FIN
          --dport 1234
          -m conntrack --ctstate ESTABLISHED
          -j SET --add-set fin_wait src,src,dst --exist

          # if local host receives the fin packet for fin wait socket
          # drop it before tcp stack processing
          iptables -A INPUT
          -p tcp --tcp-flags FIN FIN
          --sport 1234
          -m set --match-set fin_wait dst,dst,src
          -j DROP


          For server there is difference.



          # create list for test clients
          ipset create test_clients hash:ip

          # add addresses of test clients
          ipset add test_clients 192.168.100.10

          # create list for clients in fin wait state
          # server ip,port is known, so ip,port type is enough
          ipset create fin_wait_clients hash:ip,port timeout 3000

          # if server receives fin from test client
          # add client's ip,port into set
          iptables -A INPUT -p tcp
          --dport 1234
          --tcp-flags FIN FIN
          -m set --match-set test_clients src
          -j SET --add-set fin_wait_clients src,src --exist

          # if server sends fin to test client as reply
          # block this fin
          iptables -A OUTPUT -p tcp
          --sport 1234
          --tcp-flags FIN FIN
          -m set --match-set fin_wait_clients dst,dst
          -j DROP


          Some notes:



          • Use ipset list fin_wait command to list the current blocked entries from iptables' point of view


          • Use ss -t4 state fin-wait-2 command to list sockets in fin wait 2 state


          • Order of rules is very important.


          • Better use the iptables-save / iptables-restore / iptables-apply tools to safety rule set changing.






          share|improve this answer

























          • i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

            – reis
            Apr 23 at 13:39











          • ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

            – Anton Danilov
            Apr 23 at 13:43












          • >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

            – reis
            Apr 24 at 5:54












          • For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

            – Anton Danilov
            Apr 24 at 6:49












          • I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

            – reis
            Apr 24 at 8:04















          0














          Unfortunately I haven't found any notes about checking the tcp flags in the ufw manual.



          In iptables your scenario can be implemented in some complex way using the ipset, but there are some limitations. I guess, your host is the tcp client, and server port number is 1234 (free to change it).



          # create the ipset list for fin_wait sockets.
          # every entry is tuple (local-ip,local-port,remote-ip)
          ipset create fin_wait hash:ip,port,ip timeout 3000

          # if local host sends the fin packet inside established connection
          # add entry into fin_wait list
          iptables -A OUTPUT
          -p tcp --tcp-flags FIN FIN
          --dport 1234
          -m conntrack --ctstate ESTABLISHED
          -j SET --add-set fin_wait src,src,dst --exist

          # if local host receives the fin packet for fin wait socket
          # drop it before tcp stack processing
          iptables -A INPUT
          -p tcp --tcp-flags FIN FIN
          --sport 1234
          -m set --match-set fin_wait dst,dst,src
          -j DROP


          For server there is difference.



          # create list for test clients
          ipset create test_clients hash:ip

          # add addresses of test clients
          ipset add test_clients 192.168.100.10

          # create list for clients in fin wait state
          # server ip,port is known, so ip,port type is enough
          ipset create fin_wait_clients hash:ip,port timeout 3000

          # if server receives fin from test client
          # add client's ip,port into set
          iptables -A INPUT -p tcp
          --dport 1234
          --tcp-flags FIN FIN
          -m set --match-set test_clients src
          -j SET --add-set fin_wait_clients src,src --exist

          # if server sends fin to test client as reply
          # block this fin
          iptables -A OUTPUT -p tcp
          --sport 1234
          --tcp-flags FIN FIN
          -m set --match-set fin_wait_clients dst,dst
          -j DROP


          Some notes:



          • Use ipset list fin_wait command to list the current blocked entries from iptables' point of view


          • Use ss -t4 state fin-wait-2 command to list sockets in fin wait 2 state


          • Order of rules is very important.


          • Better use the iptables-save / iptables-restore / iptables-apply tools to safety rule set changing.






          share|improve this answer

























          • i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

            – reis
            Apr 23 at 13:39











          • ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

            – Anton Danilov
            Apr 23 at 13:43












          • >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

            – reis
            Apr 24 at 5:54












          • For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

            – Anton Danilov
            Apr 24 at 6:49












          • I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

            – reis
            Apr 24 at 8:04













          0












          0








          0







          Unfortunately I haven't found any notes about checking the tcp flags in the ufw manual.



          In iptables your scenario can be implemented in some complex way using the ipset, but there are some limitations. I guess, your host is the tcp client, and server port number is 1234 (free to change it).



          # create the ipset list for fin_wait sockets.
          # every entry is tuple (local-ip,local-port,remote-ip)
          ipset create fin_wait hash:ip,port,ip timeout 3000

          # if local host sends the fin packet inside established connection
          # add entry into fin_wait list
          iptables -A OUTPUT
          -p tcp --tcp-flags FIN FIN
          --dport 1234
          -m conntrack --ctstate ESTABLISHED
          -j SET --add-set fin_wait src,src,dst --exist

          # if local host receives the fin packet for fin wait socket
          # drop it before tcp stack processing
          iptables -A INPUT
          -p tcp --tcp-flags FIN FIN
          --sport 1234
          -m set --match-set fin_wait dst,dst,src
          -j DROP


          For server there is difference.



          # create list for test clients
          ipset create test_clients hash:ip

          # add addresses of test clients
          ipset add test_clients 192.168.100.10

          # create list for clients in fin wait state
          # server ip,port is known, so ip,port type is enough
          ipset create fin_wait_clients hash:ip,port timeout 3000

          # if server receives fin from test client
          # add client's ip,port into set
          iptables -A INPUT -p tcp
          --dport 1234
          --tcp-flags FIN FIN
          -m set --match-set test_clients src
          -j SET --add-set fin_wait_clients src,src --exist

          # if server sends fin to test client as reply
          # block this fin
          iptables -A OUTPUT -p tcp
          --sport 1234
          --tcp-flags FIN FIN
          -m set --match-set fin_wait_clients dst,dst
          -j DROP


          Some notes:



          • Use ipset list fin_wait command to list the current blocked entries from iptables' point of view


          • Use ss -t4 state fin-wait-2 command to list sockets in fin wait 2 state


          • Order of rules is very important.


          • Better use the iptables-save / iptables-restore / iptables-apply tools to safety rule set changing.






          share|improve this answer















          Unfortunately I haven't found any notes about checking the tcp flags in the ufw manual.



          In iptables your scenario can be implemented in some complex way using the ipset, but there are some limitations. I guess, your host is the tcp client, and server port number is 1234 (free to change it).



          # create the ipset list for fin_wait sockets.
          # every entry is tuple (local-ip,local-port,remote-ip)
          ipset create fin_wait hash:ip,port,ip timeout 3000

          # if local host sends the fin packet inside established connection
          # add entry into fin_wait list
          iptables -A OUTPUT
          -p tcp --tcp-flags FIN FIN
          --dport 1234
          -m conntrack --ctstate ESTABLISHED
          -j SET --add-set fin_wait src,src,dst --exist

          # if local host receives the fin packet for fin wait socket
          # drop it before tcp stack processing
          iptables -A INPUT
          -p tcp --tcp-flags FIN FIN
          --sport 1234
          -m set --match-set fin_wait dst,dst,src
          -j DROP


          For server there is difference.



          # create list for test clients
          ipset create test_clients hash:ip

          # add addresses of test clients
          ipset add test_clients 192.168.100.10

          # create list for clients in fin wait state
          # server ip,port is known, so ip,port type is enough
          ipset create fin_wait_clients hash:ip,port timeout 3000

          # if server receives fin from test client
          # add client's ip,port into set
          iptables -A INPUT -p tcp
          --dport 1234
          --tcp-flags FIN FIN
          -m set --match-set test_clients src
          -j SET --add-set fin_wait_clients src,src --exist

          # if server sends fin to test client as reply
          # block this fin
          iptables -A OUTPUT -p tcp
          --sport 1234
          --tcp-flags FIN FIN
          -m set --match-set fin_wait_clients dst,dst
          -j DROP


          Some notes:



          • Use ipset list fin_wait command to list the current blocked entries from iptables' point of view


          • Use ss -t4 state fin-wait-2 command to list sockets in fin wait 2 state


          • Order of rules is very important.


          • Better use the iptables-save / iptables-restore / iptables-apply tools to safety rule set changing.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 24 at 8:09

























          answered Apr 23 at 12:05









          Anton DanilovAnton Danilov

          58625




          58625












          • i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

            – reis
            Apr 23 at 13:39











          • ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

            – Anton Danilov
            Apr 23 at 13:43












          • >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

            – reis
            Apr 24 at 5:54












          • For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

            – Anton Danilov
            Apr 24 at 6:49












          • I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

            – reis
            Apr 24 at 8:04

















          • i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

            – reis
            Apr 23 at 13:39











          • ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

            – Anton Danilov
            Apr 23 at 13:43












          • >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

            – reis
            Apr 24 at 5:54












          • For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

            – Anton Danilov
            Apr 24 at 6:49












          • I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

            – reis
            Apr 24 at 8:04
















          i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

          – reis
          Apr 23 at 13:39





          i don't see the 'ss -t4 ...' part of the rule, should it be part of the rule? Can you please add a destination port for which the rule is valid?

          – reis
          Apr 23 at 13:39













          ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

          – Anton Danilov
          Apr 23 at 13:43






          ss -t4 state fin-wait-2 isn't a part of any rule, it's a separate command to list sockets in a host system. Most suitable set type is ip.port,ip, so there isn't way to use full 4-elements tuples and destination port, but you can add the server side port number with adding --dport <NUM> / --sport <NUM> into OUTPUT / INPUT rules.

          – Anton Danilov
          Apr 23 at 13:43














          >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

          – reis
          Apr 24 at 5:54






          >>> I guess, your host is the tcp client, and server port number is 1234. I want to apply the rules at the server. So the incomming connection is at port 20000 in this case. I've added the rules but I don't see any blocked entries. Something wrong with INPUT and OUTPUT?

          – reis
          Apr 24 at 5:54














          For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

          – Anton Danilov
          Apr 24 at 6:49






          For server need other rules. I'll edit the answer to provide the rules for server too. I've written rules for client because you asked about client, not server.

          – Anton Danilov
          Apr 24 at 6:49














          I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

          – reis
          Apr 24 at 8:04





          I've got a "bad argument 'test_clients' '" probably because of the line "-m set test_clients src"

          – reis
          Apr 24 at 8:04

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f964178%2fdrop-fin-packet-with-iptables-rule%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

          Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

          Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020