V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  datocp  ›  全部回复第 269 页 / 共 307 页
回复总数  6136
1 ... 265  266  267  268  269  270  271  272  273  274 ... 307  
❮ ❯
2015 年 12 月 19 日
回复了 t895 创建的主题 › 宽带症候群 › CN2 香港,还需要锐速吗?
以前研究 routeros 的时候研究了一下小包, ros 竟然不支持 tc 。网上的小包都是 iptables -t mangle -A QOSDOWN -m length --length 256: -j GAME_BURST

其实 tomato 里是这样的
#$TC filter add dev $UDEV parent 1:0 prio 12 protocol arp handle 1 fw classid 1:20 # Arp traffic
$TC filter add dev $UDEV parent 1: prio 13 protocol ip u32 match ip protocol 1 0xff flowid 1:20 #ICMP
#$TC filter add dev $UDEV parent 1: prio 14 protocol ip u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x10 0xff at 33 flowid 1:20 #ACK
$TC filter add dev $UDEV parent 1: prio 15 protocol ip u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x02 0x02 at 33 flowid 1:20 #SYN
#$TC filter add dev $UDEV parent 1: prio 17 protocol ip u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x01 0x01 at 33 flowid 1:20 #FIN
#$TC filter add dev $UDEV parent 1: prio 19 protocol ip u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 2 match u8 0x04 0x04 at 33 flowid 1:20 #RST

不会抓包,无法分析孰优孰劣。

目前能用的最简单的就是根据访问目的端口分级,这个以前已经被一个朋友批判过了。。。他用的是一种商业流控模块,类似 l7 之类的东东,对各种数据流进行分级,然后打上 DSCP 标记,再根据 DSCP 标记来分流。

上次做 vpn 分流时,倒发现一种方法蛮好的,其实大家都在做,找一个国内的 100mbps 上行服务器,然后受限资源通过 vpn 连接 cn2 服务器,在国内的服务器上做策略路由,这样也可以用一些便宜的线路分流一下。
2015 年 12 月 19 日
回复了 andybest 创建的主题 › 宽带症候群 › 为什么 ping 主机 90% 丢包率,但 SSH 命令流畅不卡?
日本的,这会儿又正常了。。。
2015 年 12 月 19 日
回复了 a4222012 创建的主题 › 问与答 › 得了牙周炎,感觉要去拔牙了。
上次我姑父在医院说的时候我也告诉他先试试用和盐一起刷,结果一看医生就变成拨牙了。。。盐有效果的,可以先刷个几天,不行再拨吧。盐应该有消炎止痛的效果,医院的很多点滴还叫 盐水 呢。
2015 年 12 月 19 日
回复了 a4222012 创建的主题 › 问与答 › 得了牙周炎,感觉要去拔牙了。
试试,搞点盐上去刷。人太累也容易表现在牙齿上。
2015 年 12 月 19 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
conoha z.com 的 dns 都是比较怪的,说不出来的问题在哪,比如使用 google 显示的是上海 广州,也不知道用了什么黑科技,最终发现使用 8.8.x.x 也是有问题的,干脆就使用美国的 dns 服务器。自己 apt-get install dnsmasq ,然后 vi /etc/dnsmasq.conf,service dnsmasq restart 就差不多了。检验 nslookup fonts.googleapis.com ,如果不成功可以尝试 vi /etc/resolv.conf 写入 nameserver 127.0.0.1 ,给 chattr +i /etc/resolv.conf,取消只读 chattr -i /etc/resolv.conf


dnsmasq.conf
#no-resolv
server=4.2.2.1
server=4.2.2.2
#server=8.8.4.4
#server=8.8.8.8
#address=/fonts.googleapis.com/74.125.196.95
server=/fonts.googleapis.com/4.2.2.1
2015 年 12 月 19 日
回复了 andybest 创建的主题 › 宽带症候群 › 为什么 ping 主机 90% 丢包率,但 SSH 命令流畅不卡?
嘿嘿,搬瓦工 vs vultr ,丢包丢得你不想用,vultr 家的不知道是自身问题还是。。。这丢包还有什么速度,连接时都是各种出错。。。

http://ww4.sinaimg.cn/large/0060lm7Tgw1ez4vqkdyiwj311s0m546g.jpg
2015 年 12 月 18 日
回复了 LINAICAI 创建的主题 › 问与答 › 服务器有点多,应该拿来做什么呢
3 台了, 4.9T 的流量,一个人一个月用不了 100G 。
2015 年 12 月 18 日
回复了 Counter 创建的主题 › 问与答 › ufw 的状态是 active 但不生效
ufw 是谁造的轮子,虽然规则读起来很有语义还不如直接掌握 iptables 。
以前
iptables -P INPUT ACCEPT
iptables -A INPUT -j DROP #一直以为这句 DROP 所有连接,
一年后才发现根本没用,还是得默认 iptables -P INPUT DROP 才是真正的丢弃所有未允许的服务。
习惯用 iptables-save iptables-restore iptables -S INPUT 多熟悉一下常用防火墙结构也就那三两句。
2015 年 12 月 18 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
2015 年 12 月 18 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
晚上 21 : 14 分的。。。为什么什么样的 vps 都没什么惊喜,也许还没入电信黑名单吧。。。这还是锐速加速过后的。。。

http://ww2.sinaimg.cn/large/0060lm7Tgw1ez44g16mtsj30nf0dg0uk.jpg
2015 年 12 月 18 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
哎,中国的网络管制真是无法无天,从中间两边断开。太他妈无法无天了,还天天依法制国,制你妹。
2015 年 12 月 18 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
服务器端。。。。

2015.12.18 10:59:49 LOG3[20]: SSL_accept: Peer suddenly disconnected
2015.12.18 11:01:04 LOG3[21]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:09 LOG3[12]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:11 LOG3[15]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:11 LOG3[17]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:11 LOG3[18]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:11 LOG3[14]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:01:50 LOG3[23]: SSL_accept: Peer suddenly disconnected
2015.12.18 11:01:50 LOG3[24]: SSL_accept: Peer suddenly disconnected
2015.12.18 11:06:16 LOG3[32]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:16 LOG3[34]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:17 LOG3[33]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:17 LOG3[36]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:17 LOG3[28]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:17 LOG3[31]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:06:34 LOG3[56]: SSL_accept: Peer suddenly disconnected
2015.12.18 11:07:58 LOG3[50]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:07:58 LOG3[52]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:07:59 LOG3[53]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:22 LOG3[60]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:22 LOG3[65]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:39 LOG3[61]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:54 LOG3[66]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:55 LOG3[76]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:10:56 LOG3[78]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:11:55 LOG3[74]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:19:30 LOG4[ui]: Insecure file permissions on /da/ca/stunnel.pem
2015.12.18 11:21:08 LOG4[ui]: Insecure file permissions on /da/ca/stunnel.pem
2015.12.18 11:24:25 LOG3[0]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:31 LOG3[29]: Unexpected socket close (s_ssl_read)
2015.12.18 11:24:57 LOG3[5]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:57 LOG3[9]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:57 LOG3[6]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:57 LOG3[8]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:58 LOG3[4]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:24:59 LOG3[3]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:25:01 LOG3[7]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:25:27 LOG3[11]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:25:28 LOG3[12]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:26:27 LOG3[18]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:26:27 LOG3[19]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:26:29 LOG3[28]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:26:33 LOG3[15]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:26:34 LOG3[30]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:27:39 LOG3[31]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:07 LOG3[43]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:07 LOG3[38]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:07 LOG3[42]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:26 LOG3[44]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:46 LOG3[46]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:46 LOG3[48]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:46 LOG3[50]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:46 LOG3[49]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:28:55 LOG3[51]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:29:15 LOG3[55]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:29:30 LOG3[60]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:29:30 LOG3[59]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:33:32 LOG3[63]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:34:56 LOG3[64]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:34:56 LOG3[67]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:34:56 LOG3[70]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:34:56 LOG3[71]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:34:57 LOG3[66]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:01 LOG3[68]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:02 LOG3[72]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:07 LOG3[69]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:38 LOG3[86]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:42 LOG3[91]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:35:43 LOG3[74]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:36:17 LOG3[81]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:36:26 LOG3[79]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:36:26 LOG3[92]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:36:26 LOG3[77]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:36:41 LOG3[96]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:37:01 LOG3[102]: s_connect: s_poll_wait 23.251.96.136:80: TIMEOUTconnect exceeded
2015.12.18 11:37:02 LOG3[103]: s_connect: s_poll_wait 23.251.96.136:80: TIMEOUTconnect exceeded
2015.12.18 11:37:03 LOG3[104]: s_connect: s_poll_wait 23.251.96.136:80: TIMEOUTconnect exceeded
2015.12.18 11:38:24 LOG3[114]: Unexpected socket close (s_ssl_read)
2015.12.18 11:38:54 LOG3[106]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:38:55 LOG3[108]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:38:55 LOG3[107]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:38:57 LOG3[109]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:39:01 LOG3[105]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:39:01 LOG3[102]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:39:02 LOG3[103]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015.12.18 11:39:42 LOG3[101]: transfer: s_poll_wait: TIMEOUTclose exceeded: closing
2015 年 12 月 18 日
回复了 kj54321 创建的主题 › 宽带症候群 › 不吹不擂, vultr 东京实测
嘿嘿,我可以说别高兴太早,苦日子还在后头吗。。。这个服务器我还一个月都没试用完了。今天先是体验到 1000mbps 的情况,然后今天好像倒霉的就是测试了一下 softether vpn client ,结果现在成这样了,这是这段时间的最恐怖体验,已经基本不可用状态。。。。。。。。。。。。。

哎,真的别高兴太早,我以前推荐的时候,别的朋友就说很慢,现在轮到我说慢了,垃圾电信。

2015.12.18 19:35:44 LOG3[291]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[291]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[295]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[295]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[297]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[297]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[299]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG3[293]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[299]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG5[293]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[290]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[290]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[292]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[292]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[296]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[296]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[298]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[298]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[300]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[300]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG3[294]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:44 LOG5[294]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:44 LOG5[301]: Service [server6] accepted connection from 127.0.0.1:9127
2015.12.18 19:35:44 LOG6[301]: s_connect: connecting xxx.xxx.xxx.xxx:80
2015.12.18 19:35:48 LOG6[288]: Read socket closed (readsocket)
2015.12.18 19:35:48 LOG6[288]: SSL_shutdown successfully sent close_notify alert
2015.12.18 19:35:48 LOG5[288]: Connection closed: 529 byte(s) sent to SSL, 185807 byte(s) sent to socket
2015.12.18 19:35:54 LOG3[301]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:35:54 LOG5[301]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:35:54 LOG5[302]: Service [server6] accepted connection from 127.0.0.1:9129
2015.12.18 19:35:54 LOG6[302]: s_connect: connecting xxx.xxx.xxx.xxx:80
2015.12.18 19:36:04 LOG3[302]: s_connect: s_poll_wait xxx.xxx.xxx.xxx:80: TIMEOUTconnect exceeded
2015.12.18 19:36:04 LOG5[302]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
2015.12.18 19:36:04 LOG5[303]: Service [server6] accepted connection from 127.0.0.1:9131
2015 年 12 月 18 日
回复了 imcj 创建的主题 › VPS › 寻人一起合租一个 cn2 网络的 vps,各自按流量付费
iptables 计数并不准确的,这个计数就是用 tcpping 都能让它增加计数。其实都按量了,完全可以用 iptables knock door 方法,必要时敲开防火墙端口,平时屏蔽所有访问,这样流量就省了。
2015 年 12 月 18 日
回复了 lyping 创建的主题 › VPS › 腾讯云靠谱吗? Linode 还是腾讯云?
能翻你再想想那可怜的 100kb/s , 100kb 哦,用惯国外的大水管,再用回这种小水管受不了。又贵又烂,话说家里也有 140kb/s 上行, openwrt 都可以支撑各种 web vpn proxy 了。
先把这两篇基础的搞定,对 softether 就有个大概的了解。不懂为什么 softether 外面又有一层 socks 连接。如果用 vpn ,你原先的环境就要变化,按现在的设想是有个网关设备,统一将不同的代理服务器连接到本地虚拟机操作系统里的虚拟接口 soft soft1 soft2 soft3 ,然后用策略路由#ip rule add from 192.168.50.0/24 table outwall prio 1 或者干脆把相应的接口直接安装到特定的虚拟机里,原则上 xp 也是没问题的,太古董了没操作过。。。 linux ip route 策略路由不怎么熟悉,大体是这样。 softether 我已经好久没在国内网络用过了,担心穿墙时是否会被挡。

Softether on VPS Using Local Bridge
http://blog.lincoln.hk/blog/2013/05/17/softether-on-vps-using-local-bridge/
Build a LAN-to-LAN VPN (Using L3 IP Routing)
https://www.softether.org/4-docs/1-manual/A._Examples_of_Building_VPN_Networks/10.6_Build_a_LAN-to-LAN_VPN_(Using_L3_IP_Routing)
技术不值钱,我是听谁说的,说的最多的就是花钱买技术,大公司不都这样周而复始的兼并吗。

很多东西点破不值钱,所以不得不说有些技术很容易被复制,然后就不值钱了。。。
2015 年 12 月 18 日
回复了 fang2hou 创建的主题 › VPS › 问 2 个 VPS 租用的问题
最划算的方案是国内家里申请个 100mbps 宽带,如果有 10mbps 的上行也比买 vps 划算,有公网 ip 最好,没有然后了肯定比什么云都便宜。再放个 openwrt 路由装个 stunnel+softether 什么都解决了。
2015 年 12 月 18 日
回复了 Wowbeing 创建的主题 › VPS › 如何在 VPS 中建立给他人用的 SSH 账号用于 http 代理?
现在没什么人用 ssh 吧,最近的网络烂得,烂得到处是丢包,平时 ssh 操作都要哭了,但别提大流量。

ssh 只有一家 P 开头的而且用的还是 udp53 ssh 版本还是一个经过混淆的需要特殊的客户端才能连接。平时用 stunnel 多点,可惜手机端支持差了点,官方提供的 android 版本我都没在 x86 设备上加载成功过。 windows,openwrt 倒都有客户端。现在没好的工具翻墙各种困难。

基本服务器端
cert = /stunnel.pem
[SOCKS Server]
;PSKsecrets = /da/stunnel/secrets.txt
accept = :::1723
protocol = socks

客户端

client = yes
[server1]
accept = 127.0.0.1:1081
connect = xxx.xxx.xxx.xxx:1723
基础太差。。。很多东西理解起来也困难。

原先就是看了这篇文档以为很简单,结果还是有很多特定环境的限制,包括 ipv4+ipv6 环境,服务器不支持 ip6tables -t nat ,需要禁用 AAAA 查询,还包括 iproute2 的一些无底坑,这些坑在官方文档中都没有任何提及。
OpenWrt VPN 按域名路由
https://blog.sorz.org/p/openwrt-outwall/

redsocks2 原先在 openwrt 下面配置成功过,可是 vps 。。。反正在透明代理这块基本上网上能找到的实例,命令打一遍最终没效果,也不知道坑在哪里。。。

所以最终用 softether vpn ,这东东无比的强大,它本身就有虚拟网卡实现,最终基本甚至没用到任何的虚拟 L3 路由功能。目前实现的效果就是 就近访问日本 vps , vps 中一部分 youtube 流量中转的是美国 vps 上的流量,所以跟你想要实现的效果差不多。自己多试几遍吧,回头看看还是挺简单的,但是可扩展效果比透明代理好多了。实例虽然是用 dnsmasq ipset 特定域名,其实可以实现建立 ipset -N outwall4 nethash ,然后直接写路由表。

vpn 采用 softether vpn server
服务器端
创建虚拟 HUB server/管理虚拟 HUB/并添加用于客户端连接用的 管理用户
本地网桥设置 /将虚拟 HUB server 选择创建的类型 新 tap 设备的桥接,并输入设备名称 soft1
ifconfig tap_soft1 192.168.60.100
ifconfig tap_soft1 mtu 1392
添加 ipv6 地址,只是为了以后不需要改动服务器配置所以固定一个地址
ip address add fe80::4ac:20ff:fe9c:1000/128 dev tap_soft1
#ip address del fe80::4ac:20ff:fe9c:1000/128 dev tap_soft1

客户端
创建虚拟 HUB client/管理虚拟 HUB/管理级联连接 创建到服务器端的连接
本地网桥设置 /将虚拟 HUB client 选择创建的类型 新 tap 设备的桥接,并输入设备名称 soft1
ifconfig tap_soft1 192.168.60.200
ifconfig tap_soft1 mtu 1392
#ip address add fe80::4ac:20ff:fe9c:2000/128 dev tap_soft1
#ip address del fe80::4ac:20ff:fe9c:2000/128 dev tap_soft1

如果能互相 ping 通 vpn 连接已经没有任何问题。
ping 192.168.60.100
ping6 -I tap_soft1 fe80::4ac:20ff:fe9c:1000


* 2015 年 12 月 14 日星期一
- [bash] iptables iproute2 and multiple routes
http://aftermanict.blogspot.it/2015/11/bash-iptables-iproute2-and-multiple.html
- 今天按这篇文档一路设置下来第一次用 fwmark 成功设置路由,由于服务器并没有 ip6table_nat 模块,所以仅能使用 iptable_nat
- 另外似乎设置的 set-mark 3 和原先的 QOS 标记有冲突,只有在 iptables -t mangle -F 清空原先的标记时才有效果,应该是能解决的
- 这次设置最成功的地方在于不会有 vpn 客户端拔号时出现因为接口的问题而无法访问网络
- 另外第一次注意到 iptabes 的全局 ACCEPT 并不是万能的,像此例必须指定特定接口的 MASQUERADE 才可以成功。
/etc/sysctl.conf
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.all.rp_filter = 2
net.ipv4.ip_forward = 1

for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 0 >| $f ; done

iptables -I OUTPUT -o eth0 -p udp --dport 53 -m string --hex-string "|07|youtube|03|com|00001c|" --algo bm -j DROP

dnsmasq.conf
ipset=/youtube.com/outwall4,outwall6

iptables-restore /da/fw
ipset destroy outwall6
ipset -N outwall6 iphash family inet6
ipset destroy outwall4
ipset -N outwall4 iphash

##echo "200 outwall" >> /etc/iproute2/rt_tables
ipset -L outwall4 >/tmp/outwall4.tmp
for i in `sed -n "7,$ p" /tmp/outwall4.tmp`;do echo $i;ipset -D outwall4 $i;done
kill -HUP $(pidof dnsmasq)
nslookup www.youtube.com
nslookup m.youtube.com
nslookup youtube.com
#ipset 需要 dnsmasq 通过本地像 192.168.40.253:53 进行查询,直接外部 dns 服务器会没结果
ipset -L outwall4
iptables -t mangle -D PREROUTING -m mark --mark 0x0/0xff00 -m set --match-set outwall4 dst -j MARK --set-xmark 0xfe00/0xff00
iptables -t mangle -D OUTPUT -m mark --mark 0x0/0xff00 -m set --match-set outwall4 dst -j MARK --set-xmark 0xfe00/0xff00
iptables -t mangle -I PREROUTING 2 -m mark --mark 0x0/0xff00 -m set --match-set outwall4 dst -j MARK --set-xmark 0xfe00/0xff00
iptables -t mangle -I OUTPUT -m mark --mark 0x0/0xff00 -m set --match-set outwall4 dst -j MARK --set-xmark 0xfe00/0xff00
##ip route add 192.168.40.0/24 via 192.168.30.254 dev tap_soft
ip route flush table outwall
ip route add default via 192.168.30.254 dev tap_soft table outwall
#ip route add 192.168.40.0/24 via 192.168.30.254 dev tap_soft table outwall
ip rule del table outwall
ip rule add fwmark 0xfe00/0xff00 table outwall prio 1
#ip rule add from 192.168.50.0/24 table outwall prio 1
ip route flush cache

iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o vpns+ -j MASQUERADE
iptables -t nat -A POSTROUTING -o tap_soft -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


- 调整了原先的 qos 标记为 0x00/0xff ,路由标记为 0xfe00/0xff00,如果标记为 0xff00/0xff00 则变为 or 标记。注意使用 iptables -I 将规则放在最前面。有关 iptables xmark 的描述看不懂,有人说可以把不同的 mask 看成是 subnet 。
- qos-scripts currently uses the last 8 bits to mark traffic e.g.-j MARK --set-xmark 0x44/0xff
whereas multi-wan uses the next 8 bits (0xff00) to mask its marks:

http://ww2.sinaimg.cn/large/0060lm7Tgw1ez3lyv5dxgj30ty0nln42.jpg
http://ww4.sinaimg.cn/large/0060lm7Tgw1ez3m3qfm0xj30i00glq5o.jpg
1 ... 265  266  267  268  269  270  271  272  273  274 ... 307  
❮ ❯
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5264 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 74ms · UTC 02:13 · PVG 10:13 · LAX 18:13 · JFK 21:13
♥ Do have faith in what you're doing.