GithubHelp home page GithubHelp logo

kone's Introduction

github workflow codecov

KONE

The project aims to improve the experience of accessing internet in home/enterprise network.

The name "KONE" comes from k1, a chronometer made by Larcum Kendall and played a important role in Captain Cook's voyage.

By now, it supports:

Use

go build ./cmd/kone
sudo ./kone -debug -config cmd/kone/test.ini

For more information, please read test.ini.

Web Status

The default web status port is 9200 , just visit http://localhost:9200/ to check the kone status.

Documents

License

The MIT License (MIT) Copyright (c) 2016 xjdrew

kone's People

Contributors

flowerwrong avatar mrmohebi avatar raindylong avatar suchmokuo avatar xjdrew avatar yinheli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kone's Issues

没懂

没太懂你这个内网穿透实现的原理,感觉上不需要第三个公网服务器?

在虚拟机内运行的 kone 无法被其它同一网段内任何设备访问到

虚拟机配置

系统: Ubuntu 1604 x64
网卡: 桥接模式
已开启 IP 转发 (sysctl -w net.ipv4.ip_forward=1)
防火墙已关闭

宿主机配置

系统: Arch Linux
已开启 IP 转发
防火墙已关闭
已添加路由表:

ip route add 10.192.0.0/16 via 192.168.1.16 dev enp4s0f2

宿主机 DNS 已改为 10.192.0.1.

kone 配置文件

[general]
# outbound network interface
#out = eth0
# out = enp4s0f2

# virtual network

# tun name, auto allocate if not set
# DEFAULT VALUE: ""
# tun = tun0

# inet addr/mask
# DEFAULT VALUE: 10.192.0.1/16
network = 10.192.0.1/16

# nat config
[tcp]
#listen-port = 82
#nat-port-start = 10000
#nat-port-end = 60000

[udp]
#listen-port = 82
#nat-port-start = 10000
#nat-port-end = 60000

[dns]
# DEFAULT VALUE: 53
dns-port = 53

# backend dns
# DEFAULT VALUE: 114.114.114.114, 223.5.5.5
# nameserver = 172.16.100.200
# nameserver = 172.16.100.202
# 虚拟机的 127.0.0.1:53 上运行了一个dns服务
nameserver = 127.0.0.1

# dns-ttl = 600
# dns-packet-size = 4096
# dns-read-timeout = 5
# dns-write-timeout = 5

[route]
# eg: sudo ip route add 91.108.4.0/22 dev tun0
v = 91.108.4.0/22
v = 91.108.56.0/22
v = 109.239.140.0/24
v = 149.154.160.0/20
v = 149.154.167.0/24

# define a proxy named "A"
# [proxy "A"]
# url = http://example.com:3228

# define a proxy named "B"
[proxy "socks5-default"]
url = socks5://127.0.0.1:1080
default = yes

# define a pattern and outbound proxy
# if don't set proxy, packets will be sent to target directly
[pattern "proxy-website"]
proxy = socks5-default
scheme = DOMAIN-SUFFIX
v = twitter.com
v = facebook.com

[pattern "proxy-website-keyword"]
proxy = socks5-default
scheme = DOMAIN-KEYWORD
v = google
v = gmail

[pattern "direct-website"]
scheme = DOMAIN-SUFFIX
v = cn
v = apple.com

[pattern "direct-website-keyword"]
scheme = DOMAIN-KEYWORD
v = baidu
v = qq

[pattern "internal-ip"]
scheme = IP-CIDR
v = 172.16.0.0/16
v = 192.168.0.0/16

[pattern "proxy-country"]
proxy = socks5-default
scheme = IP-COUNTRY
v = US
v = HK

# rules define the order of checking pattern
[rule]
# pattern = proxy-website
# pattern = proxy-website-keyword
# pattern = direct-website
# pattern = direct-website-keyword
# pattern = internal-ip
# pattern = proxy-country
# set to a proxy for domaines that don't match any pattern
# DEFAULT VALUE: ""
final = socks5-default

[manager]
listen = "127.0.0.1:9200"

问题描述

上述配置在宿主机内均能正常使用。
在虚拟机内运行 kone 后,运行命令 curl https://google.com 能在虚拟机内看到 kone 收到了 DNS 请求。同时使用 WireShark 抓包,发现 crul 在向 10.192.x.x 发送 SYN 请求,但未能从 10.192.x.x 收到 ACK。
运行命令 dig google.com 后得到 10.192.25.217,然后 ping 该 IP 有时候得不到任何回应,有时候会收到 Redirect Host(New addr: 192.168.1.x(虚拟机的IP地址))

;; Got recursion not available from

已经假设kone好几天了

不过如果dns,一个使用kone,一个使用别的,nslookup不一会就会出现这个错误:
;; Got recursion not available from [kone dns server]

然后就使用另一个dns了。
这个是什么原因呢,我现在只好架设了两个kone server。

Should we support windows 7 ?

Hi !

I forked this repo, and then I tried to make it support windows, now it works on windows 10.

However, due to using PowerShell's NETTCPIP module to set route table and some other stuff, it's not possible to work under windows 8. But I think there are still many windows 7 users, and it's possible to do the same thing with NETSH instead of PowerShell, so what's your opinion about support windows 7 or not?

By the way, could I open a pull request to help this project support windows ?

Thanks !

Kone will crash every 10 mins around

I use kone script in my company within 300 stuffs.
Now when I set kone as the dns server, it will crash at interval of 10 mins.
So how can I help to find the reason? May be I can fetch some logs.

大量 grap tunnel failed错误,有什么影响?

使用了一小段时间,发现大量 grap tunnel failed错误,有什么影响?请问怎么解决,只是好像也能使用

16-10-13 12:09:11.298 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:11.458 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:11.779 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:12.420 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:13.701 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:15.297 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10000 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:16.367 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:16.368 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:16.531 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:16.858 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.511 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.730 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.733 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.737 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.853 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.861 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:17.893 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.100 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.108 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.214 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.342 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.491 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.592 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.600 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.788 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.816 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:18.854 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:19.380 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:19.577 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:19.585 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.139 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.367 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10001 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.375 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.538 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.565 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:20.866 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.518 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.546 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.553 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.730 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10003 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.730 ERRO @udp_relay.go:115 [udp] 10.192.135.89:10002 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:21.737 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10004 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:22.284 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:22.343 ERRO @udp_relay.go:115 [udp] 10.192.29.6:10005 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:22.408 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:22.654 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:22.823 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:23.148 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.132 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.369 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10006 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.396 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.430 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10009 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.559 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.591 ERRO @udp_relay.go:115 [udp] 10.192.53.92:10009 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:24.886 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:25.539 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:26.101 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:26.284 ERRO @udp_relay.go:115 [udp] 10.192.54.114:10007 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:26.844 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed
16-10-13 12:09:28.396 ERRO @udp_relay.go:115 [udp] 10.192.37.162:10008 > 10.192.0.1:82: grap tunnel failed

支持windows吗?

我有看到 windows 的 tun device,而且 water 现在也是支持win的.... so.....

配置后,本机能访问,其他机器不能访问,是否需要开启防火墙nat转发?

一台linux服务器,安装代理和kone,修改路由器加静态路由表,

linux本机,配置相关dns可以直接透明上网,局域网其他机器指定linux服务器IP为dns,ping www.google.com 也是返回的10.192.x.x 但是就不能上外网。

kone日志
16-10-10 16:46:42.529 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32307 > 10.192.80.84:443: shape to 10.192.80.84:10226 > 10.192.0.1:82
16-10-10 16:46:42.539 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32308 > 10.192.80.84:443: shape to 10.192.80.84:10227 > 10.192.0.1:82
16-10-10 16:46:47.339 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32309 > 10.192.123.118:443: shape to 10.192.123.118:10228 > 10.192.0.1:82
16-10-10 16:46:47.551 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32310 > 10.192.54.114:80: shape to 10.192.54.114:10229 > 10.192.0.1:82
16-10-10 16:46:49.899 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32312 > 10.192.51.191:443: shape to 10.192.51.191:10230 > 10.192.0.1:82
16-10-10 16:46:54.382 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32313 > 10.192.80.84:443: shape to 10.192.80.84:10231 > 10.192.0.1:82
16-10-10 16:47:01.430 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32315 > 10.192.80.84:443: shape to 10.192.80.84:10232 > 10.192.0.1:82
16-10-10 16:47:01.530 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32316 > 10.192.80.84:443: shape to 10.192.80.84:10233 > 10.192.0.1:82
16-10-10 16:47:06.240 DEBU @tcp_relay.go:141 [tcp] 192.168.1.42:32317 > 10.192.123.118:443: shape to 10.192.123.118:10234 > 10.192.0.1:82
16-10-10 16:47:08.837 DEBU @tcp_relay.go:141 [tcp] 10.192.0.1:37504 > 10.192.51.191:443: shape to 10.192.51.191:10235 > 10.192.0.1:82

192.168.1.42 是局域网其他IP,我发现经过nat到82 端口就断开了

另外PS: 配置文件里:
[route]

telegram

v = 91.108.0.0/16
v = 149.154.0.0/16

是干嘛用的,我发现会加入linux本地路由表

树莓派的wifi

树莓派的wifi似乎不是很稳定 之前搭建过树莓派路由 所以不知道效果如何

请求无限循环

你好,向您请教一个问题。

假设在config.ini中配置了对应的规则后,如果判断为通过代理连接,但是代理服务器(本地代理)中分流时判断为直连,此时连接是否会无限循环?

当kone用在百人的企业中,存在的瓶颈

目前为止,kone的dns效率不错,而且路由瓶颈也能解决,但是,kone作为一个超大的socks5代理服务器,感觉,针对那么包进行封包、解包的性能受到限制了。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.