Comments (6)
实测了一下 配合socat 可以转发ssh 命令如下
先运行
socat TCP4-LISTEN:27022,reuseaddr,reuseport,fork TCP4:127.0.0.1:8022
再运行
python natter.py -v 27022
然后通过外网ip端口就可以访问到本地的8022的ssh了
环境 termux on Android7.1 Linux 3.10.104
电信光猫桥接 路由器拨号 NAT1 DMZ到Android设备
from natter.
是的,socat 默认不允许端口重用。
可以尝试使用类似 tcp-listen:2081,reuseaddr,reuseport,fork
的参数,但不一定有用。
用户级的端口转发有以下缺点:
- 较为耗费资源,如CPU使用率;
- 目标端口服务获取到的IP地址永远为
127.0.0.1
; - 可能不支持端口重用,导致无法打洞。
因此,能使用防火墙的端口转发,就不用折腾其他转发了。
(暂时还没有写插件的打算,希望有luci大神帮个忙)
from natter.
socat似乎在iptables的下一层,我一开始也是进入误区,测试发现应用层的转发似乎是不行的,必须在网络层直接转发端口。
from natter.
但是很多情况没有办法操作iptables 比如没有root的安卓设备 在这种情况下 集成一个应用级的端口转发功能 应该是很好的
另外 不知是feature 还是bug 似乎-t的http服务只能连接一次 比如用手机作为客户端,用手机流量连接好后 关闭流量 再开启流量 再访问 就无法成功
from natter.
但是很多情况没有办法操作iptables 比如没有root的安卓设备 在这种情况下 集成一个应用级的端口转发功能 应该是很好的
另外 不知是feature 还是bug 似乎-t的http服务只能连接一次 比如用手机作为客户端,用手机流量连接好后 关闭流量 再开启流量 再访问 就无法成功
我也发现了,还以为我打洞失败了
from natter.
是bug (。 ́︿ ̀。)
在修了在修了
目前还没有版本号,只能算是个玩具
from natter.
Related Issues (20)
- Windows 下 python 通知脚本无法调用 HOT 1
- docker版本使用 -m iptables好像有权限问题 HOT 3
- V2版链接无法保持,多次会断开重新打洞 HOT 4
- 【群晖】iptables报错,不认识 -m comment --comment NATTER_UUID=44dd0b25-3284-4d10-b9a2-001aff022804 HOT 4
- 使用 nattertool/natter:alpine 镜像,-m iptables 实际修改变为 nftables
- ufw阻止natter.py打洞 HOT 3
- CentOS 下使用 Docker,启动时出现 socket.gaierror HOT 4
- [Notice] 相关讨论已迁移至 Discussions 板块
- 内核模式启动失败 HOT 2
- Nginx-Cloudflare示例运行失败 HOT 6
- 关于Nginx-Cloudflare配置参数求解 HOT 1
- 用cf-redir.py文件调用后报python3\r不知道哪里的问题 HOT 1
- 使用UDP协议遇到问题 HOT 4
- the port is supposedly open but it is not possible to log in. HOT 2
- A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself. HOT 12
- 当 UPnP 扫描到的 URL 不含路径时,出现 ValueError HOT 1
- UPnP 服务端返回错误时,Natter 不能正常打印错误日志 HOT 1
- RouterOS 下 UPnP 不能正常工作 HOT 2
- Invalid format for X-Auth-Key header HOT 2
- uPnP无法使用 HOT 14
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 natter.