You can set Internet Protocol Security with esxcli network ip ipsec commands or with the vicfg-ipsec command. which secures IP communications coming from and arriving at ESXi hosts. Administrators who perform IPsec setup must have a solid understanding of both IPv6 and IPsec.
You can run esxcli network ip ipsec commands with a vCenter Server system as a target (using the --vihost option).
sa-src and sa-dst --sa-source and --sa-destination spi (security parameter index) sa-mode (tunnel or transport) ealgo and ekey ialgo and ikey --integrity-algorithm and --integrity-key
src-addr and src-port --sa-source and --source-port dst-addr and dst-port
--sa-name
■ Create an SA. You specify the source, the destination, and the authentication mode. You also specify the authentication algorithm and authentication key to use. You must specify an encryption algorithm and key, but you can specify null if you want no encryption. Authentication is required and cannot be null. The following example includes extra line breaks for readability. The last option (sa_2 in the example) is the name of the SA.
■ List an SA with esxcli network ip ipsec sa list. This command returns SAs currently available for use by an SP. The list includes SAs you created.
■ Remove a single SA with esxcli network ip ipsec sa remove. If the SA is in use when you run this command, the command cannot perform the removal.
■ Remove all SAs with esxcli network ip ipsec sa remove --removeall. This option removes all SAs even when they are in use.
Caution Running esxcli network ip ipsec sa remove --removeall removes all SAs on your system and might leave your system in an inconsistent state.
Source port (0-65535). Specify any for any ports. Destination port (0-65535). Specify any for any ports. If ulproto is icmp6, this number refers to the icmp6 type. Otherwise, this number refers to the port. Upper layer protocol. Use this option to restrict the SP to only certain protocols, or use any to apply the SP to all protocols. none -- Take no action, that is, allow traffic unmodified.discard -- Do not allow data in or out.ipsec -- Use the authentication and encryption information specified in the SA to determine whether the data come from a trusted source.
■ Create an SP with esxcli network ip ipsec add. You identify the data to monitor by specifying the selector’s source and destination IP address and prefix, source port and destination port, upper layer protocol, direction of traffic, action to take, and SP mode. The last two option are the name of the SA to use and the name of the SP that is being created. The following example includes extra line breaks for readability.
■ List an SP with esxcli network ip ipsec list. This command returns SPs currently available. All SPs are created by the administrator.
■ Remove an SP with esxcli network ip ipsec remove. If the SP is in use when you run this command, the command cannot perform the removal. You can run esxcli network ip ipsec remove --removeall instead to remove the SP even when it is in use.
Caution Running esxcli network ip ipsec remove --removeall removes all SPs on your system and might leave your system in an inconsistent state.