I’m trying to manually initiate and maintain a TCP connection for my networking class, and use macOS (11.4). When I send the initial SYN, and the server responds with SYN/ACK, my kernel then automatically responds by sending a packet to close the connection.
On Linux, you can use a command like the following to turn off these Kernel TCP resets:
iptables -A OUTPUT -p tcp –sport 8080:9000 –tcp-flags RST RST -j DROP
Is there a way to do this on macOS?
I was able to use a virtual Linux machine with Multipass to accomplish this, but it feels like there should be an easy way to do it natively on MacOS.
Matthew Ellison is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.