如何搭建centos6下的centos 7 anyconnectt

求助,在 CentOS 6 的坏境下搭建 Anyconnect - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
已注册用户请 &
求助,在 CentOS 6 的坏境下搭建 Anyconnect
· 36 天前 · 616 次点击
就在最后一步的时候
输入 ocserv -c /etc/ocserv/ocserv.conf
========================
报错如下:
listening (TCP) on 0.0.0.0:9000...
bind() failed: Address already in use
listening (TCP) on [::]:9000...
bind() failed: Address already in use
Could not listen to any TCP or UNIX ports
========================
教程参考的是:
折腾一天了,卡这里。。该怎么解决呢!!
实在没法子了,来 V 站求助。
第 1 条附言 &·& 36 天前
头疼呀!!
顺便说一下 VPS 上已经搭好了 SS 。
21 回复 &| &直到
16:19:12 +08:00
& &36 天前
bind() failed: Address already in use
不是说了吗,这个提示很明显啊。。。
看看什么进程占用了 9000 端口
netstat -tunlp | grep 9000
& &36 天前
@ 换了个端口
输入你给的命令 + 该端口
=================
tcp
0 0.0.0.0:8989
32349/ocserv
tcp
32349/ocserv
udp
0 0.0.0.0:8989
32349/ocserv
udp
32349/ocserv
=================
还是报同样的错, 并没有别的进程占用啊。
& &36 天前
docker 一个命令搞定
& &36 天前
@ 怎么说? 有具体教程么?
& &36 天前
& &36 天前
& &36 天前
请叫我超龄红领巾
装好 docker 后,执行命令
docker run --name ocserv --privileged -p 443:443 -p 443:443/udp -d tommylau/ocserv
命令分析:
--name 运行一个叫 ocserv 的容器,容器的镜像来源于 tommylau/ocserv , docker 会自行到
下载
-p a:b 将 a (宿主机端口)映射到 b (容器端口), a (宿主机)端口可随意更改,例如 4433 , b 不建议更改
-p a:b/udp 映射 udp 端口
默认用户和密码都是 test
修改或新建用户密码和其它详情,请查看
删除容器和镜像
docker stop ocserv && docker rm ocserv && docker rmi tommylau/ocserv
ocserv 这个名字是--name ocserv 定义的
& &36 天前
@ 忘了 @ 你两了
& &36 天前
另外 docker 也有 tommylau 制作的 ss 镜像
& &36 天前
fuser -k 9000/tcp
& &36 天前
@ 先问清是不是 OVZ 再推荐 docker 吧
& &36 天前 via iPhone
OVZ 我写了 Debian 下的 ocserv,strongswan,Ss,softether 几合一的脚本。
& &36 天前
@ 这表示 ocserv 进程已经在运行了。你杀掉(或者 stop)ocserv 进程再运行&ocserv -c /etc/ocserv/ocserv.conf &
& &36 天前
@ 能分享个 strongswan 的 ikev2 配置文件么。。一直不能让 strongswan 正常工作是我心中很久的痛,以及 ikev1 已经被关照了吧? ikev2 现在稳定性怎么样?
& &36 天前 via iPhone
@ 移动联通都不错,联通 4G 早上有段时间连不上。那个配置文件,很多博客里都有。等会贴给你。
& &36 天前 via iPhone
@ 这个就是我的配置文件, win10mobile 还是推荐用 AnyConnect
& &36 天前
@ 恩是的, kill 掉重新启动不会提示错误,但是 anyconnect 客户端却依然不能连接上,提示 connection attempt has failed ,使用的是证书登录的方式。
& &36 天前
@ 谢谢,实在不行的话,我就试试。
& &36 天前
抱歉链接丢了:
& &36 天前
ocserv 要把 udp-port = 9001 注释掉,因为 udp 已经不安全了。
& &35 天前
@ 客户端连接的时候,在 VPS /var/logs/messages
里查看记录
& · & 1208 人在线 & 最高记录 1630 & · &
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.5 · 50ms · UTC 09:04 · PVG 17:04 · LAX 01:04 · JFK 04:04? Do have faith in what you're doing.【原创】全能型科学上网服务器搭建(CentOS7+firewalld) - 推酷
【原创】全能型科学上网服务器搭建(CentOS7+firewalld)
长城的昨天和今天
日中德专家共同起草了一封电子邮件,写道:”Across the Great Wall we can reach every corner in the world”(越过长城,我们可以到达世界的每一个角落)”This is the First Electronic Mail from China to Germany”(这是第一封中国到德国的电子邮件),标题和内容均由英、德双语写成,也就是后来知名的“越过长城,走向世界”的邮件。在该邮件上署名的除了王运丰、措恩教授,还有11个中德双方的参与工作的人员,包括项目中起着重要作用的李澄炯所长。
今天的长城,请参考
全能型科学上网服务器介绍
开放服务如下:
Open Connect Service
Shaodow Socks Server
Socks5 Proxy
HTTP Proxy
SSH Tunnel
本服务器支持各类终端,无论你是Windows还是Linux,也不管你是Android还是iOS,都能让你轻松穿越唐国墙。
ps:网络上各类垃圾文章:选择CentOS7服务器,却又抛弃firewalld不使用,倒回iptables……无语。
全能型科学上网服务器安装配置步骤
购买海外服务器
CentOS 7.0 64bit 一台,推荐购买Linode VPS美国服务器,
服务器基本准备
更新系统安装源,添加必备工具
Downloaddownload.txt
[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# yum update -y
[root@localhost ~]# yum upgrade -y
[root@localhost ~]# yum install git git-core -y
配置网络DNS
很多VPS自带的DNS服务器解析功能较弱,推荐使用使用谷歌的DNS
Downloaddownload.txt
[root@localhost ~]# vi /etc/resolv.conf
# 在文件中增加以下两行,记得删除【#号】
#nameserver 8.8.8.8
#nameserver 8.8.4.4
配置firewalld
配置防火墙开放必要的端口:
TCP/22:SSH
TCP/80:HTTP网站
TCP/443:HTTPS网站
TCP/1723:PPTP VPN服务
TCP/3128:HTTP代理服务
TCP/3288:ShadowSocks服务
TCP/3289:Socks5代理服务
TCP/10443:Open Connect Server
安装过程中如有自定义端接口,请在同步更新防火墙配置文件后重新加载防火墙策略。
Downloaddownload.txt
[root@localhost install]# service firewalld start
#Redirecting to /bin/systemctl start
firewalld.service
[root@localhost ~]# cp /usr/lib/firewalld/services/ssh.xml /etc/firewalld/services/fuckgfw.xml
[root@localhost ~]# vi /etc/firewalld/services/fuckgfw.xml
xml文件内容如下:
Downloaddownload.txt
&short&fuckgfw&/short&
&description&fuck the gfw&/description&
&port protocol=&tcp& port=&22&/&
&port protocol=&tcp& port=&80&/&
&port protocol=&tcp& port=&443&/&
&port protocol=&tcp& port=&1723&/&
&port protocol=&tcp& port=&3128&/&
&port protocol=&tcp& port=&3288&/&
&port protocol=&tcp& port=&3289&/&
&port protocol=&tcp& port=&10443&/&
修改并保存文件后,执行以下命令,并重新加载防火墙策略
Downloaddownload.txt
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-service=fuckgfw
[root@localhost ~]# firewall-cmd --permanent --add-masquerade
[root@localhost ~]# firewall-cmd --reload
OpenConnect
OpenConnect支持Cisco’s AnyConnect SSL VPN客户端连接,包括iOS上的客户端软件。感谢github网友提供一键安装包!
Downloaddownload.txt
[root@localhost ~]# pwd
[root@localhost ~]# mkdir install && cd install
[root@localhost install]# wget /travislee8964/Ocserv-install-script-for-CentOS-RHEL-7/master/ocserv-install-script-for-centos7.sh
[root@localhost install]# vi ocserv-install-script-for-centos7.sh
[root@localhost install]# chmod +x ocserv-install-script-for-centos7.sh
[root@localhost install]# ./ocserv-install-script-for-centos7.sh
#/usr/lib/firewalld/services/ocserv.xml
#/usr/local/etc/ocserv/ocserv.conf
ShadowSocks + socks5 proxy
shadowsocks 是一个基于 python 的轻量级 socks 代理软件。
本服务器配置为ShadowSocks Server + ShadowSocks Client。客户端既可以使用ShadowSocks Client连接,也支持QQ、Firefox等软件使用Socks连接。
Downloaddownload.txt
[root@localhost install]# yum install python-setuptools && easy_install pip
#Installed /usr/lib/python2.7/site-packages/pip-6.0.8-py2.7.egg
#Processing dependencies for pip
#Finished processing dependencies for pip
[root@localhost install]# pip install shadowsocks
Successfully installed shadowsocks-2.6.8
[root@localhost ~]# cd ~ && mkdir -p app/shadowsocks && cd app/shadowsocks
[root@localhost ~]# vi shadowsocks_s.json
[root@localhost ~]# vi shadowsocks_c.json
shadowsocks_s.json文件:
Downloaddownload.txt
&server&:&101.102.103.104&,
&server_port&:3288,
&local_address&: &101.102.103.104&,
&local_port&:3289,
&password&:&fuckthegfw&,
&timeout&:600,
&method&:&aes-256-cfb&,
&fast_open&: false,
&pid-file&:&/var/run/shadowsocks_s.pid&
shadowsocks_c.json文件:
Downloaddownload.txt
&server&:&101.102.103.104&,
&server_port&:3288,
&local_address&: &101.102.103.104&,
&local_port&:3289,
&password&:&fuckthegfw&,
&timeout&:600,
&method&:&aes-256-cfb&,
&fast_open&: false,
&pid-file&:&/var/run/shadowsocks_c.pid&
Downloaddownload.txt
[root@localhost shadowsocks]# ssserver -c shadowsocks_s.json
--fast-open -d start
[root@localhost shadowsocks]# sslocal -c shadowsocks_c.json
--fast-open -d start
Squid cache(简称为Squid)是一个流行的自由软件(GNU通用公共许可证)的代理服务器和Web缓存服务器。
Downloaddownload.txt
[root@localhost ~]# yum install squid -y
[root@localhost squid]# vi /etc/squid/squid.conf
#http_access deny all
#修改上面一行为下面一行,启用http访问
#http_access allow all
#关闭forwarded_for实现匿名代理
#forwarded_for off
[root@localhost ~]# systemctl enable squid
[root@localhost squid]# systemctl restart squid
PPTP(Point to Point Tunneling Protocol)点对点隧道协议是一种支持多协议虚拟专用网络的网络技术。Windows、Linux、ANdroid、iOS等客户端都支持直接配置pptp vpn
Downloaddownload.txt
[root@localhost ~]# yum install pptpd -y
[root@localhost ~]# echo &ms-dns 8.8.8.8& && /etc/ppp/options.pptpd
[root@localhost ~]# echo &ms-dns 8.8.4.4& && /etc/ppp/options.pptpd
[root@localhost ~]# echo &logfile /var/log/pptpd.log& && /etc/ppp/options.pptpd
[root@localhost ~]# echo &localip 9.9.0.1& && /etc/pptpd.conf
[root@localhost ~]# echo &remoteip 9.9.0.10-200& && /etc/pptpd.conf
[root@localhost ~]# systemctl enable pptpd
[root@localhost ~]# systemctl start pptpd
[root@localhost ~]# netstat -an|grep tcp|grep 1723
[root@localhost ~]# echo &net.ipv4.ip_forward = 1& && /etc/sysctl.conf
[root@localhost ~]# sysctl -p
[root@localhost ~]# firewall-cmd --permanent --add-port=1723/tcp
[root@localhost ~]# firewall-cmd --permanent --add-masquerade
[root@localhost ~]# firewall-cmd --reload
[root@localhost ~]# vi /etc/ppp/chap-secrets
#VPN账号和密码配置,逐行增加
#username1 pptpd password1 *
#username2 * password2 *
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
排版有问题
没有分页内容
视频无法显示
图片无法显示在 CentOS 6.5 上配置 Cisco AnyConnect VPN - 为程序员服务
在 CentOS 6.5 上配置 Cisco AnyConnect VPN
在配置的时候参考了很多网友的文章,只是发现编译的时候都会有各种问题(可能是系统环境和时间原因?),所以还是另开一篇记录下吧。
为什么选择 Cisco AnyConnect VPN ?
它是 iOS 端目前最好的 xx 解决方案:
激活后全局有效
自动重连,即使锁屏后重开也不会掉线
可导入路由配置
开始动手吧~
首先安装所有依赖包:
yum install autoconf automake gcc libtasn1-devel zlib zlib-devel trousers trousers-devel gmp-devel gmp xz texinfo libnl-devel libnl tcp_wrappers-libs tcp_wrappers-devel tcp_wrappers dbus dbus-devel ncurses-devel pam-devel readline-devel bison bison-devel flex gcc automake autoconf wget
安装 Nettle:
cd /usr/local/src
wget http://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz
tar zxf nettle-2.7.1.tar.gz && cd nettle-2.7.1
./configure && make && make install
安装 unbound:
yum install expat-devel
wget http://unbound.nlnetlabs.nl/downloads/unbound-1.4.22.tar.gz
tar zxf unbound-1.4.22.tar.gz && cd unbound-1.4.22
./configure --prefix=/usr --sysconfdir=/etc && make && make install
安装后执行程序将会出现动态库文件找不到的问题:unbound-anchor: error while loading shared libraries: libunbound.so.2: cannot open shared object file: No such file or directory
这是因为系统默认没有找/usr/local/lib目录下的库文件,为了一劳永逸,我们把将路径加入到配置文件中:
echo '/usr/local/lib' & /etc/ld.so.conf.d/local-libraries.conf && ldconfig
生成配置文件:unbound-anchor -a "/etc/unbound/root.key",这是为了消除之后编译gnutls时遇到的警告信息:
configure: WARNING:
*** The DNSSEC root key file in /etc/unbound/root.key was not found.
*** This file is needed for the verification of DNSSEC responses.
*** Use the command: unbound-anchor -a &/etc/unbound/root.key&
*** to generate or update it.
安装 gnutls:
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.15.tar.xz
tar xvf gnutls-3.2.15.tar.xz
cd gnutls-3.2.15
./configure
这时会遇到Libnettle 2.7 was not found.错误,其实还是路径问题,pkg-config寻找包的依赖关系时没有找到对应的.pc文件,告诉它地址就好了:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH。继续编译~
./configure && make && make install
安装 LibNL:
wget http://www./~tgr/libnl/files/libnl-3.2.24.tar.gz
tar xvf libnl-3.2.24.tar.gz
cd libnl-3.2.24
./configure && make && make install
终于该主角上场了,安装 Ocserv:
wget ftp://ftp.infradead.org/pub/ocserv/ocserv-0.8.1.tar.xz
tar xvf ocserv-0.8.1.tar.xz && cd ocserv-0.8.1
./configure --prefix=/usr --sysconfdir=/etc && make && make install
一切都非常顺利,yeah!
接下来开始配置,呃……一些……Something。
之后的配置按照这篇文章进行配置,感谢Kevin。
可能是宽带运营商的问题,反正我这里的速度非常不理想。。比shadowsocks差老远了。。竟然只有几k的速度,完全不能理解……尝试调过最大连接数也无效,暂时还是弃用了 QAQ
希望你的好用,good luck~
原创文章,采用
进行许可。转载请注明:转载自 ,原文网址:
appeared first on .
stay hungry, stay foolish.
原文地址:, 感谢原作者分享。
您可能感兴趣的代码在 CentOS 6.5 上配置 Cisco AnyConnect VPN
在配置的时候参考了很多网友的文章,只是发现编译的时候都会有各种问题(可能是系统环境和时间原因?),所以还是另开一篇记录下吧。 为什么选择 Cisco AnyConnect VPN ? 它是 iOS 端目前最好的 xx 解决方案: 激活后全局有效 自动重连,即使锁屏后重开也不
在配置的时候参考了很多网友的文章,只是发现编译的时候都会有各种问题(可能是系统环境和时间原因?),所以还是另开一篇记录下吧。
为什么选择 Cisco AnyConnect VPN ?
它是 iOS 端目前最好的 xx 解决方案:
激活后全局有效
自动重连,即使锁屏后重开也不会掉线
可导入路由配置
开始动手吧~
首先安装所有依赖包:
yum install autoconf automake gcc libtasn1-devel zlib zlib-devel trousers trousers-devel gmp-devel gmp xz texinfo libnl-devel libnl tcp_wrappers-libs tcp_wrappers-devel tcp_wrappers dbus dbus-devel ncurses-devel pam-devel readline-devel bison bison-devel flex gcc automake autoconf wget
安装 Nettle:
cd /usr/local/src
wget http://ftp.gnu.org/gnu/nettle/nettle-2.7.1.tar.gz
tar zxf nettle-2.7.1.tar.gz && cd nettle-2.7.1
./configure && make && make install
安装 unbound:
yum install expat-devel
wget http://unbound.nlnetlabs.nl/downloads/unbound-1.4.22.tar.gz
tar zxf unbound-1.4.22.tar.gz && cd unbound-1.4.22
./configure --prefix=/usr --sysconfdir=/etc && make && make install
安装后执行程序将会出现动态库文件找不到的问题:unbound-anchor: error while loading shared libraries: libunbound.so.2: cannot open shared object file: No such file or directory
这是因为系统默认没有找/usr/local/lib目录下的库文件,为了一劳永逸,我们把将路径加入到配置文件中:
echo '/usr/local/lib' & /etc/ld.so.conf.d/local-libraries.conf && ldconfig
生成配置文件:unbound-anchor -a "/etc/unbound/root.key",这是为了消除之后编译gnutls时遇到的警告信息:
configure: WARNING:
*** The DNSSEC root key file in /etc/unbound/root.key was not found.
*** This file is needed for the verification of DNSSEC responses.
*** Use the command: unbound-anchor -a "/etc/unbound/root.key"
*** to generate or update it.
安装 gnutls:
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/gnutls-3.2.15.tar.xz
tar xvf gnutls-3.2.15.tar.xz
cd gnutls-3.2.15
./configure
这时会遇到Libnettle 2.7 was not found.错误,其实还是路径问题,pkg-config寻找包的依赖关系时没有找到对应的.pc文件,告诉它地址就好了:export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH。继续编译~
./configure && make && make install
安装 LibNL:
wget http://www./~tgr/libnl/files/libnl-3.2.24.tar.gz
tar xvf libnl-3.2.24.tar.gz
cd libnl-3.2.24
./configure && make && make install
终于该主角上场了,安装 Ocserv:
wget ftp://ftp.infradead.org/pub/ocserv/ocserv-0.8.1.tar.xz
tar xvf ocserv-0.8.1.tar.xz && cd ocserv-0.8.1
./configure --prefix=/usr --sysconfdir=/etc && make && make install
一切都非常顺利,yeah!
接下来开始配置,呃……一些……Something。
之后的配置按照AnyConnect 带来 iPhone 上的新生活这篇文章进行配置,感谢Kevin。
可能是宽带运营商的问题,反正我这里的速度非常不理想。。比shadowsocks差老远了。。竟然只有几k的速度,完全不能理解……尝试调过最大连接数也无效,暂时还是弃用了 QAQ
希望你的好用,good luck~
在CentOS 6.5上配置Cisco AnyConnect VPN
Install Ocserv on CentOS 6.5
AnyConnect 带来 iPhone 上的新生活
ocserv: 兼容Cisco Anyconnect的开源服务端
原创文章,采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明:转载自 Tony's blog,原文网址:http://itony.me/765.html
The post 在 CentOS 6.5 上配置 Cisco AnyConnect VPN appeared first on Tony's blog.
你最喜欢的

我要回帖

更多关于 centos anyconnect 的文章

 

随机推荐