diff --git a/README.md b/README.md index 7e7230c..8c663a1 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ git clone https://github.com/bjdgyc/anylink.git cd anylink -sh build.sh +bash build.sh # 注意使用root权限运行 cd anylink-deploy @@ -187,6 +187,8 @@ IP 层的数据互相转换,性能会有所下降。 如果需要在虚拟机 1. 开启服务器转发 ```shell +# 新版本支持自动设置ip转发 + # file: /etc/sysctl.conf net.ipv4.ip_forward = 1 @@ -235,7 +237,7 @@ https://cloud.tencent.com/document/product/216/62007 3. 使用 AnyConnect 客户端连接即可 -### macvtap 设置 +### 桥接设置 1. 设置配置文件 @@ -247,6 +249,37 @@ https://cloud.tencent.com/document/product/216/62007 > > 以下参数可以通过执行 `ip a` 查看 + +1.1 arp_proxy + +``` + +# file: /etc/sysctl.conf +net.ipv4.conf.all.proxy_arp = 1 + +#执行如下命令 +sysctl -w net.ipv4.conf.all.proxy_arp=1 + + +配置文件修改: + +# 首先关闭nat转发功能 +iptables_nat = false + + +link_mode = "tun" +#内网主网卡名称 +ipv4_master = "eth0" +#以下网段需要跟ipv4_master网卡设置成一样 +ipv4_cidr = "10.1.2.0/24" +ipv4_gateway = "10.1.2.99" +ipv4_start = "10.1.2.100" +ipv4_end = "10.1.2.200" + +``` + +1.2 macvtap + ``` # 命令行执行 master网卡需要打开混杂模式 diff --git a/build_docker.sh b/build_docker.sh index 7deeb19..dc43fa5 100644 --- a/build_docker.sh +++ b/build_docker.sh @@ -11,9 +11,9 @@ echo $ver #docker run -it --rm -v $PWD/web:/app -w /app node:16-alpine \ # sh -c "yarn install --registry=https://registry.npmmirror.com && yarn run build" -# docker buildx build --platform linux/amd64,linux/arm64 本地不生成镜像 -docker buildx build -t bjdgyc/anylink:latest --progress=plain --build-arg CN="yes" --build-arg appVer=$ver \ - --build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile . +# docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 本地不生成镜像 +docker buildx build -t bjdgyc/anylink:latest --no-cache --progress=plain --platform linux/amd64 \ + --build-arg CN="yes" --build-arg appVer=$ver --build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile . echo "docker tag latest $ver" docker tag bjdgyc/anylink:latest bjdgyc/anylink:$ver diff --git a/docker/init_build.sh b/docker/init_build.sh index 2dc30f5..bef0a88 100644 --- a/docker/init_build.sh +++ b/docker/init_build.sh @@ -4,7 +4,8 @@ set -x #TODO 本地打包时使用镜像 if [[ $CN == "yes" ]]; then - sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories + #sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories + sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories export GOPROXY=https://goproxy.cn fi diff --git a/docker/init_release.sh b/docker/init_release.sh index cfad74e..cbb42c1 100644 --- a/docker/init_release.sh +++ b/docker/init_release.sh @@ -4,7 +4,8 @@ set -x #TODO 本地打包时使用镜像 if [[ $CN == "yes" ]]; then - sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories + #sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories + sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories export GOPROXY=https://goproxy.cn fi