strongwan 如何配置为传输模式?
时间: 2024-06-12 17:05:05 浏览: 7
要配置 StrongSwan 为传输模式,需要进行以下步骤:
1. 编辑 StrongSwan 配置文件:/etc/ipsec.conf
```
conn my_tunnel
type=transport
left=192.168.1.1
leftprotoport=17/1701
right=192.168.2.1
rightprotoport=17/1701
auto=start
```
其中,type=transport 表示采用传输模式,left 和 right 分别表示本地和远程 IP 地址,leftprotoport 和 rightprotoport 分别表示本地和远程端口号。
2. 配置 StrongSwan 密钥文件:/etc/ipsec.secrets
```
192.168.1.1 192.168.2.1 : PSK "my_secret_key"
```
其中,192.168.1.1 和 192.168.2.1 分别表示本地和远程 IP 地址,PSK 表示预共享密钥,"my_secret_key" 为自定义的密钥。
3. 启动 StrongSwan 服务:
```
systemctl start strongswan
```
启动成功后,即可使用 StrongSwan 进行传输模式的 VPN 连接。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![md](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)