Configure the VPN gateway (Phase-I) with policy, peer address and outgoing interfaceTo identify the remote IKE peer, I have used IP address of peer device and outgoing interface ge-0/0/0 of SRX device. user@SRX-C#set security ike gateway VPN-GATEWAY ike-policy IKE-POLICY security zones security-zone VPN address-book address REMOTE_IP user@SRX-C#set security ike gateway VPN-GATEWAY address 10.10.20.1 user@SRX-C#set security ike gateway VPN-GATEWAY dead-peer-detection interval 10 user@SRX-C#set security ike gateway VPN-GATEWAY dead-peer-detection threshold 1 user@SRX-C#set security ike gateway VPN-GATEWAY nat-keepalive 10 user@SRX-C#set security ike gateway VPN-GATEWAY external-interface ge-0/0/0.0 Configure Phase-II Proposal and Policy as listed in above Table
Here I have defined the VPN parameters manually instead of using the default for Phase-II. user@SRX-C#set security ipsec proposal IPSEC-PROPOSAL protocol esp user@SRX-C#set security ipsec proposal IPSEC-PROPOSAL authentication-algorithm hmac-sha1-96 user@SRX-C#set security ipsec proposal IPSEC-PROPOSAL encryption-algorithm 3des-cbc user@SRX-C#set security ipsec proposal IPSEC-PROPOSAL lifetime-seconds 800 user@SRX-C#set security ipsec policy IPSEC-POLICY perfect-forward-secrecy keys group5 user@SRX-C#set security ipsec policy IPSEC-POLICY proposals IPSEC-PROPOSAL Configure IPSEC VPN (Phase-II) with IKE gateway and IPSEC policy user@SRX-C#set security ipsec IPSEC-VPN bind-interface st0.0 user@SRX-C#set security ipsec IPSEC-VPN ike gateway VPN-GATEWAY user@SRX-C#set security ipsec IPSEC-VPN ike proxy-identity local 192.168.1.0/24 user@SRX-C#set security ipsec IPSEC-VPN ike proxy-identity remote 192.168.200.0/24 user@SRX-C#set security ipsec IPSEC-VPN ike proxy-identity service any user@SRX-C#set security ipsec IPSEC-VPN ike ipsec-policy IPSEC-POLICY user@SRX-C#set security ipsec IPSEC-VPN establish-tunnels immediately Configure the security policy for VPN Traffic from and to LAN to VPN zone:
user@SRX-C#set security policies from-zone LAN to-zone VPN policy LAN_VPN match source-address LOCAL_IP user@SRX-C#set security policies from-zone LAN to-zone VPN policy LAN_VPN match destination-address REMOTE_IP user@SRX-C#set security policies from-zone LAN to-zone VPN policy LAN_VPN match application any user@SRX-C#set security policies from-zone LAN to-zone VPN policy LAN_VPN then permit user@SRX-C#set security policies from-zone VPN to-zone LAN policy VPN_LAN match source-address REMOTE_IP user@SRX-C#set security policies from-zone VPN to-zone LAN policy VPN_LAN match destination-address LOCAL_IP user@SRX-C#set security policies from-zone VPN to-zone LAN policy VPN_LAN match application any user@SRX-C#set security policies from-zone VPN to-zone LAN policy VPN_LAN then permit Configure the security policy for internet Traffic from LAN to WAN zone
user@SRX-C#set security policies from-zone LAN to-zone WAN policy LAN_WAN match source-address any user@SRX-C#set security policies from-zone LAN to-zone WAN policy LAN_WAN match destination-address any user@SRX-C#set security policies from-zone LAN to-zone WAN policy LAN_WAN match application any user@SRX-C#set security policies from-zone LAN to-zone WAN policy LAN_WAN then permit Configure the security NAT for internet Traffic from LAN to WAN zone
It is important to configure NAT for passing internet traffic from LAN to WAN zone. LAN zone IP address
will be translated to the egress interface IP of SRX as source IP when it goes to internet. And there should be NAT OFF policy above this policy for passing the VPN traffic. user@SRX-C#set security nat source rule-set LAN-TO_WAN from zone LAN user@SRX-C#set security nat source rule-set LAN-TO_WAN to zone WAN user@SRX-C#set security nat source rule-set LAN-TO_WAN rule SOURCE-NAT match source-address 0.0.0.0/0 user@SRX-C#set security nat source rule-set LAN-TO_WAN rule SOURCE-NAT match destination-address 0.0.0.0/0 user@SRX-C#set security nat source rule-set LAN-TO_WAN rule SOURCE-NAT then source-nat interface Configure tcp-mss to eliminate fragmentation of TCP traffic across tunnel
The tcp-mss for IPSec traffic is defined to eliminate the possibility of fragmented TCP traffic. It limits the maximum size of a TCP Segment
user@SRX-C#set security flow tcp-mss ipsec- mss 1350
The Juniper SRX [Side B] device can be configured similarly using the VPN parameters tabulated in above and following the steps to configure VPN in above.
Following command verifies the tunnel and status.
user@SRX-C>show security ike security-associations user@SRX-C>show security ipsec security-associations user@SRX-C>show security ike security-associations detail user@SRX-C>show security ipsec security-associations detail user@SRX-C>show security flow session tunnel