I need to closing two or more open firewall ports in tails. How can I send the command to do this?
Hmmpt - you have to "Bind()" and "Close()". Some Linux / Unix will support "rfkill" - all described in SVID and POSIX and just not in Windows, since this is IPX/SPX that has no "options". These define what the drivers should do during transmission and when this completes and close. Most important "Socket options" are
- KEEPALIVE and
- DONTLINGER and
Keepalive is to send a "sense" signal, but with loose wires, this would disconnect things all the time, hence Windows will disable it, and set sockets to remain alive after disconnect. Lingering is what to do when the application terminates, should it wait to allow the application to come back and reconnect. Well, on Unix this was no option, and Unix needed the app to be alerted, and connection taken down unless you coded security to be applied for reconnect. So no lingering sockets, but on Windows, tasks terminate and restarted all the time, there is no hierarchical resource allocation. And network connections should be shared. REUSEADDR is for the driver to allocate and block shared memory, and keep on using the same buffers whatever happens. Fine on Windows where others can look at what goes on and everything shared, but not on Unix / Posix and Linux: buffers are given by the kernel that has to keep these away from swapping. The "Lingering" can be observed as various "WAIT" states on connections. This state is not a valid TCP/IP state and sockets in these states can be killed - on Linux systems they are sockets kept around to allow others to use them. Kill them on the router will cause the "kill" signal top be issued that you can trap in the application. Please read the standard and do not assume that the very special Windows ways are correct and applicable in general.