Comments (4)
I'm seeing this as well under Mac OS X 10.10. You shouldn't even have to specify it explicitly, as main.py has excludes = ['127.0.0.0/8'].
To reproduce:
$ nc -l 7777
$ echo hello | nc -v localhost 7777
(in another terminal)
Expected behavior:
terminal1 prints "hello"
Observed behavior with sshuttle running (sshuttle -r remote-host 0/0
)
terminal1: no output
terminal2: nc: connectx to localhost port 7777 (tcp) failed: Connection refused
However, if I run nc -l 7777 on remote-host, the connections goes through, so sshuttle is clearly forwarding localhost across the interface.
$ sudo pfctl -a sshuttle -t exclude_subnets -T show
127.0.0.0/8
So localhost is getting added to the pf exclude_subnets table.
$ sudo pfctl -a sshuttle -sn
rdr pass on lo0 inet proto tcp from any to <include_subnets> -> 127.0.0.1 port 12300
$ sudo pfctl -a sshuttle -sr
pass out route-to lo0 inet proto tcp from any to <include_subnets> flags S/SA keep state
pass out route-to lo0 inet proto tcp from any to <exclude_subnets> flags S/SA keep state
It looks like the include_subnets and exclude_subnets tables are being treated identically. I don't know whether it's intentional, but it looks odd.
edit: upon further thought, maybe that isn't so odd; only the firewall rules are identical, but the include_subnets are (apparently) selected for special treatment in the nat rules. The trouble is that if include_subnets has a subnet that includes an entry in exclude_subnets, it will "swallow" the latter.
from sshuttle.
It looks like the "pass out route-to" issue is a bug in the latest homebrew version, which has been fixed in sshuttle/sshuttle master.
$ sudo pfctl -a sshuttle -sn
rdr pass on lo0 inet proto tcp from any to <include_subnets> -> 127.0.0.1 port 12300
$ sudo pfctl -a sshuttle -sr
pass out route-to lo0 inet proto tcp from any to <include_subnets> flags S/SA keep state
pass out quick proto tcp from any to <exclude_subnets> flags S/SA keep state
Even in master, though, localhost isn't properly excluded because the rdr applies to all lo0 packets, not just ones rerouted there.
The solution is a no rdr on lo0 inet proto tcp from any to 127.0.0.0/8
rule. I have a pull request that fixes the issue by treating the rules the same way as other firewall backends do, sorting the rules by specificity and explicitly adding a 'no rdr' for excluded rules. As long as the pass rules are correct, only 127.0.0.0/8 actually needs the 'no rdr' rule, so someone may want to implement a fix differently.
from sshuttle.
The above pull request is an improvement over my first change, as it still takes advantage of table rules rather than resorting to a (potentially less efficient) list of individual rules.
from sshuttle.
Fixed by merging #16.
from sshuttle.
Related Issues (20)
- tunneling on cpanel server
- Support for Comments in Exclusion File
- help pls HOT 4
- Sshuttle not working in combination with WireGuard on macOS Ventura 13.4.1
- ipv6 disabled in kernel, sshuttle breaking HOT 2
- Possibility of giving each connected client a virtual IP address?
- Can't make sshuttle works with ipv6 on archlinux since 1rst august HOT 1
- Cannot use Human Readable # prefixed comments as shown in one of the example configs.
- sshuttle fails on WSL2 Ubuntu 22.04.2 due to iptables OUTPUT CHAIN_ADD failure HOT 3
- Bypassing Internet Censorship HOT 1
- can't connect - "Whats wrong" HOT 4
- removing python requirement for systems with sshuttle preinstalled HOT 3
- SSHuttle Interferes with qemu networking on MacOS
- sw HOT 1
- Stopped working on MacOS Sonama HOT 7
- sshuttle seems to connect fine, but doesn't route traffic to the remote network HOT 1
- refused connections incorrectly get accepted HOT 5
- sshuttle woes with MacOS Sonoma HOT 8
- Sshutlle HOT 1
- failed to establish ssh session (2) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sshuttle.