Question 1
Choose 1
The administrator uses FortiManager to push a CLI script using the Remote FortiGate Directly (via CLI)
option to configure an IPsec VPN. However, when running the script, the administrator receives the following
error:
config vpn ipsec phase2-interface [parameter(s) invalid. detail: object mismatch]
What must the administrator do to resolve the script error and successfully apply the IPsec configuration?
Correct answer:
A. Add the end command after finishing the IPsec phase 1-interface configuration block.
Explanation:
When configuring IPsec VPNs through FortiManager scripts, the phase2-interface must reference a valid phase1-interface. If the administrator forgets to close the phase1 block with the end command, the phase1 object is not created on the FortiGate. As a result, when the script attempts to configure phase2, FortiGate reports “object mismatch” because the required phase1 object does not exist. Adding the end command ensures the phase1-interface is properly defined and available before phase2 is configured. This is the most direct and correct fix for the error. Fortinet documentation confirms: “Phase2 configuration requires a valid phase1-interface. Ensure phase1 is completed and closed with ‘end’ before configuring phase2.” (FortiGate CLI Reference, FortiManager 7.6 Admin Guide).
Why other options are not correct:
B. Use IPsec templates to deploy provisioning templates:
Templates can simplify VPN deployment but do not resolve CLI syntax errors. The issue here is missing end, not template usage.
C. Add a second config vpn ipsec phase2-interface block without linking it to phase1:
Phase2 must always be linked to a valid phase1. Adding another block without linkage will still fail.
D. Run the script using the policy package or ADOM database method:
The execution method does not fix the object mismatch. The problem is within the script syntax itself, not how it is delivered.
References:
FortiGate CLI Reference Guide – IPsec VPN section:
“Phase2 must reference a valid phase1-interface. Ensure phase1 is properly defined and closed.”
When configuring IPsec VPNs through FortiManager scripts, the phase2-interface must reference a valid phase1-interface. If the administrator forgets to close the phase1 block with the end command, the phase1 object is not created on the FortiGate. As a result, when the script attempts to configure phase2, FortiGate reports “object mismatch” because the required phase1 object does not exist. Adding the end command ensures the phase1-interface is properly defined and available before phase2 is configured. This is the most direct and correct fix for the error. Fortinet documentation confirms: “Phase2 configuration requires a valid phase1-interface. Ensure phase1 is completed and closed with ‘end’ before configuring phase2.” (FortiGate CLI Reference, FortiManager 7.6 Admin Guide).
Why other options are not correct:
B. Use IPsec templates to deploy provisioning templates:
Templates can simplify VPN deployment but do not resolve CLI syntax errors. The issue here is missing end, not template usage.
C. Add a second config vpn ipsec phase2-interface block without linking it to phase1:
Phase2 must always be linked to a valid phase1. Adding another block without linkage will still fail.
D. Run the script using the policy package or ADOM database method:
The execution method does not fix the object mismatch. The problem is within the script syntax itself, not how it is delivered.
References:
FortiGate CLI Reference Guide – IPsec VPN section:
“Phase2 must reference a valid phase1-interface. Ensure phase1 is properly defined and closed.”