300
# Configure an ACL.
[RouterA] acl number 3101
[RouterA-acl-adv-3101] rule 0 permit ip source 172.16.0.0 0.0.0.255 destination
192.168.0.0 0.0.0.255
[RouterA-acl-adv-3101] quit
# Configure an IKE proposal.
[RouterA] ike proposal 1
[RouterA-ike-proposal-1] authentication-algorithm sha
[RouterA-ike-proposal-1] authentication-method pre-share
[RouterA-ike-proposal-1] encryption-algorithm 3des-cbc
[RouterA-ike-proposal-1] dh group2
# Configure an IKE peer.
[RouterA] ike peer peer
[RouterA-ike-peer-peer] exchange-mode aggressive
[RouterA-ike-peer-peer] pre-shared-key abc
[RouterA-ike-peer-peer] id-type name
[RouterA-ike-peer-peer] remote-name routerb
[RouterA-ike-peer-peer] nat traversal
[RouterA-ike-peer-peer] quit
# Configure an IPsec proposal named
prop
.
[RouterA] ipsec proposal prop
[RouterA-ipsec-proposal-prop] encapsulation-mode tunnel
[RouterA-ipsec-proposal-prop] transform esp
[RouterA-ipsec-proposal-prop] esp encryption-algorithm 3des
[RouterA-ipsec-proposal-prop] esp authentication-algorithm sha1
[RouterA-ipsec-proposal-prop] quit
# Create an IPsec policy, specifying to set up SAs through IKE negotiation.
[RouterA] ipsec policy policy 10 isakmp
# Configure the IPsec policy to reference the IKE peer.
[RouterA-ipsec-policy-isakmp-policy-10] ike-peer peer
# Configure the IPsec policy to reference ACL 3101.
[RouterA-ipsec-policy-isakmp-policy-10] security acl 3101
# Configure the IPsec policy to reference IPsec proposal prop.
[RouterA-ipsec-policy-isakmp-policy-10] proposal prop
[RouterA-ipsec-policy-isakmp-policy-10] quit
# Configure the IP address of interface Serial 2/1/1 and apply the IPsec policy to the interface.
[RouterA] interface serial 2/1/1
[RouterA-Serial2/1/1] ip address 100.1.1.1 255.255.255.0
[RouterA-Serial2/1/1] ipsec policy policy
[RouterA-Serial2/1/1] quit
# Configure the IP address of interface GigabitEthernet 1/0/1.
[RouterA] interface gigabitethernet 1/0/1
[RouterA-GigabitEthernet1/0/1] ip address 172.16.0.1 255.255.255.0
[RouterA-GigabitEthernet1/0/1] quit