Skip to content

Commit

Permalink
Added note about system TCP interference
Browse files Browse the repository at this point in the history
Includes a script to filter interfering TCP segments using nftables.
  • Loading branch information
TheJokr committed Apr 6, 2019
1 parent 8edb4c4 commit c6e8ff5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tcpreq-nft.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Delete afterwards with: nft delete table inet tcpreq
# The kernel-out chain filters all TCP segments from the ports
# used by tcpreq unless the socket was created by the tcpreq user
# Whitelisting is necessary because the kernel skips meta skuid checks
table inet tcpreq {
chain kernel-out {
type filter hook output priority 10; policy drop;
meta skuid tcpreq accept
meta l4proto != tcp accept
tcp sport < 49152 accept
}
}
2 changes: 2 additions & 0 deletions tcpreq/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def _process_results(test: Type[BaseTest], targets: Sequence[Tuple[AnyIPAddress,
print(out)


# Make sure to prevent the kernel TCP stack from interfering
# See e.g. tcpreq-nft.conf for an nfttables script
def main() -> None:
args = parser.parse_args()
loop = asyncio.SelectorEventLoop()
Expand Down

0 comments on commit c6e8ff5

Please sign in to comment.