diff --git a/README.md b/README.md index 40767af..298218c 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ sysctl -w net.ipv4.ip_forward=1 cat /proc/sys/net/ipv4/ip_forward ``` -2. 设置 nat 转发规则 +2.1 设置 nat 转发规则(二选一) ```shell systemctl stop firewalld.service @@ -165,6 +165,22 @@ iptables -t nat -A POSTROUTING -s 192.168.10.0/24 -o eth0 -j MASQUERADE iptables -nL -t nat ``` +2.2 使用全局路由转发(二选一) + +```shell +# 假设anylink所在服务器的内网ip: 10.1.0.10 + +# 传统网络架构,在交换机添加以下静态路由规则 +ip route-static 192.168.10.0 255.255.255.0 10.1.0.10 + +# 公有云环境下,需设置vpc下的路由表,添加以下路由策略 +目的端: 192.168.10.0/24 +下一跳类型: 云服务器 +下一跳: 10.1.0.10 + +``` + + 3. 使用 AnyConnect 客户端连接即可 ### macvtap 设置 @@ -184,6 +200,9 @@ ipv4_start = "192.168.10.100" ipv4_end = "192.168.10.200" ``` +
+tap设置 + ### ~~tap 设置~~ 1. 创建桥接网卡 @@ -208,6 +227,7 @@ eth_gateway="192.168.10.1" ``` sh bridge-init.sh ``` +
## Systemd