remove vim-common
apt-get remove vim-common
install vim full
apt-get install vim
docker pull fcojean/l2tp-ipsec-vpn-server
创建env
vi vpn.env
VPN_IPSEC_PSK=nonnix.com
VPN_USER_CREDENTIAL_LIST=[{"login":"uesr","password":"ssfq"},{"login":"tsi","password":"ssfq"},{"login":"vpn","password":"ssfq"}]
加载 IPsec NETKEY 内核模块
modprobe af_key
加载env配置文件,将对应端口与服务器端口绑定
docker run \
--name l2tp-ipsec-vpn-server \
--env-file ./vpn.env \
-p 500:500/udp \
-p 4500:4500/udp \
-v /lib/modules:/lib/modules:ro \
-d --privileged \
fcojean/l2tp-ipsec-vpn-server
查看VPN状态
docker logs vpn-server
查看和关闭防火墙,需开放500端口和4500端口
systemctl status firewalld
systemctl stop firewalld
Docker Hub 的服务器在国外,比较慢,可以用 DaoCloud.io免费的国内镜像服务,官方参考https://docs.docker.com/engine/installation/
环境:Docker Engine + runc + Ubuntu1804lts
检查服务器版本
uname -a
cat /proc/version
lsb_release -a
移除旧版本
apt-get remove docker docker-engine docker-ce docker.io
安装新版本,使apt可以通过HTTPS使用存储库(repository)
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
Install packages to allow apt to use a repository over HTTPS
apt-get install \
> apt-transport-https \
> ca-certificates \
> curl \
> software-properties-common
添加Docker官方的GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
如果Ubuntu 18.04 LTS (Bionic Beaver) docker package is not available,则通过如下语句安装stable存储库
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"
安装docker-ce
apt-get install -y docker-ce
也可查看可用版本并安装
apt-cache madison docker-ce
apt-get install docker-ce=<VERSION>
查看服务和启动
systemctl status docker
systemctl start docker
systemctl restart docker.service
测试Hello World
docker run hello-world
查看本地Docker镜像库
docker images
安装Apache并测试http://IP
docker run -d -p 80:80 httpd
<div>apt-get updateapt-get install squidvi /etc/squid3/squid.conf将http_access deny deny 改为 http_access allow all将http_port 3128修改为自己的端口http_port 6666</div>
service squid3 restart
这时是透明代理,会有via字段和X-Forwarded-For字段显示IP,需要匿名的话就需要修改配置
查看版本
squid3 -v
vi /etc/squid3/squid.conf
不同版本号以及对应代码
Squid 2.x
header_access Via deny all
header_access X-Forwarded-For deny all
Squid 3.0
reply_header_access Via deny all
reply_header_access X-Forwarded-For deny all
Squid 3.1以及以上版本
via off
forwarded_for delete
service squid3 restart