防火墙ipsec vpn 点对多点配置和路由器isis配置
需求:
isp通过isis进行联通,两台防火墙部署ipsec vpn 点对多点。
拓扑图:
技术分析:
isis:
isp1:
isis 1 #进入isis进程
network-entity 10.0000.0000.0000.0001.00 #配置net地址,格式按10.0000.0000.0000.0001.00这个来
import-route isis level-2 into level-1 配置路由渗透level-2的路由发到level-1
#
interface GigabitEthernet0/0/0
isis enable 1 #开启isis
isis circuit-level level-1 #将端口等级设置为level-1(IS-IS 的路由器默认级别是 Level-1-2, 两个路由器在同一个区域,
所以 会同时建立 Level-1 和 Level-2 的邻接关系,造成建立重新邻接,增加路由器的性能压力,浪费网路带宽,所以只需
建立 Level-1 的邻接关系;但是由于路由器连接了其他区域路由器,所以无法修改路由器级别为 Level-1,只能通过修改接口邻接
关系级别为 Level-1 来解决)
isis authentication-mode md5 cipher 123456 #配置端口认证
#下同
interface GigabitEthernet0/0/1
isis enable 1
isis circuit-level level-1
isis authentication-mode md5 cipher 123456
#
interface GigabitEthernet0/0/2
isis enable 1
isp3
#
isis 1
network-entity 10.0000.0000.0000.0003.00
import-route isis level-2 into level-1
#
interface GigabitEthernet0/0/0
isis enable 1
isis circuit-level level-1
isis authentication-mode md5 cipher 123456
#
interface GigabitEthernet0/0/1
isis enable 1
#
interface GigabitEthernet0/0/2
isis enable 1
isis circuit-level level-1
isis authentication-mode md5 cipher 123456
#
isp4
#
isis 1
network-entity 10.0000.0000.0000.0004.00
import-route isis level-2 into level-1
#
interface GigabitEthernet0/0/0
isis enable 1
isis circuit-level level-1
isis authentication-mode md5 cipher 123456
#
interface GigabitEthernet0/0/1
isis enable 1
isis circuit-level level-1
isis authentication-mode md5 cipher 123456
#
interface GigabitEthernet0/0/2
isis enable 1
#
ip-link
fw1
#
ip-link check enable #开启ip-link
ip-link name fw2-1 #进入fw2-1
destination 100.1.1.2 interface GigabitEthernet1/0/0 mode icmp #通过g1/0/0使用icmp协议侦测目的IP为100.1.1.2
ip-link name fw2-2 #下同
destination 100.1.2.2 interface GigabitEthernet1/0/0 mode icmp
#
fw2
#
ip-link check enable
ip-link name fw1-1
destination 100.1.3.2 interface GigabitEthernet1/0/0 mode icmp
ip-link name fw1-2
destination 100.1.3.2 interface GigabitEthernet1/0/1 mode icmp
#
IPSec vpn :
fw1
#
ipsec proposal 1 #ipsec安全提案 1
esp authentication-algorithm sha2-256 #ESP的认证算法
esp encryption-algorithm aes-256 ESP的加密算法
#
ike proposal 1 #ike 提议
encryption-algorithm aes-256 #加密算法
dh group14 #支持最大的秘钥宽度
authentication-algorithm sha2-256 #认证算法
authentication-method pre-share #使用共享密钥作为认证方式
integrity-algorithm hmac-sha2-256 #ike协商时所使用的完整性算法
prf hmac-sha2-256 #ike协商时所使用的伪随机数产生函数的算法
#
ike peer all #创建ike对等体
pre-shared-key 123456 #共享的密钥为123456
ike-proposal 1 #使用ike提议1
#
ipsec profile fw2-1 #创建一个ipsec的安全框架
ike-peer all #调用ike对等体
proposal 1 #调用安全提案
ipsec profile fw2-2 #下同
ike-peer all
proposal 1
#
interface Tunnel0 #创建虚拟接口0
ip address 192.168.50.1 255.255.255.0 #(可以使用内部地址)
tunnel-protocol gre #隧道类型为gre
source 100.1.3.2 #设置源地址
destination 100.1.1.2 #设置目的地址
ipsec profile fw2-1 #提用ipsec的安全框架
#
interface Tunnel1 #下同
description 100.1.2.2
ip address 192.168.60.1 255.255.255.0
tunnel-protocol gre
source 100.1.3.2
destination 100.1.2.2
ipsec profile fw2-2
#
firewall zone untrust
add interface Tunnel0 #把虚拟接口0加入untrsut区域
add interface Tunnel1 #下同
#
ip route-static 192.168.20.0 255.255.255.0 Tunnel0 preference 150 track ip-link fw2-1 #配置
静态路由把目的为192.168.20.0的下一跳定向到tunnel 0,并且联动ip-link fw2-1,设置优先级为150,使
转发20.0网段数据包优先转发到tunnel0
ip route-static 192.168.20.0 255.255.255.0 Tunnel1 preference 100 track ip-link fw2-2 #下同
#
security-policy #进入策略
rule name trust-untrsut #进入名称为trust-untrust的策略(这里包含了vpn通道中trust访问untrust的)
所以就没有配vpn中trust到untrust部分
source-zone trust #源区域 trust
destination-zone untrust #目的区域
service icmp #允许的服务
action permit #允许行为
rule name local-trust #下同
source-zone local
destination-zone trust
action permit
rule name trust-local
source-zone trust
destination-zone local
action permit
rule name untrust-local
source-zone untrust
destination-zone local
action permit
rule name local-untrust
source-zone local
destination-zone untrust
action permit
rule name vpn
source-zone untrust
destination-zone trust
source-address 192.168.20.0 mask 255.255.255.0 #这里对untrust区域访问trust区域的ip进行源地址限定
,只能是20.0网段的进行访问。
service icmp
action permit
fw2
#下同
ipsec proposal 1
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-256
#
ike proposal 1
encryption-algorithm aes-256
dh group14
authentication-algorithm sha2-256
authentication-method pre-share
integrity-algorithm hmac-sha2-256
prf hmac-sha2-256
#
ike peer all
pre-shared-key 123456
ike-proposal 1
ike peer fw1-2
#
ipsec profile fw1-1
ike-peer all
proposal 1
ipsec profile fw1-2
ike-peer all
proposal 1
#
interface Tunnel0
ip address 192.168.30.1 255.255.255.0
tunnel-protocol gre
source 100.1.1.2
destination 100.1.3.2
ipsec profile fw1-1
#
interface Tunnel1
ip address 192.168.40.1 255.255.255.0
tunnel-protocol gre
source 100.1.2.2
destination 100.1.3.2
ipsec profile fw1-2
#
firewall zone untrust
add interface Tunnel0
add interface Tunnel1
#
ip route-static 192.168.10.0 255.255.255.0 Tunnel0 preference 150 track ip-link fw1-1
ip route-static 192.168.10.0 255.255.255.0 Tunnel1 preference 100 track ip-link fw1-2
#
security-policy
rule name trust-untrsut
source-zone trust
destination-zone untrust
service icmp
action permit
rule name local-trust
source-zone local
destination-zone trust
action permit
rule name trust-local
source-zone trust
destination-zone local
action permit
rule name local-unttrsut
source-zone local
destination-zone untrust
action permit
rule name untrust-local
source-zone untrust
destination-zone local
action permit
rule name vpn
source-zone untrust
source-address 192.168.10.0 mask 255.255.255.0
service icmp
action permit
效果:
isis:
isp1查看路由表:
isp1 查看isis路由表:
ipsec vpn:
fw1查看nat转换情况:
pc机ping的过程:
模拟fw2 g1/0/1端口down后的情况:
说明:第一次请求超时是因为从fw2-1转换为fw2-2,第二次超时是fw2-2转换为fw2-1