<chapter id="ipsec-mgtasks-1"><title>Configuring IPsec (Tasks)</title><highlights><para>This chapter provides procedures for implementing IPsec on your network.
The procedures are described in the following task maps:</para><itemizedlist remap="jumplist"><listitem><para><olink targetptr="ipsec-mgtasks-2" remap="internal">Protecting Traffic With
IPsec (Task Map)</olink></para>
</listitem><listitem><para><olink targetptr="ipsec-mgtasks-vpn-2" remap="internal">Protecting a VPN With
IPsec (Task Map)</olink></para>
</listitem>
</itemizedlist><para>For overview information about IPsec, see <olink targetptr="ipsec-ov-1" remap="internal">Chapter&nbsp;19,
IP Security Architecture (Overview)</olink>. For reference information about
IPsec, see <olink targetptr="ipsecref-1" remap="internal">Chapter&nbsp;21, IP Security Architecture
(Reference)</olink>.</para>
</highlights><sect1 id="ipsec-mgtasks-2"><title>Protecting Traffic With IPsec (Task Map)</title><para>The following table points to procedures that set up IPsec between
one or more systems. The <olink targetdoc="refman1m" targetptr="ipsecconf-1m" remap="external"><citerefentry><refentrytitle>ipsecconf</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, <olink targetdoc="refman1m" targetptr="ipseckey-1m" remap="external"><citerefentry><refentrytitle>ipseckey</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>, and <olink targetdoc="refman1m" targetptr="ifconfig-1m" remap="external"><citerefentry><refentrytitle>ifconfig</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages
also describe useful procedures in their respective Examples sections.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="25.20*"/><colspec colname="colspec1" colwidth="40.60*"/><colspec colname="colspec2" colwidth="33.20*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Secure traffic between two systems</para>
</entry><entry><para>Protects packets from one system to another system.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-3" remap="internal">How to Secure Traffic Between Two
Systems With IPsec</olink></para>
</entry>
</row><row><entry><para>Secure a web server by using IPsec policy</para>
</entry><entry><para>Requires non-web traffic to use IPsec. Web clients are identified by
particular ports, which bypass IPsec checks.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-16" remap="internal">How to Secure a Web Server With
IPsec</olink></para>
</entry>
</row><row><entry><para>Display
IPsec policies</para>
</entry><entry><para>Displays
the IPsec policies that are currently being enforced, in the order in which
the policies are enforced.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-14" remap="internal">How to Display IPsec Policies</olink></para>
</entry>
</row><row><entry><para>Generate random numbers</para>
</entry><entry><para>Generates random numbers for keying material for manually created security
associations.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-12" remap="internal">How to Generate Random Numbers on
a Solaris System</olink></para>
</entry>
</row><row><entry><para>Create or replace security associations manually</para>
</entry><entry><para>Provides the raw data for security associations:</para><itemizedlist><listitem><para>IPsec algorithm name and keying material</para>
</listitem><listitem><para>Key for the security parameter index</para>
</listitem><listitem><para>IP source and destination addresses</para>
</listitem>
</itemizedlist>
</entry><entry><para><olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security
Associations</olink></para>
</entry>
</row><row><entry><para>Check that IPsec is protecting the packets</para>
</entry><entry><para>Examines <command>snoop</command> output for specific headers that indicate
how the IP datagrams are protected.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-11" remap="internal">How to Verify That Packets Are Protected
With IPsec</olink></para>
</entry>
</row><row><entry><para>(Optional) Create a Network Security role</para>
</entry><entry><para>Creates a role that can set up a secure network, but has fewer powers
than superuser.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-18" remap="internal">How to Create a Role for Configuring
Network Security</olink></para>
</entry>
</row><row><entry><para>Set up a secure virtual private network (VPN)</para>
</entry><entry><para>Sets up IPsec between two systems that are separated by the Internet.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-vpn-2" remap="internal">Protecting a VPN With IPsec (Task
Map)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ipsec-mgtasks-4"><title>Protecting Traffic With IPsec</title><para>This section provides procedures that enable you to secure traffic between
two systems, and to secure a web server. To protect a VPN, see <olink targetptr="ipsec-mgtasks-vpn-2" remap="internal">Protecting a VPN With IPsec (Task Map)</olink>. Additional procedures provide keying material, provide security
associations, and verify that IPsec is working as configured.</para><itemizedlist><para>The following information applies to all IPsec configuration tasks:</para><listitem><para><emphasis role="strong">IPsec and zones &ndash;</emphasis> To
manage IPsec policy and keys for a non-global zone, create the IPsec policy file in the global
zone, and run the IPsec configuration commands from the global zone. Use the source address which corresponds
to the non-global zone that is being configured. You can also configure IPsec
policy and keys in the global zone for the global zone. In the  Solaris Express, Developer Edition 2/07 release,
you can use IKE to manage keys in a non-global zone.</para>
</listitem><listitem><para><emphasis role="strong">IPsec and RBAC &ndash;</emphasis> To use
roles to administer IPsec, see <olink targetdoc="sysadv6" targetptr="rbactask-1" remap="external">Chapter 8, <citetitle remap="chapter">Using Role-Based Access Control (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>. For an example, see <olink targetptr="ipsec-mgtasks-18" remap="internal">How to Create a Role for Configuring Network
Security</olink>.</para>
</listitem><listitem><para><emphasis role="strong">IPsec and SCTP &ndash;</emphasis> IPsec
can be used to protect Streams Control Transmission Protocol (SCTP) associations,
but caution must be used. For more information, see <olink targetptr="ipsec-ov-22" remap="internal">IPsec and SCTP</olink>.</para>
</listitem>
</itemizedlist><task id="ipsec-mgtasks-3"><title>How to Secure Traffic Between Two Systems
With IPsec</title><tasksummary><note><para>You configure IPsec policy in the global zone. </para>
</note><itemizedlist><para>This procedure assumes the following setup:</para><listitem><para>The two systems are named <literal>enigma</literal> and <literal>partym</literal>.</para>
</listitem><listitem><para>Each system has two addresses, an IPv4 address and an IPv6
address.</para>
</listitem><listitem><para>Each system invokes AH protection with the MD5 algorithm,
which requires a key of 128 bits.</para>
</listitem><listitem><para>Each system invokes ESP protections with the 3DES algorithm,
which requires a key of 192 bits.</para>
</listitem><listitem><para>Each system uses shared security associations.</para><para>With
shared SAs, only one pair of SAs is needed to protect the two systems.</para>
</listitem>
</itemizedlist>
</tasksummary><procedure><step><para>On the system console, assume the Primary Administrator role or
become superuser.</para><para>The Primary Administrator role includes the
Primary Administrator profile. To create the role and assign the role to a
user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step id="ipsec-mgtasks-ipnode-1"><para>On each system, add host entries to the <filename>/etc/inet/hosts</filename> file.</para><substeps><step><para>On a system that is named <literal>partym</literal>, type
the following in the <filename>hosts</filename> file:</para><screen># Secure communication with enigma
192.168.116.16 enigma
2001::aaaa:6666:6666 enigma</screen>
</step><step><para>On a system that is named <literal>enigma</literal>, type
the following in the <filename>hosts</filename> file:</para><screen># Secure communication with partym
192.168.13.213 partym
2001::eeee:3333:3333 partym</screen>
</step>
</substeps>
</step><step><para>On each system, create the IPsec policy file.</para><para>The
file name is <filename>/etc/inet/ipsecinit.conf</filename>. For
an example, see the <filename>/etc/inet/ipsecinit.sample</filename> file.</para>
</step><step id="ipsec-mgtasks-policy-1"><para>Add an IPsec policy entry to the <filename>ipsecinit.conf</filename> file.</para><substeps><step><para>On the <literal>enigma</literal> system, add the following
policy:</para><screen width="100">{laddr enigma raddr partym} ipsec {auth_algs any encr_algs any sa shared}</screen>
</step><step><para>On the <literal>partym</literal> system, add the identical policy:</para><screen width="100">{laddr partym raddr enigma} ipsec {auth_algs any encr_algs any sa shared}</screen><para>For the syntax of IPsec policy entries, see the <olink targetdoc="refman1m" targetptr="ipsecconf-1m" remap="external"><citerefentry><refentrytitle>ipsecconf</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</step>
</substeps>
</step><step id="ipsec-mgtasks-sa-3"><para>On each system, add a pair of IPsec SAs between the two systems.</para><para>You can configure Internet Key Exchange (IKE) to create the SAs automatically.
You can also add the SAs manually.</para><note><para>You should use IKE unless you have good reason to generate and
maintain your keys manually. IKE key management is more secure than manual
key management.</para>
</note><itemizedlist><listitem><para>Configure IKE by following one of the configuration procedures
in <olink targetptr="ike-task-7" remap="internal">Configuring IKE (Task Map)</olink>. For the
syntax of the IKE configuration file, see the <olink targetdoc="refman4" targetptr="ike.config-4" remap="external"><citerefentry><refentrytitle>ike.config</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man page.</para>
</listitem><listitem><para>To add the SAs manually, see <olink targetptr="ipsec-mgtasks-13" remap="internal">How
to Manually Create IPsec Security Associations</olink>. </para>
</listitem>
</itemizedlist>
</step><step id="ipsec-mgtasks-reboot-1"><para>Reboot each system.</para><screen># <userinput>init 6</userinput></screen>
</step><step><para>Verify that packets are being protected.</para><para>For the procedure,
see <olink targetptr="ipsec-mgtasks-11" remap="internal">How to Verify That Packets Are Protected
With IPsec</olink>.</para>
</step>
</procedure><example id="ipsec-mgtasks-19"><title>Securing Traffic With IPsec Without Rebooting</title><para>The following example describes how to implement IPsec in a test environment.
In a production environment, it is more secure to reboot than to run the <command>ipsecconf</command> command.
For the security considerations, see the end of this example.</para><para>Instead of rebooting at <olink targetptr="ipsec-mgtasks-reboot-1" remap="internal">Step&nbsp;6</olink>, choose one of the following options.</para><itemizedlist><listitem><para>If you used IKE to create keying material, stop and then restart
the <command>in.iked</command> daemon.</para><screen># <userinput>pkill in.iked</userinput>
# <userinput>/usr/lib/inet/in.iked</userinput></screen>
</listitem><listitem><para>If you added keys manually, use the <command>ipseckey</command> command
to add the SAs to the database.</para><screen># <userinput>ipseckey -f /etc/inet/secret/ipseckeys</userinput></screen><para>Then activate the IPsec policy
with the <command>ipsecconf</command> command.</para><screen># <userinput>ipsecconf -a /etc/inet/ipsecinit.conf</userinput></screen>
</listitem>
</itemizedlist><para><emphasis role="strong">Security Considerations &ndash;</emphasis> Read
the warning when you execute the <command>ipsecconf</command> command. A socket
that is already latched, that is, a socket that is already in use, provides
an unsecured back door into the system. For more extensive discussion, see <olink targetptr="ipsecref-42" remap="internal">Security Considerations for ipsecinit.conf and ipsecconf</olink>.</para>
</example>
</task><task id="ipsec-mgtasks-16"><title>How to Secure a Web Server With IPsec</title><tasksummary><para>A secure web server allows web clients to talk to the web service. On
a secure web server, traffic that is not web traffic <emphasis>must</emphasis> pass
security checks. The following procedure includes bypasses for web traffic.
In addition, this web server can make nonsecured DNS client requests. All
other traffic requires ESP with AES and SHA-1 algorithms.</para><note><para>You configure IPsec policy in the global zone. </para>
</note>
</tasksummary><procedure><step><para>On the system console, assume the Primary Administrator role or
become superuser.</para><para>The Primary Administrator role includes the
Primary Administrator profile. To create the role and assign the role to a
user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step id="ipsec-mgtasks-bypass-1"><para>Determine which services need to bypass
security policy checks.</para><para>For a web server, these services include
TCP ports 80 (HTTP) and 443 (Secure HTTP). If the web server provides DNS
name lookups, the server might also need to include port 53 for both TCP and
UDP.</para>
</step><step id="ipsec-mgtasks-webfile-1"><para>Create a file in the <filename class="directory">/etc/inet</filename> directory
for the web server policy.</para><para>Give the file a name that indicates
its purpose, for example <filename>IPsecWebInitFile</filename>. Type the following
lines in this file:</para><screen># Web traffic that web server should bypass.
{lport  80 ulp tcp dir both} bypass {}
{lport 443 ulp tcp dir both} bypass {}

# Outbound DNS lookups should also be bypassed.
{rport 53 dir both} bypass {}

# Require all other traffic to use ESP with AES and SHA-1.
# Use a unique SA for outbound traffic from the port
{} ipsec {encr_algs aes encr_auth_algs sha1 sa shared}</screen><para>This configuration allows only secure traffic to access the system,
with the bypass exceptions that are described in <olink targetptr="ipsec-mgtasks-bypass-1" remap="internal">Step&nbsp;2</olink>.</para>
</step><step id="ipsec-mgtasks-init-2"><para>Copy the contents of the file that you created in <olink targetptr="ipsec-mgtasks-webfile-1" remap="internal">Step&nbsp;3</olink> into the <filename>/etc/inet/ipsecinit.conf</filename> file.</para>
</step><step><para>Protect the <filename>IPsecWebInitFile</filename> file with read-only
permissions.</para><screen># <userinput>chmod 400 IPsecWebInitFile</userinput></screen>
</step><step><para>Secure the web server without rebooting. </para><para>Choose one
of the following options.</para><itemizedlist><listitem><para>If you are using IKE for key management, stop and restart
the <command>in.iked</command> daemon.</para><screen># <userinput>pkill in.iked</userinput>
# <userinput>/usr/lib/inet/in.iked</userinput></screen>
</listitem><listitem><para>If you are manually managing keys, use the <command>ipseckey</command> and <command>ipsecconf</command> commands.</para><para>Use the <filename>IPsecWebInitFile</filename> as
the argument to the <command>ipsecconf</command> command. If you use the <filename>ipsecinit.conf</filename> file as the argument, the <command>ipsecconf</command> command
generates errors when policies in the file are already implemented on the
system.</para><screen># <userinput>ipseckey -f /etc/inet/secret/ipseckeys</userinput> 
# <userinput>ipsecconf -a /etc/inet/IPsecWebInitFile</userinput> </screen>
</listitem>
</itemizedlist><caution><para>Read the warning when you execute the <command>ipsecconf</command> command.
A socket that is already latched, that is, a socket that is already in use,
provides an unsecured back door into the system. For more extensive discussion,
see <olink targetptr="ipsecref-42" remap="internal">Security Considerations for ipsecinit.conf
and ipsecconf</olink>. The same warning applies to restarting the <command>in.iked</command> daemon.</para>
</caution><para>You can also reboot. Rebooting ensures that the IPsec policy is in effect
on all TCP connections. At reboot, the TCP connections use the policy in the
IPsec policy file.</para>
</step><step performance="optional"><para>Enable a remote system to communicate with
the web server for nonweb traffic.</para><para>Type the following policy in
a remote system's <filename>ipsecinit.conf</filename> file.</para><screen># Communicate with web server about nonweb stuff
#
{laddr webserver} ipsec {encr_algs aes encr_auth_algs sha1 sa shared}</screen><para>A remote system can communicate securely with the web server for nonweb
traffic only when the systems' IPsec policies match.</para>
</step>
</procedure>
</task><task id="ipsec-mgtasks-14"><title>How to Display IPsec Policies</title><tasksummary><para>You can see the policies that are configured in the system when you
issue the <command>ipsecconf</command> command without any arguments. The
command must be run from the global zone.</para>
</tasksummary><procedure><step><para>Assume a role that includes the Network Security profile, or become
superuser.</para><para>To create a role that includes the Network Security
profile and assign that role to a user, see <olink targetptr="ipsec-mgtasks-18" remap="internal">How
to Create a Role for Configuring Network Security</olink>.</para>
</step><step><para>Display the global IPsec policy entries in the order that the entries were added.</para><screen>$ <userinput>ipsecconf</userinput></screen><para>The command displays each entry with an <emphasis>index</emphasis> followed
by a number.</para>
</step><step><para>Display the IPsec policy entries in the order in which a match occurs.</para><screen>$ <userinput>ipsecconf -l</userinput></screen>
</step><step><para>Display the IPsec policy entries, including per-tunnel entries,
in the order in which a match occurs.</para><screen>$ <userinput>ipsecconf -L</userinput></screen>
</step>
</procedure>
</task><task id="ipsec-mgtasks-12"><title>How to Generate Random Numbers on a Solaris
System</title><tasksummary><para>If you are entering keys manually, the keying
material should be random. The format for keying material for a Solaris system is
hexadecimal. Other operating
systems can require ASCII keying material. To generate keying material for
a Solaris system that is communicating with an operating system that requires
ASCII, see <olink targetptr="iketask-key-ex-1" remap="internal">Example 23&ndash;1</olink>.</para><para>If your site has a random number generator, use that generator. Otherwise,
you can use the <command>od</command> command with the <filename>/dev/random</filename> Solaris
device as input. For more information, see the <olink targetdoc="refman1" targetptr="od-1" remap="external"><citerefentry><refentrytitle>od</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page.</para>
</tasksummary><procedure><step><para>Generate random numbers in hexadecimal format.</para><screen>% od -x|-X -A n <replaceable>file</replaceable> | head -<replaceable>n</replaceable></screen><variablelist><varlistentry><term><option>x</option></term><listitem><para>Displays the octal dump in hexadecimal format. Hexadecimal
format is useful for keying material. The hexadecimal is printed in 4-character
chunks.</para>
</listitem>
</varlistentry><varlistentry><term><option>X</option></term><listitem><para>Displays the octal dump in hexadecimal format. The hexadecimal
is printed in 8-character chunks.</para>
</listitem>
</varlistentry><varlistentry><term><option>A</option> n</term><listitem><para>Removes the input offset base from the display.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>file</replaceable></term><listitem><para>Serves as a source for random numbers.</para>
</listitem>
</varlistentry><varlistentry><term><command>head -</command><replaceable>n</replaceable></term><listitem><para>Restricts the display to the first <replaceable>n</replaceable> lines
of output.</para>
</listitem>
</varlistentry>
</variablelist>
</step><step><para>Combine the output to create a key of the appropriate length.</para><para>Remove the spaces between the numbers on one line to create a
32-character key. A 32-character key is 128 bits. For a security parameter
index (SPI), you should use an 8-character key. The key should use the <literal>0x</literal> prefix.</para>
</step>
</procedure><example id="ike-task-33"><title>Generating Key Material for IPsec</title><para>The following example displays two lines of keys in groups of eight
hexadecimal characters each.</para><screen>% <userinput>od -X -A n /dev/random | head -2</userinput>
         d54d1536 4a3e0352 0faf93bd 24fd6cad
         8ecc2670 f3447465 20db0b0c c83f5a4b</screen><para>By combining the four numbers on the first line, you can create
a 32-character key. An 8-character number that is preceded by <literal>0x</literal> provides
a suitable SPI value, for example, <literal>0xf3447465</literal>.</para><para>The following example displays two lines of keys in groups of four hexadecimal
characters each.</para><screen>% <userinput>od -x -A n /dev/random | head -2</userinput>
         34ce 56b2 8b1b 3677 9231 42e9 80b0 c673
         2f74 2817 8026 df68 12f4 905a db3d ef27</screen><para>By combining the eight numbers on the first line, you can create a 32-character
key.</para>
</example>
</task><task id="ipsec-mgtasks-13"><title>How to Manually Create IPsec Security Associations</title><tasksummary><note><para>You manually manage keying material for a non-global zone from
the global zone.</para>
</note><para>The following procedure provides the keying material for the procedure, <olink targetptr="ipsec-mgtasks-3" remap="internal">How to Secure Traffic Between Two Systems With
IPsec</olink>.</para>
</tasksummary><procedure><step id="ipsec-mgtasks-keymat-1"><para>Generate the keying material for the
SAs. </para><para>You need three hexadecimal random numbers for outbound traffic
and three hexadecimal random numbers for inbound traffic.</para><itemizedlist><para>Therefore, one system needs to generate the following numbers:</para><listitem><para>Two hexadecimal random numbers as the value for the <literal>spi</literal> keyword.
One number is for outbound traffic. One number is for inbound traffic. Each
number can be up to eight characters long.</para>
</listitem><listitem><para>Two hexadecimal random numbers for the MD5 algorithm for AH.
Each number must be 32 characters long. One number is for  <literal>dst enigma</literal>.
One number is for <literal>dst partym</literal>.</para>
</listitem><listitem><para>Two hexadecimal random numbers for the 3DES algorithm for
ESP. For a 192-bit key, each number must be 48 characters long. One number
is for  <literal>dst enigma</literal>. One number is for <literal>dst partym</literal>.</para>
</listitem>
</itemizedlist><para>If you have a random number generator at your site, use the generator.
You can also use the <command>od</command> command. See <olink targetptr="ipsec-mgtasks-12" remap="internal">How to Generate Random Numbers on a Solaris System</olink> for
the procedure.</para>
</step><step id="ipsec-mgtasks-createsa-1"><para>On the system console on one of
the systems, assume the Primary Administrator role or become superuser.</para><para>The Primary Administrator role includes the Primary Administrator profile.
To create the role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step><para>Enable the <command>ipseckey</command> command mode:</para><screen># <userinput>ipseckey</userinput>

></screen><para>The <keysym>></keysym> prompt indicates that you are in <command>ipseckey</command> command mode.</para>
</step><step><para>If you are replacing existing SAs, flush the current SAs.</para><screen>> <userinput>flush</userinput>
> </screen><para>To prevent an adversary from having time to break your SAs, you
need to replace the keying material.</para><note><para>You must coordinate key replacement on communicating systems.
When you replace the SAs on one system, the SAs must also be replaced on the
remote system.</para>
</note>
</step><step><para>To create SAs, type the following command.</para><screen>> <userinput>add <replaceable>protocol</replaceable> spi <replaceable>random-hex-string</replaceable> \</userinput>
<userinput>src <replaceable>addr</replaceable> dst <replaceable>addr2</replaceable> \</userinput>
<userinput><replaceable>protocol-prefix</replaceable>_alg <replaceable>protocol-algorithm</replaceable>  \</userinput>
<userinput><replaceable>protocol-prefix</replaceable>key <replaceable>random-hex-string-of-algorithm-specified-length</replaceable></userinput></screen><para>You also use this syntax to replace SAs that you have just flushed.</para><variablelist termlength="wholeline"><varlistentry><term><replaceable>protocol</replaceable></term><listitem><para>Specifies either <literal>esp</literal> or <literal>ah</literal>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>random-hex-string</replaceable></term><listitem><para>Specifies a random number of up to eight characters in hexadecimal
format. Precede the characters with <literal>0x</literal>. If you enter more
numbers than the security parameter index (SPI) accepts, the system ignores
the extra numbers. If you enter fewer numbers than the SPI accepts, the system
pads your entry.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>addr</replaceable></term><listitem><para>Specifies the IP address of one system.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>addr2</replaceable></term><listitem><para>Specifies the IP address of the peer system of <replaceable>addr</replaceable>.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>protocol-prefix</replaceable></term><listitem><para>Specifies one of <literal>encr</literal> or <literal>auth</literal>.
The <literal>encr</literal> prefix is used with the <literal>esp</literal> protocol.
The <literal>auth</literal> prefix is used with the <literal>ah</literal> protocol,
and for authenticating the <literal>esp</literal> protocol.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>protocol-algorithm</replaceable></term><listitem><para>Specifies an algorithm for ESP or AH. Each algorithm requires
a key of a specific length.</para><para>Authentication algorithms include MD5 and SHA. Encryption algorithms
include 3DES and AES.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>random-hex-string-of-algorithm-specified-length</replaceable></term><listitem><para>Specifies a random hexadecimal number of the length that is required
by the algorithm. For example, the MD5 algorithm requires a 32-character string
for its 128-bit key. The 3DES algorithm requires a 48-character string for
its 192-bit key.</para>
</listitem>
</varlistentry>
</variablelist><substeps><step><para>For example, on the <literal>enigma</literal> system, protect
outbound packets.</para><para>Use the random numbers that you generated in <olink targetptr="ipsec-mgtasks-keymat-1" remap="internal">Step&nbsp;1</olink>.</para><para>For Solaris 10 1/06:</para><screen>> <userinput>add esp spi 0x8bcd1407 \</userinput>
<userinput>src 192.168.116.16 dst 192.168.13.213 \</userinput>
<userinput>encr_alg 3des \</userinput>
<userinput>auth_alg md5 \</userinput>
<userinput>encrkey d41fb74470271826a8e7a80d343cc5aae9e2a7f05f13730d</userinput> \
<userinput>authkey e896f8df7f78d6cab36c94ccf293f031</userinput>
></screen><note><para>The peer system must use the same keying material and the same
SPI.</para>
</note>
</step><step><para>Still in <command>ipseckey</command> command mode on the <literal>enigma</literal> system,
protect inbound packets.</para><para>Type the following commands to protect
the packets:</para><screen>> <userinput>add esp spi 0x122a43e4 \</userinput>
<userinput>src 192.168.13.213 dst 192.168.116.16 \</userinput>
<userinput>encr_alg 3des \</userinput>
<userinput>auth_alg md5 \</userinput>
<userinput>encrkey dd325c5c137fb4739a55c9b3a1747baa06359826a5e4358e</userinput> \
<userinput>authkey ad9ced7ad5f255c9a8605fba5eb4d2fd</userinput>
></screen><note><para>The keys and SPI can be different for each SA. You <emphasis>should</emphasis> assign
different keys and a different SPI for each SA.</para>
</note>
</step>
</substeps>
</step><step><para>To exit <command>ipseckey</command> command mode, press <keysym>Control</keysym>-D or type <literal>quit</literal>.</para>
</step><step id="ipsec-mgtasks-createsa-2"><para>To ensure that the keying material
is available to IPsec at reboot, add the keying material to the <filename>/etc/inet/secret/ipseckeys</filename> file.</para><para>The  lines  of the <filename>/etc/inet/secret/ipseckeys</filename> file are identical to the command line language.</para><substeps><step><para>For example, the <filename>/etc/inet/secret/ipseckeys</filename> file
on the <literal>enigma</literal> system would appear similar to the following:</para><screen># ipseckeys - This file takes the file format documented in 
#   ipseckey(1m).
#   Note that naming services might not be available when this file
#   loads, just like ipsecinit.conf.
#
# for outbound packets on enigma
add esp spi 0x8bcd1407 \
   src 192.168.116.16 dst 192.168.13.213  \
   encr_alg 3des \
   auth_alg md5  \
   encrkey  d41fb74470271826a8e7a80d343cc5aae9e2a7f05f13730d \
   authkey  e896f8df7f78d6cab36c94ccf293f031
#
# for inbound packets
add esp spi 0x122a43e4 \
   src 192.168.13.213 dst 192.168.116.16 \
   encr_alg 3des \
   auth_alg md5  \
   encrkey dd325c5c137fb4739a55c9b3a1747baa06359826a5e4358e \
   authkey ad9ced7ad5f255c9a8605fba5eb4d2fd</screen>
</step><step><para>Protect the file with read-only permissions.</para><screen># <userinput>chmod 400 /etc/inet/secret/ipseckeys</userinput></screen>
</step>
</substeps>
</step><step><para>Repeat <olink targetptr="ipsec-mgtasks-createsa-1" remap="internal">Step&nbsp;2</olink> through <olink targetptr="ipsec-mgtasks-createsa-2" remap="internal">Step&nbsp;7</olink> on the <literal>partym</literal> system. </para><para>Use the same keying material that was used on <literal>enigma</literal>.</para><para>The keying material on the two systems <emphasis>must</emphasis> be
identical. As shown in the following example, only the comments in the <filename>ipseckeys</filename> file differ. The comments differ because <literal>dst enigma</literal> is
inbound on the <literal>enigma</literal> system, and outbound on the <literal>partym</literal> system.</para><screen># partym ipseckeys file
#
<userinput># for inbound packets</userinput>
add esp spi 0x8bcd1407 \
   src 192.168.116.16 dst 192.168.13.213  \
   encr_alg 3des \
   auth_alg md5  \
   encrkey  d41fb74470271826a8e7a80d343cc5aae9e2a7f05f13730d \
   authkey  e896f8df7f78d6cab36c94ccf293f031
#
<userinput># for outbound packets</userinput>
add esp spi 0x122a43e4 \
   src 192.168.13.213 dst 192.168.116.16 \
   encr_alg 3des \
   auth_alg md5  \
   encrkey dd325c5c137fb4739a55c9b3a1747baa06359826a5e4358e \
   authkey ad9ced7ad5f255c9a8605fba5eb4d2fd</screen>
</step>
</procedure>
</task><task id="ipsec-mgtasks-11"><title>How to Verify That Packets Are Protected
With IPsec</title><tasksummary><itemizedlist><para>To verify that packets are protected, test the connection with the <command>snoop</command> command. The following prefixes can appear in the <command>snoop</command> output:</para><listitem><para><literal>AH:</literal> Prefix indicates that AH is protecting
the headers. You see <literal>AH:</literal> if you used <literal>auth_alg</literal> to
protect the traffic.</para>
</listitem><listitem><para><literal>ESP:</literal> Prefix indicates that encrypted data
is being sent. You see <literal>ESP:</literal> if you used <literal>encr_auth_alg</literal> or <literal>encr_alg</literal> to protect the traffic.</para>
</listitem>
</itemizedlist>
</tasksummary><taskprerequisites><para>You must be superuser or have assumed an equivalent role to create the <command>snoop</command> output. You must have access to both systems to test the connection.</para>
</taskprerequisites><procedure><step><para>On one system, such as <literal>partym</literal>, become superuser.</para><screen>% <userinput>su -</userinput>
Password: <lineannotation>Type root password</lineannotation>
# </screen>
</step><step><para>From the <literal>partym</literal> system, prepare to snoop
packets from a remote system.</para><para>In a terminal window on <literal>partym</literal>,
snoop the packets from the <literal>enigma</literal> system.</para><screen># <userinput>snoop -v enigma</userinput>
Using device /dev/hme (promiscuous mode)</screen>
</step><step><para>Send a packet from the remote system.</para><para>In another terminal
window, remotely log in to the <literal>enigma</literal> system. Provide
your password. Then, become superuser and send a packet from the <literal>enigma</literal> system
to the <literal>partym</literal> system. The packet should be captured
by the <command>snoop -v enigma</command> command.</para><screen>% <userinput>ssh enigma</userinput>
Password: <lineannotation>Type your password</lineannotation>
% <userinput>su -</userinput>
Password: <lineannotation>Type root password</lineannotation>
# <userinput>ping partym</userinput></screen>
</step><step><para>Examine the <command>snoop</command> output.</para><para>On the <literal>partym</literal> system,
you should see output that includes <literal>AH</literal> and <literal>ESP</literal> information
after the initial <literal>IP</literal> header information. <literal>AH</literal> and <literal>ESP</literal> information that resembles the following shows that packets
are being protected:</para><screen>IP:   Time to live = 64 seconds/hops
IP:   Protocol = 51 (AH)
IP:   Header checksum = 4e0e
IP:   Source address = 192.168.116.16, enigma
IP:   Destination address = 192.168.13.213, partym
IP:   No options
IP:
AH:  ----- Authentication Header -----
AH:
AH:  Next header = 50 (ESP)
AH:  AH length = 4 (24 bytes)
AH:  &lt;Reserved field = 0x0>
AH:  SPI = 0xb3a8d714
AH:  Replay = 52
AH:  ICV = c653901433ef5a7d77c76eaa
AH:
ESP:  ----- Encapsulating Security Payload -----
ESP:
ESP:  SPI = 0xd4f40a61
ESP:  Replay = 52
ESP:     ....ENCRYPTED DATA....

ETHER:  ----- Ether Header -----
...</screen>
</step>
</procedure>
</task><task id="ipsec-mgtasks-18"><title>How to Create a Role for Configuring Network
Security</title><tasksummary><para>If you are using role-based access control (RBAC) to administer your
systems, you use this procedure to provide a network management or network
security role.</para>
</tasksummary><procedure><step><para>Find the Network rights profiles in the local <filename>prof_attr</filename> database.</para><screen>% <userinput>cd /etc/security</userinput>
% <userinput>grep Network prof_attr</userinput>
Network Management:::Manage the host and network configuration &hellip;
Network Security:::Manage network and host security &hellip;
System Administrator:::&hellip;Network Management&hellip;</screen><para>The Network Management profile is a supplementary profile in the System
Administrator profile. If you have included the System Administrator rights
profile in a role, then that role can execute the commands in the Network
Management profile.</para>
</step><step><para>Determine which commands are in the Network Management rights
profile.</para><screen>% <userinput>grep "Network Management" /etc/security/exec_attr</userinput>
Network Management:solaris:cmd:::/usr/sbin/ifconfig:privs=sys_net_config
&hellip;
Network Management:suser:cmd:::/usr/sbin/snoop:uid=0</screen><para>The <literal>solaris</literal> policy commands run with privilege (<literal>privs=sys_net_config</literal>). The <literal>suser</literal> policy commands
run as superuser (<literal>uid=0</literal>).</para>
</step><step><para>Determine which commands are in the Network Security rights profile.</para><screen>% <userinput>grep "Network Security" /etc/security/exec_attr</userinput>
&hellip;
Network Security:solaris:cmd:::/usr/sbin/ipsecconf:privs=sys_net_config
&hellip;
Network Security:solaris:cmd:::/usr/sbin/ipseckey:privs=sys_net_config
&hellip;</screen>
</step><step><para>Create a role that includes the Network Security and the Network
Management rights profiles.</para><para>A role with both profiles can execute
the <command>ifconfig</command>, <command>snoop</command>, <command>ipsecconf</command>,
and <command>ipseckey</command> commands, among others, with appropriate privilege.</para><para>To create the role, assign the role to a user, and register the
changes with the name service, see <olink targetdoc="sysadv6" targetptr="rbactask-15" remap="external"><citetitle remap="section">Configuring RBAC (Task Map)</citetitle> in <citetitle remap="book">System Administration Guide: Security Services</citetitle></olink>.</para>
</step>
</procedure>
</task>
</sect1><sect1 id="ipsec-mgtasks-vpn-2"><title>Protecting a VPN With IPsec (Task Map)</title><para>The following table points to procedures that configure IPsec
to protect traffic across the Internet. These procedures set up a secure virtual
private network (VPN) between two systems that are separated by the Internet.
One common use of this technology is to protect traffic between home workers
and their corporate office.</para><informaltable frame="all" pgwide="1"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec0" colwidth="20.11*"/><colspec colname="colspec1" colwidth="43.37*"/><colspec colname="colspec2" colwidth="35.52*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Protect tunnel traffic in tunnel mode over IPv4</para>
</entry><entry><para>Protects traffic in tunnel mode between two
Solaris Express systems.</para><para>Also, protects traffic in tunnel mode between another platform and a  Solaris
Express system.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-23" remap="internal">How to Protect a VPN With an IPsec
Tunnel in Tunnel Mode Over IPv4</olink></para>
</entry>
</row><row><entry><para>Protect tunnel traffic in tunnel mode over IPv6</para>
</entry><entry><para>Protects traffic in tunnel mode between two Solaris systems that are
using the IPv6 protocol.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-15" remap="internal">How to Protect a VPN With an IPsec
Tunnel in Tunnel Mode Over IPv6</olink></para>
</entry>
</row><row><entry morerows="1" rowsep="1"><para>Protect tunnel traffic in transport mode over IPv4</para>
</entry><entry><para>Protects traffic in transport mode between two
Solaris Express systems.</para><para>Also, protects traffic in transport mode between a system that is running
an earlier version of the Solaris OS and a  Solaris
Express system.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-24" remap="internal">How to Protect a VPN With an IPsec
Tunnel in Transport Mode Over IPv4</olink></para>
</entry>
</row><row><entry><para>Protects traffic by using the older syntax. This is useful when you
are communicating with a system that is running an earlier version of the Solaris OS.
This method simplifies comparing the configuration files on the two systems.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-29" remap="internal">Example 20&ndash;11</olink></para>
</entry>
</row><row><entry><para>Protect tunnel traffic in transport mode over IPv6</para>
</entry><entry><para>Protects traffic in transport mode between two Solaris systems that
are using the IPv6 protocol.</para>
</entry><entry><para><olink targetptr="ipsec-mgtasks-26" remap="internal">How to Protect a VPN With an IPsec
Tunnel  in Transport Mode Over IPv6</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="ipsec-mgtasks-vpn-4"><title>Protecting
a VPN With IPsec</title><para>IPsec tunnels can protect a VPN. In Solaris Express, Developer Edition 2/07,
a tunnel can be in tunnel mode, or in transport mode. Tunnel mode is interoperable
with the implementation of IPsec by other vendors. Transport mode is interoperable
with earlier versions of the Solaris OS. For a discussion of tunnel modes, see <olink targetptr="ipsec-ov-13" remap="internal">Transport and Tunnel Modes in IPsec</olink>.</para><para>Tunnels in tunnel mode offer more fine-grained control of the
traffic. In tunnel mode, for an inner IP address, you can specify the particular
protection you want down to a single port. For possible IPsec policies, see
the examples that follow the tunnel diagram in <olink targetptr="ipsec-mgtasks-fig-tunnel-1" remap="internal">Figure 20&ndash;1</olink>.</para><figure id="ipsec-mgtasks-fig-tunnel-1"><title>IPsec Tunnel Diagram</title><mediaobject><imageobject><imagedata entityref="IPsecTunnel.eps" width="100"/>
</imageobject><textobject><simpara>Diagram shows a VPN that connects two LANs. Each LAN
has four subnets.</simpara>
</textobject>
</mediaobject>
</figure><para>The following examples assume that the tunnel is configured for all
subnets of the LANs:</para><screen>## Tunnel configuration ##
ifconfig ip.tun0 10.1.2.1 10.2.3.1 tsrc 192.168.1.10 tdst 192.168.2.10</screen><example id="ipsec-mgtasks-31"><title>Creating a Tunnel That All
Subnets Can Use</title><para>In this example, all traffic from the local LANs in Central in <olink targetptr="ipsec-mgtasks-fig-tunnel-1" remap="internal">Figure 20&ndash;1</olink>, can be tunneled
through Router 1 to Router 2, and then delivered to all local LANs of Overseas.
The traffic is encrypted with AES. </para><screen>## IPsec policy ##
{tunnel ip.tun0 negotiate tunnel} 
 ipsec {encr_algs aes encr_auth_algs md5 sa shared}</screen>
</example><example id="ipsec-mgtasks-33"><title>Creating a Tunnel That Connects Two
Subnets Only</title><para>In this example, only traffic between subnet <literal>10.1.2.0/24</literal> of
Central and subnet <literal>10.2.3.0/24</literal> of Overseas is tunneled
and encrypted. In the absence of other IPsec policies for Central, if Central
attempts to route any traffic for other LANs over this tunnel, the traffic
is dropped at Router 1.</para><screen>## IPsec policy ##
{tunnel ip.tun0 negotiate tunnel laddr 10.1.2.0/24 raddr 10.2.3.0/24} 
 ipsec {encr_algs aes encr_auth_algs md5 sa shared}</screen>
</example><example id="ipsec-mgtasks-35"><title>Creating a Tunnel for Only
Email Traffic Between Two Subnets</title><para>In this example, a tunnel is created for email traffic only. The traffic
is delivered from <literal>10.1.2.0/24</literal> of Central to the email server
on the <literal>10.2.3.0/24</literal> subnet of the Overseas LAN. The email
is encrypted with Blowfish. The policies apply to the remote and local email
ports. The <literal>rport</literal> policy protects mail that Central sends
to the remote email port of Overseas. The <literal>lport</literal> policy
protects mail Central receives from Overseas on local port 25.</para><screen>## IPsec policy for email from Central to Overseas ##
{tunnel ip.tun0 negotiate tunnel ulp tcp rport 25 
 laddr 10.1.2.0/24 raddr 10.2.3.0/24} 
 ipsec {encr_algs blowfish encr_auth_algs md5 sa shared}</screen><screen>## IPsec policy for email from Overseas to Central ##
{tunnel ip.tun0 negotiate tunnel ulp tcp lport 25 
 laddr 10.1.2.0/24 raddr 10.2.3.0/24} 
 ipsec {encr_algs blowfish encr_auth_algs md5 sa shared}</screen>
</example><example id="ipsec-mgtasks-37"><title>Creating a Tunnel for FTP
Traffic for All Subnets</title><para>In this example, IPsec policy protects the FTP ports in <olink targetptr="ipsec-mgtasks-fig-tunnel-1" remap="internal">Figure 20&ndash;1</olink> with 3DES
for all subnets of Central to all subnets of Overseas. This configuration
works for the active mode of FTP.</para><screen>## IPsec policy for outbound FTP from Central to Overseas ##
{tunnel ip.tun0 negotiate tunnel ulp tcp rport 21} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}
{tunnel ip.tun0 negotiate tunnel ulp tcp lport 20} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen><screen>## IPsec policy for inbound FTP from Central to Overseas ##
{tunnel ip.tun0 negotiate tunnel ulp tcp lport 21} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}
{tunnel ip.tun0 negotiate tunnel ulp tcp rport 20} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</example><itemizedlist><para>The IPv4 procedures in this section assume the following setup. For
a depiction of the network, see <olink targetptr="ipsec-mgtasks-fig-2" remap="internal">Figure 20&ndash;2</olink>.</para><listitem><para>Each system is using an IPv4 address space.</para><para>For
a similar example with IPv6 addresses, see <olink targetptr="ipsec-mgtasks-15" remap="internal">How
to Protect a VPN With an IPsec Tunnel in Tunnel Mode Over IPv6</olink>.</para>
</listitem><listitem><para>Each system has two interfaces. The <literal>hme0</literal> interface
connects to the Internet. In this example, Internet IP addresses begin with <literal>192.168</literal>. The <literal>hme1</literal> interface connects
to the company's local area network (LAN), its intranet. In this example,
intranet IP addresses begin with the number <literal>10</literal>.</para>
</listitem><listitem><para>Each system invokes AH protection with the MD5 algorithm.
The MD5 algorithm requires a 128-bit key.</para>
</listitem><listitem><para>Each system invokes ESP protection with the 3DES algorithm.
The 3DES algorithm requires a 192-bit key.</para>
</listitem><listitem><para>Each system can connect to a router that has direct access
to the Internet.</para>
</listitem><listitem><para>Each system uses shared security associations.</para>
</listitem>
</itemizedlist><para>For a description of VPNs, see <olink targetptr="ipsec-ov-15" remap="internal">Virtual
Private Networks and IPsec</olink>. <olink targetptr="ipsec-mgtasks-fig-2" remap="internal">Figure 20&ndash;2</olink> describes
the VPN that this procedure configures.</para><figure id="ipsec-mgtasks-fig-2"><title>Sample VPN Between Offices Separated
by the Internet</title><mediaobject><imageobject><imagedata entityref="examplevpn.eps" width="100"/>
</imageobject><textobject><simpara>Diagram shows details of VPN between Europe and California
offices.</simpara>
</textobject>
</mediaobject>
</figure><para>This procedure uses the following configuration parameters.</para><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="62.84*"/><colspec colname="colspec2" colwidth="17.79*"/><colspec colname="colspec1" colwidth="18.37*"/><thead><row rowsep="1"><entry><para>Parameter</para>
</entry><entry><para>Europe</para>
</entry><entry><para>California</para>
</entry>
</row>
</thead><tbody><row><entry><para>System name</para>
</entry><entry><para>enigma</para>
</entry><entry><para>partym</para>
</entry>
</row><row><entry><para>System intranet interface</para>
</entry><entry><para>hme1</para>
</entry><entry><para>hme1</para>
</entry>
</row><row><entry><para>System Internet interface</para>
</entry><entry><para>hme0</para>
</entry><entry><para>hme0</para>
</entry>
</row><row><entry><para>System intranet address, also the <replaceable>-point</replaceable> address
in <olink targetptr="ipsec-mgtask-iptun-1" remap="internal">Step&nbsp;5</olink></para>
</entry><entry><para>10.16.16.6</para>
</entry><entry><para>10.1.3.3</para>
</entry>
</row><row><entry><para>System Internet address, also the <replaceable>tsrc</replaceable> address
in <olink targetptr="ipsec-mgtask-iptun-1" remap="internal">Step&nbsp;5</olink></para>
</entry><entry><para>192.168.116.16</para>
</entry><entry><para>192.168.13.213</para>
</entry>
</row><row><entry><para>Name of Internet router</para>
</entry><entry><para>router-E</para>
</entry><entry><para>router-C</para>
</entry>
</row><row><entry><para>Address of Internet router</para>
</entry><entry><para>192.168.116.4</para>
</entry><entry><para>192.168.13.5</para>
</entry>
</row><row><entry><para>Tunnel name</para>
</entry><entry><para>ip.tun0</para>
</entry><entry><para>ip.tun0</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="ipsec-mgtasks-23"><title>How to Protect a VPN With an IPsec Tunnel
in Tunnel Mode Over IPv4</title><tasksummary><para>This procedure extends the procedure, <olink targetptr="ipsec-mgtasks-3" remap="internal">How
to Secure Traffic Between Two Systems With IPsec</olink>. In addition to connecting
two systems, you are connecting two intranets that connect to these two systems.
The systems in this procedure function as gateways.</para><note><para>You configure IPsec policy in the global zone.</para>
</note>
</tasksummary><procedure><step><para>On the system console on one of the systems, assume
the Primary Administrator role or become superuser.</para><para>The Primary
Administrator role includes the Primary Administrator profile. To create the
role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step id="ipsec-mgtasks-packetctrl-1"><para>Control the flow of packets before
configuring IPsec.</para><substeps><step><para>Ensure that IP forwarding and IP dynamic routing are disabled.</para><screen># <userinput>routeadm</userinput>
Configuration       Current         Current
       Option       Configuration  System State
--------------------------------------------------
IPv4 forwarding     disabled           disabled
   IPv4 routing     default (enabled)   enabled
&hellip;</screen><para>If forwarding and routing are enabled, you can disable them by typing:</para><screen># <userinput>routeadm -d ipv4-routing -d ipv4-forwarding</userinput>
# <userinput>routeadm -u</userinput></screen><para>Turning off IP forwarding prevents packets from being forwarded
from one network to another network through this system. For a description
of the <command>routeadm</command> command, see the <olink targetdoc="refman1m" targetptr="routeadm-1m" remap="external"><citerefentry><refentrytitle>routeadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</step><step><para>Turn on IP strict destination multihoming.</para><screen># <userinput>ndd -set /dev/ip ip_strict_dst_multihoming 1</userinput></screen><para>Turning on IP strict destination multihoming ensures that packets for
one of the system's destination addresses arrive at the correct destination
address.</para><para>When you turn off IP forwarding and turn on IP strict
destination multihoming, fewer packets flow all the way through the system.
 When strict destination multihoming is enabled, packets that arrive on a
particular interface must be addressed to one of the local IP addresses of
that interface. All other packets, even ones that are addressed to other local
addresses of the system, are dropped.</para>
</step><step><para>Disable most network services, and possibly all network services.</para><note><para>If your system was installed with the &ldquo;limited&rdquo; SMF
profile, then you can skip this step. Network services, with the exception
of Solaris Secure Shell, are disabled.</para>
</note><para>The disabling of network services prevents IP packets from doing
any harm to the system. For example, an SNMP daemon, a <command>telnet</command> connection,
or an <command>rlogin</command> connection could be exploited.</para><para>You
have two options.</para><itemizedlist><listitem><para>Run the &ldquo;limited&rdquo; SMF profile.</para><screen># <userinput>netservices limited</userinput></screen>
</listitem><listitem><para>Or, individually disable network services.</para><screen># <userinput>svcadm disable network/ftp:default</userinput>
# <userinput>svcadm disable network/finger:default</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
# <userinput>svcadm disable network/nfs/server:default</userinput>
# <userinput>svcadm disable network/rpc/rstat:default</userinput>
# <userinput>svcadm disable network/smtp:sendmail</userinput>
# <userinput>svcadm disable network/telnet:default</userinput>
# <userinput>svcs | grep network</userinput>
online         Aug_02   svc:/network/loopback:default
&hellip;
online         Aug_09   svc:/network/ssh:default
&hellip;</screen>
</listitem>
</itemizedlist>
</step>
</substeps>
</step><step id="ipsec-mgtasks-sa-1"><para>On each system, add a pair of SAs between
the two systems.</para><itemizedlist><para>Choose one of the following options:</para><listitem><para>Configure IKE to manage the keys for the SAs. Use one of the
procedures in <olink targetptr="ike-task-7" remap="internal">Configuring IKE (Task Map)</olink> to
configure IKE for the VPN.</para>
</listitem><listitem><para>If you have an overriding reason to manually manage the keys,
see <olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security
Associations</olink>.</para>
</listitem>
</itemizedlist>
</step><step id="ipsec-mgtasks-nobypass-1"><para>On each system, add IPsec policy.</para><para>Edit the <filename>/etc/inet/ipsecinit.conf</filename> file to add the
IPsec policy for the VPN. To strengthen the policy, see <olink targetptr="ipsec-mgtasks-17" remap="internal">Example 20&ndash;7</olink>. For additional examples,
see <olink targetptr="ipsec-mgtasks-31" remap="internal">Example 20&ndash;3</olink> and following.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following entry into the <filename>ipsecinit.conf</filename> file:</para><screen># LAN traffic to and from this host can bypass IPsec.
{laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate tunnel} 
 ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step><step><para>On the <literal>partym</literal> system, type the following
entry into the <filename>ipsecinit.conf</filename> file:</para><screen># LAN traffic to and from this host can bypass IPsec.
{laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate tunnel} 
 ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step>
</substeps>
</step><step id="ipsec-mgtask-iptun-1"><para>On each system, configure the tunnel, <literal>ip.tun0</literal>.</para><para>Use the following <command>ifconfig</command> commands to create the
point-to-point interface:</para><screen># ifconfig ip.tun0 plumb

# ifconfig ip.tun0 <replaceable>system1-point</replaceable> <replaceable>system2-point</replaceable> \
tsrc <replaceable>system1-taddr</replaceable> tdst <replaceable>system2-taddr</replaceable></screen><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following commands:</para><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.16.16.6 10.1.3.3 \</userinput>
<userinput>tsrc 192.168.116.16 tdst 192.168.13.213</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, type the following
commands:</para><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.1.3.3 10.16.16.6  \</userinput>
<userinput>tsrc 192.168.13.213 tdst 192.168.116.16</userinput></screen>
</step>
</substeps>
</step><step id="ipsec-mgtasks-transp-1"><para>Protect the tunnel with the IPsec
policy that you created.</para><screen># <userinput>ipsecconf</userinput></screen>
</step><step><para>Bring up the router for the tunnel.</para><screen># <userinput>ifconfig ip.tun0 router up</userinput></screen>
</step><step><para>On each system, turn on IP forwarding for the <literal>hme1</literal> interface.</para><screen># <userinput>ifconfig hme1 router</userinput></screen><para>IP forwarding means that packets that arrive from somewhere else can
be forwarded. IP forwarding also means that packets that leave this interface
might have originated somewhere else. To successfully forward a packet, both
the receiving interface and the transmitting interface must have IP forwarding
turned on.</para><para>Because the <literal>hme1</literal> interface is <emphasis>inside</emphasis> the intranet, IP forwarding must be turned on for <literal>hme1</literal>. Because <literal>ip.tun0</literal> connects the two systems through
the Internet, IP forwarding must be turned on for <literal>ip.tun0</literal>.</para><para>The <literal>hme0</literal> interface has its IP forwarding turned off
to prevent an <emphasis>outside</emphasis> adversary from injecting packets
into the protected intranet. The <emphasis>outside</emphasis> refers to the
Internet.</para>
</step><step><para>On each system, ensure that routing protocols do not advertise
the default route within the intranet.</para><screen># <userinput>ifconfig hme0 private</userinput></screen><para>Even if <literal>hme0</literal> has IP forwarding turned off, a routing
protocol implementation might still advertise the interface. For example,
the <command>in.routed</command> protocol might still advertise that <literal>hme0</literal> is available to  forward packets to its peers inside the intranet.
By setting the interface's <emphasis>private</emphasis> flag, these advertisements
are prevented.</para>
</step><step><para>Manually, add a default route over <literal>hme0</literal>.</para><para>The default route should be a router with direct access to the Internet.</para><screen># route add default <replaceable>router-on-hme0-subnet</replaceable></screen><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following route:</para><screen># <userinput>route add default 192.168.116.4</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, add the following
route:</para><screen># <userinput>route add default 192.168.13.5</userinput></screen><para>Even though the <literal>hme0</literal> interface is not part of the
intranet, <literal>hme0</literal> does need to reach across the Internet to
its peer system. To find its peer, <literal>hme0</literal> needs information
about Internet routing. The VPN system appears to be a host, rather than a
router, to the rest of the Internet. Therefore, you can use a default router
or run the router discovery protocol to find a peer system. For more information,
see the <olink targetdoc="refman1m" targetptr="route-1m" remap="external"><citerefentry><refentrytitle>route</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman1m" targetptr="in.routed-1m" remap="external"><citerefentry><refentrytitle>in.routed</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para>
</step>
</substeps>
</step><step><para>Ensure that the VPN starts after a reboot by adding
an entry to the <filename>/etc/hostname.ip.tun0</filename> file.</para><screen><replaceable>system1-point system2-point</replaceable> tsrc <replaceable>system1-taddr</replaceable> tdst <replaceable>system2-taddr</replaceable> router up</screen><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following entry to the <filename>hostname.ip.tun0</filename> file:</para><screen>10.16.16.6 10.1.3.3 tsrc 192.168.116.16 tdst 192.168.13.213 router up</screen>
</step><step><para>On the <literal>partym</literal> system, add the following
entry to the <filename>hostname.ip.tun0</filename> file:</para><screen>10.1.3.3 10.16.16.6 tsrc 192.168.13.213 tdst 192.168.116.16 router up</screen>
</step>
</substeps>
</step><step><para>On each system, configure the interface files to pass
the correct parameters to the routing daemon.</para><substeps><step><para>On the enigma system, modify the <filename>/etc/hostname.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat enigma hostname.hme0</userinput>
10.16.16.6 private</screen><screen># <userinput>cat enigma hostname.hme1</userinput>
192.168.116.16 router</screen>
</step><step><para>On the partym system, modify the <filename>/etc/hostname.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat partym hostname.hme0</userinput>
10.1.3.3 private</screen><screen># <userinput>cat partym hostname.hme1</userinput>
192.168.13.213 router</screen>
</step>
</substeps>
</step><step><para>On each system, run a routing protocol.</para><para>You might need to configure the routing protocol before enabling
routing. For more information, see <olink targetptr="ipref-13" remap="internal">Routing Protocols
in the Solaris OS</olink>. For a procedure, see <olink targetptr="ipconfig-118" remap="internal">How
to Configure an IPv4 Router</olink>.</para><screen># <userinput>routeadm -e ipv4-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step>
</procedure><example id="ipsec-mgtasks-17"><title>Requiring IPsec Policy on All Systems on a LAN</title><para>In this example, the administrator comments out the <literal>bypass</literal> policy
that was configured in <olink targetptr="ipsec-mgtasks-nobypass-1" remap="internal">Step&nbsp;4</olink>,
thereby strengthening the protection. With this policy configuration, each
system on the LAN must activate IPsec to communicate with the router.</para><screen># LAN traffic must implement IPsec.
# {laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate tunnel} ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</example><example id="ipsecmgtasks-25"><title>Using IPsec to Protect Telnet Traffic Differently From SMTP Traffic</title><para>The first rule protects <command>telnet</command> traffic on port 23
with Blowfish and Sha-1. The second rule protects SMTP traffic on port 25
with AES and MD5.</para><screen>{laddr 10.1.3.3 ulp tcp dport 23 dir both} 
  ipsec {encr_algs blowfish encr_auth_algs sha1 sa unique}
{laddr 10.1.3.3 ulp tcp dport 25 dir both} 
 ipsec {encr_algs aes encr_auth_algs md5 sa unique}</screen>
</example><example id="ipsecmgtasks-27"><title>Using an IPsec Tunnel in Tunnel Mode to Protect a Subnet Differently
From Other Network Traffic</title><para>The following tunnel configuration protects all traffic from subnet <literal>10.1.3.0/24</literal> across the tunnel.</para><screen>{tunnel ip.tun0 negotiate tunnel laddr 10.1.3.0/24} 
  ipsec {encr_algs aes encr_auth_algs md5 sa shared}</screen><para>The following tunnel configurations protect traffic from subnet <literal>10.1.3.0/24</literal> to different subnets across the tunnel. Subnets that begin with <literal>10.2.</literal><replaceable>x.x</replaceable> are across the tunnel.</para><screen>{tunnel ip.tun0 negotiate tunnel laddr 10.1.3.0/24 raddr 10.2.1.0/24} 
  ipsec {encr_algs blowfish encr_auth_algs md5 sa shared}</screen><screen>{tunnel ip.tun0 negotiate tunnel laddr 10.1.3.0/24 raddr 10.2.2.0/24} 
  ipsec {encr_algs blowfish encr_auth_algs sha1 sa shared}</screen><screen>{tunnel ip.tun0 negotiate tunnel laddr 10.1.3.0/24 raddr 10.2.3.0/24} 
  ipsec {encr_algs aes encr_auth_algs sha1 sa shared}</screen>
</example>
</task><task id="ipsec-mgtasks-15"><title>How to Protect a VPN With an IPsec Tunnel
in Tunnel Mode Over IPv6</title><tasksummary><para>To set up a VPN on an IPv6 network, you follow the same steps as for
an IPv4 network. However, the syntax of the commands is slightly different.
For a fuller description of the reasons for running particular commands, see <olink targetptr="ipsec-mgtasks-23" remap="internal">How to Protect a VPN With an IPsec Tunnel in
Tunnel Mode Over IPv4</olink>.</para><para>This procedure uses the following configuration parameters.</para><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="39.57*"/><colspec colname="colspec2" colwidth="29.15*"/><colspec colname="colspec1" colwidth="30.28*"/><thead><row rowsep="1"><entry><para>Parameter</para>
</entry><entry><para>Europe</para>
</entry><entry><para>California</para>
</entry>
</row>
</thead><tbody><row><entry><para>System name</para>
</entry><entry><para>enigma</para>
</entry><entry><para>partym</para>
</entry>
</row><row><entry><para>System intranet interface</para>
</entry><entry><para>hme1</para>
</entry><entry><para>hme1</para>
</entry>
</row><row><entry><para>System Internet interface</para>
</entry><entry><para>hme0</para>
</entry><entry><para>hme0</para>
</entry>
</row><row><entry><para>System intranet address</para>
</entry><entry><para>6000:6666::aaaa:1116</para>
</entry><entry><para>6000:3333::eeee:1113</para>
</entry>
</row><row><entry><para>System Internet address</para>
</entry><entry><para>2001::aaaa:6666:6666</para>
</entry><entry><para>2001::eeee:3333:3333</para>
</entry>
</row><row><entry><para>Name of Internet router</para>
</entry><entry><para>router-E</para>
</entry><entry><para>router-C</para>
</entry>
</row><row><entry><para>Address of Internet router</para>
</entry><entry><para>2001::aaaa:0:4</para>
</entry><entry><para>2001::eeee:0:1</para>
</entry>
</row><row><entry><para>Tunnel name</para>
</entry><entry><para>ip6.tun0</para>
</entry><entry><para>ip6.tun0</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</tasksummary><procedure><step><para>On the system console on one of the systems, assume
the Primary Administrator role or become superuser.</para><para>The Primary
Administrator role includes the Primary Administrator profile. To create the
role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step><para>Control the flow of packets before configuring IPsec.</para><para>For
the effects of these commands, see <olink targetptr="ipsec-mgtasks-packetctrl-1" remap="internal">Step&nbsp;2</olink> in <olink targetptr="ipsec-mgtasks-23" remap="internal">How to Protect
a VPN With an IPsec Tunnel in Tunnel Mode Over IPv4</olink>.</para><substeps><step><para>Ensure that IP forwarding and IP dynamic routing are disabled.</para><screen># <userinput>routeadm</userinput>
Configuration       Current         Current
       Option       Configuration  System State
--------------------------------------------------
&hellip;
IPv6 forwarding     disabled          disabled
   IPv6 routing     disabled          disabled</screen><para>If forwarding and routing are enabled, you can disable them by typing:</para><screen># <userinput>routeadm -d ipv6-forwarding -d ipv6-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step><step><para>Turn on IP strict destination multihoming.</para><screen># <userinput>ndd -set /dev/ip ip6_strict_dst_multihoming 1</userinput></screen>
</step><step><para>Disable most network services, and possibly all network services.</para><note><para>If your system was installed with the &ldquo;limited&rdquo; SMF
profile, then you can skip this step. Network services, with the exception
of Solaris Secure Shell, are disabled.</para>
</note><para>The disabling of network services prevents IP packets from doing
any harm to the system. For example, an SNMP daemon, a <command>telnet</command> connection,
or an <command>rlogin</command> connection could be exploited.</para><para>You
have two options.</para><itemizedlist><listitem><para>Run the &ldquo;limited&rdquo; SMF profile.</para><screen># <userinput>netservices limited</userinput></screen>
</listitem><listitem><para>Or, individually disable network services.</para><screen># <userinput>svcadm disable network/ftp:default</userinput>
# <userinput>svcadm disable network/finger:default</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
# <userinput>svcadm disable network/nfs/server:default</userinput>
# <userinput>svcadm disable network/rpc/rstat:default</userinput>
# <userinput>svcadm disable network/smtp:sendmail</userinput>
# <userinput>svcadm disable network/telnet:default</userinput>
# <userinput>svcs | grep network</userinput>
online         Aug_02   svc:/network/loopback:default
&hellip;
online         Aug_09   svc:/network/ssh:default
&hellip;</screen>
</listitem>
</itemizedlist>
</step>
</substeps>
</step><step><para>On each system, add a pair of SAs between the two systems.</para><itemizedlist><para>Choose one of the following options.</para><listitem><para>Configure IKE to manage the keys for the SAs. Use one of the
procedures in <olink targetptr="ike-task-7" remap="internal">Configuring IKE (Task Map)</olink> to
configure IKE for the VPN.</para>
</listitem><listitem><para>If you have an overriding reason to manually manage the keys,
see <olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security
Associations</olink>.</para>
</listitem>
</itemizedlist>
</step><step><para>On each system, add IPsec policy.</para><para>Edit the <filename>/etc/inet/ipsecinit.conf</filename> file to add the IPsec policy for the VPN.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following entry into the <filename>ipsecinit.conf</filename> file:</para><screen># IPv6 Neighbor Discovery messages bypass IPsec.
{ulp ipv6-icmp type 133-137 dir both} pass {}

# LAN traffic to and from this host can bypass IPsec.
{laddr 6000:6666::aaaa:1116 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip6.tun0 negotiate tunnel} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step><step><para>On the <literal>partym</literal> system, type the following
entry into the <filename>ipsecinit.conf</filename> file:</para><screen># IPv6 Neighbor Discovery messages bypass IPsec.
{ulp ipv6-icmp type 133-137 dir both} pass {}

# LAN traffic to and from this host can bypass IPsec.
{laddr 6000:3333::eeee:1113 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip6.tun0 negotiate tunnel} 
  ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step>
</substeps>
</step><step id="ipsec-mgtask-iptun-2"><para>On each system, configure a secure tunnel, <literal>ip6.tun0</literal>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following commands:</para><screen># <userinput>ifconfig ip6.tun0 inet6 plumb</userinput>

# <userinput>ifconfig ip6.tun0 inet6 6000:6666::aaaa:1116 6000:3333::eeee:1113 \</userinput>
<userinput>tsrc 2001::aaaa:6666:6666   tdst 2001::eeee:3333:3333</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, type the following
commands:</para><screen># <userinput>ifconfig ip6.tun0 inet6 plumb</userinput>

# <userinput>ifconfig ip6.tun0 inet6 6000:3333::eeee:1113 6000:6666::aaaa:1116 \</userinput>
<userinput>tsrc 2001::eeee:3333:3333   tdst 2001::aaaa:6666:6666</userinput></screen>
</step>
</substeps>
</step><step><para>Protect the tunnel with the IPsec policy that you created.</para><screen># <userinput>ipsecconf</userinput></screen>
</step><step><para>Bring up the router for the tunnel.</para><screen># <userinput>ifconfig ip6.tun0 router up</userinput></screen>
</step><step><para>On each system, turn on IP forwarding for the <literal>hme1</literal> interface. </para><screen># <userinput>ifconfig hme1 router</userinput></screen>
</step><step><para>On each system, ensure that routing protocols do not advertise
the default route within the intranet.</para><screen># <userinput>ifconfig hme0 private</userinput></screen>
</step><step><para>Manually, add a default route over <literal>hme0</literal>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following route:</para><screen># <userinput>route add -inet6 default 2001::aaaa:0:4</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, add the following
route:</para><screen># <userinput>route add -inet6 default 2001::eeee:0:1</userinput></screen>
</step>
</substeps>
</step><step><para>Ensure that the VPN starts after a reboot by adding an entry to
the <filename>/etc/hostname6.ip6.tun0</filename> file. </para><para>The entry
replicates the parameters that were passed to the <command>ifconfig</command> command
in <olink targetptr="ipsec-mgtask-iptun-2" remap="internal">Step&nbsp;5</olink>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following entry to the <filename>hostname6.ip6.tun0</filename> file:</para><screen>6000:6666::aaaa:1116 6000:3333::eeee:1113 \
tsrc 2001::aaaa:6666:6666  tdst 2001::eeee:3333:3333 router up</screen>
</step><step><para>On the <literal>partym</literal> system, add the following
entry to the <filename>hostname6.ip6.tun0</filename> file:</para><screen>6000:3333::eeee:1113 6000:6666::aaaa:1116 \
tsrc 2001::eeee:3333:3333   tdst 2001::aaaa:6666:6666  router up</screen>
</step>
</substeps>
</step><step><para>On each system, configure the interface files to pass the correct
parameters to the routing daemon.</para><substeps><step><para>On the enigma system, modify the <filename>/etc/hostname6.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat enigma hostname6.hme0</userinput>
6000:6666::aaaa:1116 inet6 private</screen><screen>#  <userinput>cat enigma hostname6.hme1</userinput>
2001::aaaa:6666:6666 inet6 router</screen>
</step><step><para>On the partym system, modify the <filename>/etc/hostname6.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat partym hostname6.hme0</userinput>
6000:3333::eeee:1113 inet6 private</screen><screen># <userinput>cat partym hostname6.hme1</userinput>
2001::eeee:3333:3333 inet6 router</screen>
</step>
</substeps>
</step><step><para>On each system, run a routing protocol.</para><screen># <userinput>routeadm -e ipv6-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step>
</procedure>
</task><task id="ipsec-mgtasks-24"><title>How to Protect a VPN With an IPsec Tunnel
in Transport Mode Over IPv4</title><tasksummary><para>This procedure extends the procedure, <olink targetptr="ipsec-mgtasks-3" remap="internal">How
to Secure Traffic Between Two Systems With IPsec</olink>. In addition to connecting
two systems, you are connecting two intranets that connect to these two systems.
The systems in this procedure function as gateways.</para><para>This procedure assumes the same setup as in <olink targetptr="ipsec-mgtasks-15" remap="internal">How to Protect a VPN With an IPsec Tunnel in
Tunnel Mode Over IPv6</olink>.</para>
</tasksummary><procedure><step><para>On the system console on one of the systems, assume
the Primary Administrator role or become superuser.</para><para>The Primary
Administrator role includes the Primary Administrator profile. To create the
role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step><para>Control the flow of packets before configuring IPsec.</para><substeps><step><para>Ensure that IP forwarding and IP dynamic routing are disabled.</para><screen># <userinput>routeadm</userinput>
Configuration       Current         Current
       Option       Configuration  System State
--------------------------------------------------
IPv4 forwarding     disabled           disabled
   IPv4 routing     default (enabled)   enabled
&hellip;</screen><para>If forwarding and routing are enabled, you can disable them by typing:</para><screen># <userinput>routeadm -d ipv4-routing -d ipv4-forwarding</userinput>
# <userinput>routeadm -u</userinput></screen><para>Turning off IP forwarding prevents packets from being forwarded
from one network to another network through this system. For a description
of the <command>routeadm</command> command, see the <olink targetdoc="refman1m" targetptr="routeadm-1m" remap="external"><citerefentry><refentrytitle>routeadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page.</para>
</step><step><para>Turn on IP strict destination multihoming.</para><screen># <userinput>ndd -set /dev/ip ip_strict_dst_multihoming 1</userinput></screen><para>Turning on IP strict destination multihoming ensures that packets for
one of the system's destination addresses arrive at the correct destination
address.</para><para>When you turn off IP forwarding and turn on IP strict
destination multihoming, fewer packets flow all the way through the system.
 When strict destination multihoming is enabled, packets that arrive on a
particular interface must be addressed to one of the local IP addresses of
that interface. All other packets, even ones that are addressed to other local
addresses of the system, are dropped.</para>
</step><step><para>Disable most network services, and possibly all network services.</para><note><para>If your system was installed with the &ldquo;limited&rdquo; SMF
profile, then you can skip this step. Network services, with the exception
of Solaris Secure Shell, are disabled.</para>
</note><para>The disabling of network services prevents IP packets from doing
any harm to the system. For example, an SNMP daemon, a <command>telnet</command> connection,
or an <command>rlogin</command> connection could be exploited.</para><para>You
have two options.</para><itemizedlist><listitem><para>Run the &ldquo;limited&rdquo; SMF profile.</para><screen># <userinput>netservices limited</userinput></screen>
</listitem><listitem><para>Or, individually disable network services.</para><screen># <userinput>svcadm disable network/ftp:default</userinput>
# <userinput>svcadm disable network/finger:default</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
# <userinput>svcadm disable network/nfs/server:default</userinput>
# <userinput>svcadm disable network/rpc/rstat:default</userinput>
# <userinput>svcadm disable network/smtp:sendmail</userinput>
# <userinput>svcadm disable network/telnet:default</userinput>
# <userinput>svcs | grep network</userinput>
online         Aug_02   svc:/network/loopback:default
&hellip;
online         Aug_09   svc:/network/ssh:default
&hellip;</screen>
</listitem>
</itemizedlist>
</step>
</substeps>
</step><step><para>On each system, add a pair of SAs between the two systems.</para><itemizedlist><para>Choose one of the following options:</para><listitem><para>Configure IKE to manage the keys for the SAs. Use one of the
procedures in <olink targetptr="ike-task-7" remap="internal">Configuring IKE (Task Map)</olink> to
configure IKE for the VPN.</para>
</listitem><listitem><para>If you have an overriding reason to manually manage the keys,
see <olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security
Associations</olink>.</para>
</listitem>
</itemizedlist>
</step><step id="ipsec-mgtasks-deprec-syntax-1"><para>On each system, add IPsec policy.</para><para>Edit the <filename>/etc/inet/ipsecinit.conf</filename> file to add the
IPsec policy for the VPN. To strengthen the policy, see <olink targetptr="ipsec-mgtasks-27" remap="internal">Example 20&ndash;10</olink>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following entry into the <filename>ipsecinit.conf</filename> file:</para><screen># LAN traffic to and from this host can bypass IPsec.
{laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate transport} 
 ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step><step><para>On the <literal>partym</literal> system, type the following
entry into the <filename>ipsecinit.conf</filename> file:</para><screen># LAN traffic to and from this host can bypass IPsec.
{laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate transport} 
 ipsec {encr_algs 3des encr_auth_algs md5 sa shared}</screen>
</step>
</substeps>
</step><step id="ipsec-mgtasks-deprec-syntax-2"><para>On each system, configure the
tunnel, <literal>ip.tun0</literal>.</para><para>Use the following <command>ifconfig</command> commands to create the point-to-point interface:</para><screen># ifconfig ip.tun0 plumb

# ifconfig ip.tun0 <replaceable>system1-point</replaceable> <replaceable>system2-point</replaceable> \
tsrc <replaceable>system1-taddr</replaceable> tdst <replaceable>system2-taddr</replaceable></screen><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following commands:</para><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.16.16.6 10.1.3.3 \</userinput>
<userinput>tsrc 192.168.116.16 tdst 192.168.13.213</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, type the following
commands:</para><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.1.3.3 10.16.16.6  \</userinput>
<userinput>tsrc 192.168.13.213 tdst 192.168.116.16</userinput></screen>
</step>
</substeps>
</step><step id="ipsec-mgtasks-deprec-syntax-3"><para>Protect the tunnel with the
IPsec policy that you created.</para><screen># <userinput>ipsecconf</userinput></screen>
</step><step id="ipsec-mgtasks-deprec-syntax-4"><para>Bring up the router for the
tunnel.</para><screen># <userinput>ifconfig ip.tun0 router up</userinput></screen>
</step><step><para>On each system, turn on IP forwarding for the <literal>hme1</literal> interface.</para><screen># <userinput>ifconfig hme1 router</userinput></screen><para>IP forwarding means that packets that arrive from somewhere else can
be forwarded. IP forwarding also means that packets that leave this interface
might have originated somewhere else. To successfully forward a packet, both
the receiving interface and the transmitting interface must have IP forwarding
turned on.</para><para>Because the <literal>hme1</literal> interface is <emphasis>inside</emphasis> the intranet, IP forwarding must be turned on for <literal>hme1</literal>. Because <literal>ip.tun0</literal> connects the two systems through
the Internet, IP forwarding must be turned on for <literal>ip.tun0</literal>.</para><para>The <literal>hme0</literal> interface has its IP forwarding turned off
to prevent an <emphasis>outside</emphasis> adversary from injecting packets
into the protected intranet. The <emphasis>outside</emphasis> refers to the
Internet.</para>
</step><step><para>On each system, ensure that routing protocols do not advertise
the default route within the intranet.</para><screen># <userinput>ifconfig hme0 private</userinput></screen><para>Even if <literal>hme0</literal> has IP forwarding turned off, a routing
protocol implementation might still advertise the interface. For example,
the <command>in.routed</command> protocol might still advertise that <literal>hme0</literal> is available to  forward packets to its peers inside the intranet.
By setting the interface's <emphasis>private</emphasis> flag, these advertisements
are prevented.</para>
</step><step><para>Manually, add a default route over <literal>hme0</literal>.</para><para>The default route should be a router with direct access to the Internet.</para><screen># route add default <replaceable>router-on-hme0-subnet</replaceable></screen><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following route:</para><screen># <userinput>route add default 192.168.116.4</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, add the following
route:</para><screen># <userinput>route add default 192.168.13.5</userinput></screen><para>Even though the <literal>hme0</literal> interface is not part of the
intranet, <literal>hme0</literal> does need to reach across the Internet to
its peer system. To find its peer, <literal>hme0</literal> needs information
about Internet routing. The VPN system appears to be a host, rather than a
router, to the rest of the Internet. Therefore, you can use a default router
or run the router discovery protocol to find a peer system. For more information,
see the <olink targetdoc="refman1m" targetptr="route-1m" remap="external"><citerefentry><refentrytitle>route</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> and <olink targetdoc="refman1m" targetptr="in.routed-1m" remap="external"><citerefentry><refentrytitle>in.routed</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man pages.</para>
</step>
</substeps>
</step><step id="ipsec-mgtasks-deprec-syntax-5"><para>Ensure that the VPN
starts after a reboot by adding an entry to the <filename>/etc/hostname.ip.tun0</filename> file.</para><screen><replaceable>system1-point system2-point</replaceable> tsrc <replaceable>system1-taddr</replaceable> \
tdst <replaceable>system2-taddr</replaceable> encr_algs 3des encr_auth_algs md5 router up</screen><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following entry to the <filename>hostname.ip.tun0</filename> file:</para><screen>10.16.16.6 10.1.3.3 tsrc 192.168.116.16 \
tdst 192.168.13.213 router up</screen>
</step><step><para>On the <literal>partym</literal> system, add the following
entry to the <filename>hostname.ip.tun0</filename> file:</para><screen>10.1.3.3 10.16.16.6 tsrc 192.168.13.213 \
tdst 192.168.116.16 router up</screen>
</step>
</substeps>
</step><step><para>On each system, configure the interface files to pass the correct
parameters to the routing daemon.</para><substeps><step><para>On the enigma system, modify the <filename>/etc/hostname.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat enigma hostname.hme0</userinput>
10.16.16.6 private</screen><screen># <userinput>cat enigma hostname.hme1</userinput>
192.168.116.16 router</screen>
</step><step><para>On the partym system, modify the <filename>/etc/hostname.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat partym hostname.hme0</userinput>
10.1.3.3 private</screen><screen># <userinput>cat partym hostname.hme1</userinput>
192.168.13.213 router</screen>
</step>
</substeps>
</step><step><para>On each system, run a routing protocol.</para><para>You might need to configure the routing protocol before enabling
routing. For more information, see <olink targetptr="ipref-13" remap="internal">Routing Protocols
in the Solaris OS</olink>. For a procedure, see <olink targetptr="ipconfig-118" remap="internal">How
to Configure an IPv4 Router</olink>.</para><screen># <userinput>routeadm -e ipv4-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step>
</procedure><example id="ipsec-mgtasks-27"><title>Requiring IPsec Policy on All Systems in Transport Mode</title><para>In this example, the administrator comments out the <literal>bypass</literal> policy
that was configured in <olink targetptr="ipsec-mgtasks-nobypass-1" remap="internal">Step&nbsp;4</olink>,
thereby strengthening the protection. With this policy configuration, each
system on the LAN must activate IPsec to communicate with the router.</para><screen># LAN traffic must implement IPsec.
# {laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip.tun0 negotiate transport} ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</example><example id="ipsec-mgtasks-29"><title>Using Deprecated Syntax to Configure an IPsec Tunnel in Transport Mode</title><para>In this example, administrator is connecting a  Solaris
Express system with a system that is running the Solaris 10 release. Therefore,
the administrator uses Solaris 10 syntax in the configuration file, and includes
the IPsec algorithms in the <command>ifconfig</command> command.</para><orderedlist><listitem><para>In <olink targetptr="ipsec-mgtasks-deprec-syntax-1" remap="internal">Step&nbsp;4</olink>,
the syntax is the following:</para><screen># LAN traffic to and from this address can bypass IPsec.
{laddr 10.1.3.3 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{} ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</listitem><listitem><para>For <olink targetptr="ipsec-mgtasks-deprec-syntax-2" remap="internal">Step&nbsp;5</olink> to <olink targetptr="ipsec-mgtasks-deprec-syntax-4" remap="internal">Step&nbsp;7</olink>, the syntax
is the following:</para><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.16.16.6 10.1.3.3 \</userinput>
<userinput>tsrc 192.168.116.16 tdst 192.168.13.213 \</userinput>
<userinput>encr_algs 3des encr_auth_algs md5</userinput>

# <userinput>ifconfig ip.tun0 router up</userinput></screen><screen># <userinput>ifconfig ip.tun0 plumb</userinput>

# <userinput>ifconfig ip.tun0 10.16.16.6 10.1.3.3 \</userinput>
<userinput>tsrc 192.168.116.16 tdst 192.168.13.213 \</userinput>
<userinput>encr_algs 3des encr_auth_algs md5</userinput></screen><para>The IPsec policy that is passed to the <command>ifconfig</command> commands
must be the same as the IPsec policy in the <filename>ipsecinit.conf</filename> file.
Upon reboot, each system reads the <filename>ipsecinit.conf</filename> file
for its policy.</para>
</listitem><listitem><para>In <olink targetptr="ipsec-mgtasks-deprec-syntax-5" remap="internal">Step&nbsp;11</olink>,
the syntax is the following:</para><screen>10.16.16.6 10.1.3.3 tsrc 192.168.116.16 \
tdst 192.168.13.213 encr_algs 3des encr_auth_algs md5 router up</screen>
</listitem>
</orderedlist>
</example>
</task><task id="ipsec-mgtasks-26"><title>How to Protect a VPN With an IPsec Tunnel
 in Transport Mode Over IPv6</title><tasksummary><para>To set up a VPN on an IPv6 network, you follow the same steps as for
an IPv4 network. However, the syntax of the commands is slightly different.
For a fuller description of the reasons for running particular commands, see <olink targetptr="ipsec-mgtasks-23" remap="internal">How to Protect a VPN With an IPsec Tunnel in
Tunnel Mode Over IPv4</olink>.</para><para>This procedure uses the following configuration parameters.</para><informaltable frame="topbot"><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="39.57*"/><colspec colname="colspec2" colwidth="29.15*"/><colspec colname="colspec1" colwidth="30.28*"/><thead><row rowsep="1"><entry><para>Parameter</para>
</entry><entry><para>Europe</para>
</entry><entry><para>California</para>
</entry>
</row>
</thead><tbody><row><entry><para>System name</para>
</entry><entry><para>enigma</para>
</entry><entry><para>partym</para>
</entry>
</row><row><entry><para>System intranet interface</para>
</entry><entry><para>hme1</para>
</entry><entry><para>hme1</para>
</entry>
</row><row><entry><para>System Internet interface</para>
</entry><entry><para>hme0</para>
</entry><entry><para>hme0</para>
</entry>
</row><row><entry><para>System intranet address</para>
</entry><entry><para>6000:6666::aaaa:1116</para>
</entry><entry><para>6000:3333::eeee:1113</para>
</entry>
</row><row><entry><para>System Internet address</para>
</entry><entry><para>2001::aaaa:6666:6666</para>
</entry><entry><para>2001::eeee:3333:3333</para>
</entry>
</row><row><entry><para>Name of Internet router</para>
</entry><entry><para>router-E</para>
</entry><entry><para>router-C</para>
</entry>
</row><row><entry><para>Address of Internet router</para>
</entry><entry><para>2001::aaaa:0:4</para>
</entry><entry><para>2001::eeee:0:1</para>
</entry>
</row><row><entry><para>Tunnel name</para>
</entry><entry><para>ip6.tun0</para>
</entry><entry><para>ip6.tun0</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</tasksummary><procedure><step><para>On the system console on one of the systems, assume
the Primary Administrator role or become superuser.</para><para>The Primary
Administrator role includes the Primary Administrator profile. To create the
role and assign the role to a user, see <olink targetdoc="sysadv1" targetptr="smcover-1" remap="external">Chapter 2, <citetitle remap="chapter">Working With the Solaris Management Console (Tasks),</citetitle> in <citetitle remap="book">System Administration Guide: Basic Administration</citetitle></olink>.</para><note><para>Logging in remotely exposes security-critical traffic to eavesdropping.
Even if you somehow protect the remote login, the security of the system is
reduced to the security of the remote login session.</para>
</note>
</step><step><para>Control the flow of packets before configuring IPsec.</para><para>For
the effects of these commands, see <olink targetptr="ipsec-mgtasks-packetctrl-1" remap="internal">Step&nbsp;2</olink> in <olink targetptr="ipsec-mgtasks-23" remap="internal">How to Protect
a VPN With an IPsec Tunnel in Tunnel Mode Over IPv4</olink>.</para><substeps><step><para>Ensure that IP forwarding and IP dynamic routing are disabled.</para><screen># <userinput>routeadm</userinput>
Configuration       Current         Current
       Option       Configuration  System State
--------------------------------------------------
&hellip;
IPv6 forwarding     disabled          disabled
   IPv6 routing     disabled          disabled</screen><para>If forwarding and routing are enabled, you can disable them by typing:</para><screen># <userinput>routeadm -d ipv6-forwarding -d ipv6-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step><step><para>Turn on IP strict destination multihoming.</para><screen># <userinput>ndd -set /dev/ip ip6_strict_dst_multihoming 1</userinput></screen>
</step><step><para>Disable most network services, and possibly all network services.</para><note><para>If your system was installed with the &ldquo;limited&rdquo; SMF
profile, then you can skip this step. Network services, with the exception
of Solaris Secure Shell, are disabled.</para>
</note><para>The disabling of network services prevents IP packets from doing
any harm to the system. For example, an SNMP daemon, a <command>telnet</command> connection,
or an <command>rlogin</command> connection could be exploited.</para><para>You
have two options.</para><itemizedlist><listitem><para>Run the &ldquo;limited&rdquo; SMF profile.</para><screen># <userinput>netservices limited</userinput></screen>
</listitem><listitem><para>Or, individually disable network services.</para><screen># <userinput>svcadm disable network/ftp:default</userinput>
# <userinput>svcadm disable network/finger:default</userinput>
# <userinput>svcadm disable network/login:rlogin</userinput>
# <userinput>svcadm disable network/nfs/server:default</userinput>
# <userinput>svcadm disable network/rpc/rstat:default</userinput>
# <userinput>svcadm disable network/smtp:sendmail</userinput>
# <userinput>svcadm disable network/telnet:default</userinput>
# <userinput>svcs | grep network</userinput>
online         Aug_02   svc:/network/loopback:default
&hellip;
online         Aug_09   svc:/network/ssh:default
&hellip;</screen>
</listitem>
</itemizedlist>
</step>
</substeps>
</step><step><para>On each system, add a pair of SAs between the two systems.</para><itemizedlist><para>Choose one of the following options.</para><listitem><para>Configure IKE to manage the keys for the SAs. Use one of the
procedures in <olink targetptr="ike-task-7" remap="internal">Configuring IKE (Task Map)</olink> to
configure IKE for the VPN.</para>
</listitem><listitem><para>If you have an overriding reason to manually manage the keys,
see <olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security
Associations</olink>.</para>
</listitem>
</itemizedlist>
</step><step><para>On each system, add IPsec policy.</para><para>Edit the <filename>/etc/inet/ipsecinit.conf</filename> file to add the IPsec policy for the VPN.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following entry into the <filename>ipsecinit.conf</filename> file:</para><screen># IPv6 Neighbor Discovery messages bypass IPsec.
{ulp ipv6-icmp type 133-137 dir both} pass {}

# LAN traffic can bypass IPsec.
{laddr 6000:6666::aaaa:1116 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip6.tun0 negotiate transport} 
 ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</step><step><para>On the <literal>partym</literal> system, type the following
entry into the <filename>ipsecinit.conf</filename> file:</para><screen># IPv6 Neighbor Discovery messages bypass IPsec.
{ulp ipv6-icmp type 133-137 dir both} pass {}

# LAN traffic can bypass IPsec.
{laddr 6000:3333::eeee:1113 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{tunnel ip6.tun0 negotiate transport} 
 ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</step>
</substeps>
</step><step id="ipsec-tun-6"><para>On each system, configure a secure tunnel, <literal>ip6.tun0</literal>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, type
the following commands:</para><screen># <userinput>ifconfig ip6.tun0 inet6 plumb</userinput>

# <userinput>ifconfig ip6.tun0 inet6 6000:6666::aaaa:1116 6000:3333::eeee:1113 \</userinput>
<userinput>tsrc 2001::aaaa:6666:6666   tdst 2001::eeee:3333:3333</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, type the following
commands:</para><screen># <userinput>ifconfig ip6.tun0 inet6 plumb</userinput>

# <userinput>ifconfig ip6.tun0 inet6  6000:3333::eeee:1113  6000:6666::aaaa:1116 \</userinput>
<userinput>tsrc 2001::eeee:3333:3333   tdst 2001::aaaa:6666:6666</userinput></screen>
</step>
</substeps>
</step><step><para>On each system, turn on IP forwarding for the <literal>hme1</literal> interface. </para><screen># <userinput>ifconfig hme1 router</userinput></screen>
</step><step><para>On each system, ensure that routing protocols do not advertise
the default route within the intranet.</para><screen># <userinput>ifconfig hme0 private</userinput></screen>
</step><step><para>Manually, add a default route over <literal>hme0</literal>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system, add
the following route:</para><screen># <userinput>route add -inet6 default 2001::aaaa:0:4</userinput></screen>
</step><step><para>On the <literal>partym</literal> system, add the following
route:</para><screen># <userinput>route add -inet6 default 2001::eeee:0:1</userinput></screen>
</step>
</substeps>
</step><step id="ipsec-mgtasks-ipv6-deprec-2"><para>Ensure that the VPN starts after
a reboot by adding an entry to the <filename>/etc/hostname6.ip6.tun0</filename> file. </para><para>The entry replicates the parameters that were passed to the <command>ifconfig</command> command in <olink targetptr="ipsec-mgtask-iptun-2" remap="internal">Step&nbsp;5</olink>.</para><substeps><step><para>For example, on the <literal>enigma</literal> system,
add the following entry to the <filename>hostname6.ip6.tun0</filename> file:</para><screen>6000:6666::aaaa:1116  6000:3333::eeee:1113 \
tsrc 2001::aaaa:6666:6666   tdst 2001::eeee:3333:3333  router up</screen>
</step><step><para>On the <literal>partym</literal> system, add the following
entry to the <filename>hostname6.ip6.tun0</filename> file:</para><screen>6000:3333::eeee:1113  6000:6666::aaaa:1116 \
tsrc 2001::eeee:3333:3333   tdst 2001::aaaa:6666:6666  router up</screen>
</step>
</substeps>
</step><step><para>On each system, configure the interface files to pass the correct
parameters to the routing daemon.</para><substeps><step><para>On the enigma system, modify the <filename>/etc/hostname6.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat enigma hostname6.hme0</userinput>
6000:6666::aaaa:1116 inet6 private</screen><screen>#  <userinput>cat enigma hostname6.hme1</userinput>
2001::aaaa:6666:6666 inet6 router</screen>
</step><step><para>On the partym system, modify the <filename>/etc/hostname6.</filename><replaceable>interface</replaceable> files.</para><screen># <userinput>cat partym hostname6.hme0</userinput>
6000:3333::eeee:1113 inet6 private</screen><screen># <userinput>cat partym hostname6.hme1</userinput>
2001::eeee:3333:3333 inet6 router</screen>
</step>
</substeps>
</step><step><para>On each system, run a routing protocol.</para><screen># <userinput>routeadm -e ipv6-routing</userinput>
# <userinput>routeadm -u</userinput></screen>
</step>
</procedure><example id="ipsec-mgtasks-39"><title>Using Deprecated Syntax to Configure IPsec in Transport Mode Over IPv6</title><para>In this example, administrator is connecting a  Solaris
Express system with a system that is running the Solaris 10 release. Therefore,
the administrator uses Solaris 10 syntax in the configuration file, and includes
the IPsec algorithms in the <command>ifconfig</command> command. The steps
are performed in the same order, but uses the  Solaris 10 syntax.</para><orderedlist><listitem><para>In <olink targetptr="ipsec-mgtasks-deprec-syntax-1" remap="internal">Step&nbsp;4</olink>,
the syntax is the following:</para><screen># IPv6 Neighbor Discovery messages bypass IPsec.
{ulp ipv6-icmp type 133-137 dir both} pass {}

# LAN traffic can bypass IPsec.
{laddr 6000:3333::eeee:1113 dir both} bypass {}

# WAN traffic uses ESP with 3DES and MD5.
{} ipsec {encr_algs 3des encr_auth_algs md5}</screen>
</listitem><listitem><para>For <olink targetptr="ipsec-mgtasks-deprec-syntax-2" remap="internal">Step&nbsp;5</olink> to <olink targetptr="ipsec-mgtasks-deprec-syntax-4" remap="internal">Step&nbsp;7</olink>, the syntax
is the following:</para><screen># <userinput>ifconfig ip6.tun0 inet6 plumb</userinput>

# <userinput>ifconfig ip6.tun0 inet6 6000:6666::aaaa:1116 6000:3333::eeee:1113 \</userinput>
<userinput>tsrc 2001::aaaa:6666:6666 tdst 2001::eeee:3333:3333 \</userinput>
<userinput>encr_algs 3des encr_auth_algs md5</userinput>

# <userinput>ifconfig ip6.tun0 inet6 router up</userinput></screen><para>The IPsec policy that is passed to the <command>ifconfig</command> commands
must be the same as the IPsec policy in the <filename>ipsecinit.conf</filename> file.
Upon reboot, each system reads the <filename>ipsecinit.conf</filename> file
for its policy.</para>
</listitem><listitem><para>In <olink targetptr="ipsec-mgtasks-ipv6-deprec-2" remap="internal">Step&nbsp;9</olink>,
the syntax is the following:</para><screen>6000:6666::aaaa:1116  6000:3333::eeee:1113 \
tsrc 2001::aaaa:6666:6666   tdst 2001::eeee:3333:3333 \
encr_algs 3des encr_auth_algs md5 router up</screen>
</listitem>
</orderedlist>
</example>
</task>
</sect1>
</chapter>