在 Oracle® Solaris 11.2 中确保网络安全

退出打印视图

更新时间: 2014 年 9 月
 
 

在隧道模式下使用 IPsec 保护 VPN 的示例

LAN 的所有子网都配置了下图中的隧道,如下所示:

## Tunnel configuration for ##
# Tunnel name is tun0
# Intranet point for the source is 10.1.2.1
# Intranet point for the destination is 10.2.3.1
# Tunnel source is 192.168.1.10
# Tunnel destination is 192.168.2.10
# Tunnel name address object is tun0/to-central
# Tunnel name address object is tun0/to-overseas

图 7-1  受 IPsec 保护的隧道

image:图中显示了一个连接着两个 LAN 的 VPN。每个 LAN 具有四个子网。

以下示例都基于此图。

示例 7-3  创建一个所有子网都可以使用的隧道

在此示例中,来自Figure 7–1 中的中心 LAN 的本地 LAN 的所有通信都可以通过隧道从路由器 1 传送到路由器 2,然后再传送到国外 LAN 的所有本地 LAN。通信使用 AES 进行加密。

## IPsec policy ##
{tunnel tun0 negotiate tunnel} 
 ipsec {encr_algs aes encr_auth_algs sha512 sa shared}
示例 7-4  创建一个仅连接两个子网的隧道

在此示例中,仅为中心 LAN 的子网 10.1.2.0/24 和国外 LAN 的子网 10.2.3.0/24 之间的通信建立了隧道并对通信进行了加密。在中心 LAN 没有其他 IPsec 策略的情况下,如果中心 LAN 尝试通过此隧道路由其他 LAN 的任何通信,则通信会在路由器 1 处被丢弃。

## IPsec policy ##
{tunnel tun0 negotiate tunnel laddr 10.1.2.0/24 raddr 10.2.3.0/24} 
 ipsec {encr_algs aes encr_auth_algs sha512 shared}