Skip to content

Commit

Permalink
添加 Windows 允许 IP 转发的相关文档
Browse files Browse the repository at this point in the history
  • Loading branch information
lanthora committed Aug 4, 2024
1 parent 6ecadbb commit 047139e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/sdwan.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ sdwan = "10.0.0.1/32,192.168.2.0/24,10.0.0.2"

### 允许网关转发流量

#### Linux

如果你的网关是路由器,应该能够轻易的配置出允许转发.否则需要手动添加转发相关的配置.

开启内核流量转发功能
Expand All @@ -72,6 +74,20 @@ iptables -A FORWARD -i ethX -o candy-gw -j ACCEPT
iptables -A FORWARD -i candy-gw -o ethX -m state --state RELATED,ESTABLISHED -j ACCEPT
```

#### Windows

查看的网卡名,应该与配置文件中写的名称相同,对于 GUI 版本客户端的默认配置网卡名应该为 `candy`

```ps
Get-NetAdapter
```

允许转发,注意要把网卡名替换成上一步查出来的网卡名

```ps
Set-NetIPInterface -ifAlias 'candy' -Forwarding Enabled
```

### 测试

`192.168.1.x` 用 ping 命令发包, `192.168.2.x` 上抓包预期可以看到对应数据包.
Expand Down

0 comments on commit 047139e

Please sign in to comment.