野蛮模式的相关种种:

 

作用:

对于两端IP地址不是固定的情况(如ADSL拨号上网),并且双方都希望采用预共享密钥验证方法来创建IKE SA,就需要采用野蛮模式。另外如果发起者已知回应者的策略,采用野蛮模式也能够更快地创建IKE SA

ipsec下两种模式的区别:

1、野蛮模式协商比主模式协商更快。主模式需要交互6个消息,野蛮模式只需要交互3个消息。

2、主模式协商比野蛮模式协商更严谨、更安全。因为主模式在56个消息中对ID信息进行了加密。而野蛮模式由于受到交换次数的限制,ID信息在12个消息中以明文的方式发送给对端。即主模式对对端身份进行了保护,而野蛮模式则没有。

3、两种模式在确定预共享密钥的方式不同。主模式只能基于IP地址来确定预共享密钥。而积极模式是基于ID信息(主机名和IP地址)来确定预共享密钥。

 

野蛮模式的必要性:

两边都是主机名的时候,就一定要用野蛮模式来协商,如果用主模式的话,就会出现根据源IP地址找不到预共享密钥的情况,以至于不能生成SKEYID

 

1、因为主模式在交换完34消息以后,需要使用预共享密钥来计算SKEYID,但是由于双方的ID信息在消息56中才会被发送,此时主模式的设备只能使用消息34中的源IP地址来找到与其对应的预共享密钥;如果主模式采用主机名方式,主机名信息却包含在消息56中,而IPSEC双方又必须在消息56之前找到其相应的预共享密钥,所以就造成了矛盾。

 

2、在野蛮模式中,ID信息(IP地址或者主机名)在消息12中就已经发送了,对方可以根据ID信息查找到对应的预共享密钥,从而计算出SKEYID

 

本实验采用华为三台F100防火墙,和一台s3526交换机,实现ipsec野蛮模式下的***通道的建立。Fw1是总部,实现fw1可以与fw2的内部网络互访,fw1fw3的内部网络互访。

托福图如下:

Fw1 的配置:

#

interface Ethernet0/1         端口配置

ip address 192.168.10.200  255.255.255.0

ipsec policy policy

#

#

interface Ethernet0/4

ip address 192.168.1.1 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 192.168.10.1 preference 60

firewall zone trust

add interface Ethernet0/4

#

acl number 3000

rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.2.0 0.0.0.255

rule 1 deny ip

acl number 3001

rule 0 permit ip source 192.168.1.0 0.0.0.255 destination 192.168.3.0 0.0.0.255

rule 1 permit ip

#

ipsec proposal tran1     配置安全提议

encapsulation-mode tunnel

transform esp

esp authentication-algorithm md5

esp encryption-algorithm des

display ipsec proposal

quit

#

ipsec proposal tran2

encapsulation-mode tunnel

transform esp

esp authentication-algorithm md5

esp encryption-algorithm des

display ipsec proposal

quit

ipsec policy policy 10 isakmp #ipsec       策略配置使用ike协商

security acl 3000

ike-peer peer1

proposal tran1

#

ipsec policy policy 20 isakmp

security acl 3001

ike-peer peer2

proposal tran2

ike local-name fw1

ike local-name fw1

ike peer peer1                       配置ike对等体

exchange-mode aggressive

pre-shared-key 1234

id-type name

remote-name fw2

local-address 192.168.10.200

#

ike peer peer2

exchange-mode aggressive              启用野蛮模式

pre-shared-key abcd

id-type name

remote-name fw3                       指定网关名称

local-address 192.168.10.200

Fw2的配置:

#

interface Ethernet0/1

ip address dhcp-alloc

ipsec policy policy

#

#

interface Ethernet0/4

ip address 192.168.2.1 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 192.168.20.1 preference 60

firewall zone trust

add interface Ethernet0/4

#

acl number 3000

rule 0 permit ip source 192.168.2.0 0.0.0.255 destination 192.168.1.0 0.0.0.255

rule 1 deny ip

#

#

ipsec proposal tran1

encapsulation-mode tunnel

transform esp

esp authentication-algorithm md5

esp encryption-algorithm des

display ipsec proposal

quit

ipsec policy policy 10 isakmp

security acl 3000

ike-peer peer1

proposal tran1

#

ike local-name fw2

ike peer peer1

exchange-mode aggressive

pre-shared-key 1234

id-type name

remote-name fw1

remote-address 192.168.10.200

#

Fw3的配置:

#

interface Ethernet0/1

ip address dhcp-alloc

ipsec policy policy

#

#

interface Ethernet0/4

ip address 192.168.3.1 255.255.255.0

ip route-static 0.0.0.0 0.0.0.0 192.168.30.1 preference 60

firewall zone trust

add interface Ethernet0/4

#

acl number 3001

rule 0 permit ip source 192.168.3.0 0.0.0.255 destination 192.168.1.0 0.0.0.255

rule 1 deny ip

#

#

ipsec proposal tran2

encapsulation-mode tunnel

transform esp

esp authentication-algorithm md5

esp encryption-algorithm des

display ipsec proposal

quit

ipsec policy policy 20 isakmp

security acl 3001

ike-peer peer2

proposal tran2

#

ike local-name fw3

ike peer peer1

exchange-mode aggressive

pre-shared-key abcd

id-type name

remote-name fw1

remote-address 192.168.10.200

#

交换机的配置:

#

vlan 10

#

vlan 20

#

vlan 30

#

interface Vlan-interface1

ip address 192.168.100.10 255.255.255.0

#

interface Vlan-interface10

ip address 192.168.10.1 255.255.255.0

#

interface Vlan-interface20

ip address 192.168.20.1 255.255.255.0

#

interface Vlan-interface30

ip address 192.168.30.1 255.255.255.0

#

dhcp server ip-pool fw2

network 192.168.20.0 mask 255.255.255.0

gateway-list 192.168.20.1

#

dhcp server ip-pool fw3

network 192.168.30.0 mask 255.255.255.0

gateway-list 192.168.30.1

 

测试:

1.0网段的主机访问2.03.0网段的主机:

 

20.0 网段 ping 10.0 网段

 

 

30.0 网段ping10.0网段