Ipsec 防火墙上动态野蛮模式的配置
主要用于,总公司是静态的地址,而分公司是动态分配的地址,无法确定分地区的地址是多少时用到了野蛮模式。
一、Fw-1的配置
[fw-1]inter eth0/0
[fw-1-Ethernet0/0]ip add 192.168.101.55 255.255.255.0
[fw-1-Ethernet0/0]inter eth0/4
[fw-1-Ethernet0/4]ip add 1.1.1.1 255.255.255.0
[fw-1]ip route 0.0.0.0 0 1.1.1.2
配置访问控制列表,起过滤作用
[fw-1]acl number 3000
[fw-1-acl-adv-3000]rule 10 permit ip source 192.168.101.0 0.0.0.255 dest 192.168.102.0 0.0.0.255
[fw-1-acl-adv-3000]rule 20 deny ip source any dest any
配置安全提议(系统默认,可选)
[fw-1]ipsec proposal tran1
[fw-1-ipsec-proposal-tran1]encapsulation-mode tunnel
[fw-1-ipsec-proposal-tran1]transform esp
[fw-1-ipsec-proposal-tran1]esp encryption-algorithm des
[fw-1-ipsec-proposal-tran1]esp authentication-algorithm md5
配置邻居参数
[fw-1]ike peer fw-2
[fw-1-ike-peer-fw-2]exchange-mode aggressive //启用野蛮模式
[fw-1-ike-peer-fw-2]id-type name (指定id的验证类型是基于名字的)
[fw-1-ike-peer-fw-2]pre-shared-key simple 123456
[fw-1-ike-peer-fw-2]remote-name fw-2 (对端的名字)
[fw-1-ike-peer-fw-2]local-address 1.1.1.1(指定总公司本地的地址)
[fw-1-ike-peer-fw-2]q
[fw-1]ike local-name fw-1 //创建本地名字
配置安全策略
[fw-1]ipsec policy policy1 10 isakmp
[fw-1-ipsec-policy-isakmp-policy1-10]security acl 3000
[fw-1-ipsec-policy-isakmp-policy1-10]proposal tran1
[fw-1-ipsec-policy-isakmp-policy1-10]ike-peer fw-2
应用安全策略
[fw-1]inter eth0/4
[fw-1-Ethernet0/4]ipsec policy policy1
二、路由器配置
[Router]inter e0
[Router-Ethernet0]ip add 1.1.1.2 255.255.255.0
[Router-Ethernet0]inter e1
[Router-Ethernet1]ip add 1.1.2.1 255.255.255.0
配置DHCP服务器,用于动态的分配给分公司地址
[Router]dhcp enable
[Router]dhcp server ip-pool xxx
[Router-dhcp-xxx]network 1.1.2.0
[Router-dhcp-xxx]gateway-list 1.1.2.1
[Router-dhcp-xxx]dns-list 222.88.88.88
三、Fw-2的配置
[fw-2]int eth0/0
[fw-2-Ethernet0/0]ip add 192.168.102.90 24
[fw-2-Ethernet0/0]int eth0/4
[fw-2-Ethernet0/4]ip add dhcp-alloc //自动获得地址
把端口加入区域(如系统默认已加入,可选)
[fw-2]firewall zone untrust
[fw-2-zone-untrust]add int eth0/4
[fw-2]ip route 0.0.0.0 0 1.1.2.1
设置访问控制列表,起过滤作用
[fw-2]acl number 3000
[fw-2-acl-adv-3000]rule 10 permit ip source 192.168.102.0 0.0.0.255 destination 192.168.101.0 0.0.0.255
[fw-2-acl-adv-3000]rule 20 deny ip source any destination any
创建安全协议(如系统默认,可选)
[fw-2]ipsec proposal tran1
[fw-2-ipsec-proposal-tran1]encapsulation-mode tunnel
[fw-2-ipsec-proposal-tran1]transform esp
[fw-2-ipsec-proposal-tran1]esp authentication-algorithm md5
[fw-2-ipsec-proposal-tran1]esp encryption-algorithm des
配置邻居参数
[fw-2]ike peer fw-1
[fw-2-ike-peer-fw-1]exchange-mode aggressive //启用野蛮模式
[fw-2-ike-peer-fw-1]id-type name
[fw-2-ike-peer-fw-1]pre-shared-key 123456
[fw-2-ike-peer-fw-1]remote-address 1.1.1.1(因为这里是动态的地址,本端的地址无法指定只能设置对端的地址)
[fw-2-ike-peer-fw-1]remote-name fw-1
[fw-2-ike-peer-fw-1]q
[fw-2]ike local-name fw-2 //创建本地名字
创建安全策略
[fw-2]ipsec policy policy1 10 isakmp //安全策略实为一表格,每条策略需表序号
[fw-2-ipsec-policy-isakmp-policy1-10]security acl 3000
[fw-2-ipsec-policy-isakmp-policy1-10]proposal tran1
[fw-2-ipsec-policy-isakmp-policy1-10]ike-peer fw-1
把策略应用到端口
[fw-2]int eth0/4
[fw-2-Ethernet0/4]ipsec policy policy1