summaryrefslogtreecommitdiffstats
path: root/sshuttle/linux.py
diff options
context:
space:
mode:
authorScott Kuhl <kuhl@mtu.edu>2021-05-31 23:33:55 -0400
committerScott Kuhl <kuhl@mtu.edu>2021-07-12 11:24:29 -0400
commitbc065e368d9888a2f5816e5a498dfe33cb5dca8a (patch)
tree283d1006e8bb52aeb3f2348a7ad7b0fb817400fd /sshuttle/linux.py
parent6ae0b51c61b43d7ac76b59248da0d2c127308c71 (diff)
Remove ttl hack & require -r option.
Previously, it was possible to run sshuttle locally without using ssh and connecting to a remote server. In this configuration, traffic was redirected to the sshuttle server running on the localhost. However, the firewall needed to distinguish between traffic leaving the sshuttle server and traffic that originated from the machine that still needed to be routed through the sshuttle server. The TTL of the packets leaving the sshuttle server were manipulated to indicate to the firewall what should happen. The TTL was adjusted for all packets leaving the sshuttle server (even if it wasn't necessary because the server and client were running on different machines). Changing the TTL caused trouble and some machines, and the --ttl option was added as a workaround to change how the TTL was set for traffic leaving sshuttle. All of this added complexity to the code for a feature (running the server on localhost) that is likely only used for testing and rarely used by others. This commit updates the associated documentation, but doesn't fully fix the ipfw method since I am unable to test that. This change will also make sshuttle fail to work if -r is used to specify a localhost. Pull request #610 partially addresses that issue. For example, see: #240, #490, #660, #606.
Diffstat (limited to 'sshuttle/linux.py')
-rw-r--r--sshuttle/linux.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/sshuttle/linux.py b/sshuttle/linux.py
index 7b0a471..5055fc0 100644
--- a/sshuttle/linux.py
+++ b/sshuttle/linux.py
@@ -49,25 +49,3 @@ def nft(family, table, action, *args):
rv = ssubprocess.call(argv, env=get_env())
if rv:
raise Fatal('%r returned %d' % (argv, rv))
-
-
-_no_ttl_module = False
-
-
-def ipt_ttl(family, *args):
- global _no_ttl_module
- if not _no_ttl_module:
- # we avoid infinite loops by generating server-side connections
- # with ttl 63. This makes the client side not recapture those
- # connections, in case client == server.
- try:
- argsplus = list(args)
- ipt(family, *argsplus)
- except Fatal:
- ipt(family, *args)
- # we only get here if the non-ttl attempt succeeds
- log('WARNING: your iptables is missing '
- 'the ttl module.')
- _no_ttl_module = True
- else:
- ipt(family, *args)