Anyconnect 如何强制 UDP 模式?目前想用 Anyconnect 做内网穿透,TCP 传输老是被 block,网路环境极其恶劣,也只有用 UDP 才能打洞出去。目前我 Anyconnect 的 Ocserv 服务模式使用 TCP 传输控制帧和认证信息,UDP 协议传输数据。怎么能全局使用 UDP 传输认证信息 /控制帧,同时也传输数据?
1
mandymak 2018-06-04 15:25:53 +08:00
@zhouyut001 把 tcp port = 68 改为#tcp port = 68
|
2
cwbsw 2018-06-04 15:39:16 +08:00 1
|
3
halczy 2018-06-04 15:44:31 +08:00
AnyConnect 完全屏蔽 TCP 估计是不行的。
|
4
halczy 2018-06-04 15:46:36 +08:00
这行注释掉 #switch-to-tcp-timeout = 25
dpd 和 mobile-dpd 改小一点。另外就是用最新的 ocserv 版本。最近几个更新都对 DTLS 链接有优化。 |
5
zhouyut001 OP @halczy OK 我试试。对了,我使用 dnsmasq 作为 DNS 查询时老是连接 VPN 后 5 分钟内能查询 DNS,超过 5 分钟左右就无法查询 DNS 了,直接无法获取域名 IP,郁闷
|
7
zhouyut001 OP @mandymak 注释后服务无法启动
|
8
zhouyut001 OP @alect 我用的这个帖子搭建的,你看看。https://doub.io/vpnzy-6/
|
9
zhouyut001 OP @alect auth = "plain[passwd=/etc/ocserv/ocpasswd]"
listen-host = 0.0.0.0 tcp-port = 68 udp-port = 68 run-as-user = nobody run-as-group = daemon socket-file = /var/run/ocserv-socket server-cert = /etc/ocserv/ssl/server-cert.pem server-key = /etc/ocserv/ssl/server-key.pem ca-cert = /etc/ocserv/ssl/ca-cert.pem isolate-workers = true banner = "Welcome to John's Server!" max-clients = 16 max-same-clients = 2 server-stats-reset-time = 604800 keepalive = 32400 dpd = 90 mobile-dpd = 1800 switch-to-tcp-timeout = 25 # try-mtu-discovery = false tls-priorities = "NORMAL:%SERVER_PRECEDENCE:%COMPAT:-VERS-SSL3.0" auth-timeout = 240 min-reauth-time = 300 max-ban-score = 80 ban-reset-time = 1200 cookie-timeout = 300 deny-roaming = false rekey-time = 172800 rekey-method = ssl use-occtl = true pid-file = /var/run/ocserv.pid device = vpn predictable-ips = true default-domain = zhouyut001.vicp.cc ipv4-network = 192.168.1.0 ipv4-netmask = 255.255.255.0 # An alternative way of specifying the network: #ipv4-network = 192.168.1.0/24 # The IPv6 subnet that leases will be given from. #ipv6-network = fda9:4efe:7e3b:03ea::/48 # Specify the size of the network to provide to clients. It is # generally recommended to provide clients with a /64 network in # IPv6, but any subnet may be specified. To provide clients only # with a single IP use the prefix 128. #ipv6-subnet-prefix = 128 #ipv6-subnet-prefix = 64 tunnel-all-dns = true dns = 192.168.3.55 ping-leases = false # route = 10.10.10.0/255.255.255.0 # route = 192.168.0.0/255.255.0.0 # route = fef4:db8:1000:1001::/64 # route = default # no-route = 192.168.5.0/255.255.255.0 cisco-client-compat = true dtls-legacy = true |
10
zhouyut001 OP @cwbsw 还是习惯于用软件的方式连接,你的这个方法比我的还折腾
|
11
bao3 2018-06-04 16:25:22 +08:00 via iPhone
ocserv 这种方式连接不稳定吧,好像没办法用 kcp 之类的加速
|
12
halczy 2018-06-04 16:27:13 +08:00
@alect https://bitbucket.org/snippets/halczy/aopxK
看看是不是 dtls-psk / dtls-legacy 这两个的问题。 @zhouyut001 排查一下是不是 dnsmasq 的问题。另外设置 tunnel-all-dns = false |
13
cwbsw 2018-06-04 16:36:14 +08:00
@zhouyut001 呃,不是软件那还能是什么方式。他看起来写得多,其实 vpn 搭起来后不都一样。我贴那个链接主要是安利那个 vpn 协议。
|
14
StederLee 2018-06-04 19:49:12 +08:00 via Android
为什么不用 openvpn ?
|
15
zhouyut001 OP @halczy OK 好了
|
16
zhouyut001 OP @StederLee 用过 openvpn 感觉 UDP 通道不怎么稳定,容易断流
|
17
00oo00 2018-06-05 02:54:25 +08:00 via Android
anyconnect 应该是不能抛弃 tcp 单独用 udp 的
|
18
zhouyut001 OP @00oo00 了解了,3q
|
19
SampleNaive 2019-07-22 00:47:26 +08:00
如果你是为了能同时把 TCP UDP 流量转到 SS/SSR 的话, 可以试试 win2socks
|