Chapter 15. HIP Firewall

This section describes how to use the HIP firewall. The firewall needs to be compiled with the --enable-firewall option to configure.

Ip6tables must define that HIP and ESP packets are queued in the userspace. These rules are inserted automatically at the head of each chain. Other rules that might concern the HIP (-p 253) and ESP packets (-p 50) must not be inserted before them.

Make sure that you set /proc/sys/net/ipv6/conf/all/forwarding to one, if you want your firewall to forward IPv6 traffic. Remember to configure IPv6 routes to the hosts.

Firewall can be started with "./firewall <file_name>" "timeout value" at firewall directory, where file_name is path of the file containing the firewall rules and timeout value is the connection timeout value in seconds. If connection timeout is defined as zero or negative, the connection timeout checking is not used. Rules in the file must be separated with newline. The firewall (currently) prints out debug information from rule parsing test functions and from filtering packets.

Rules follow (loosely) the syntax of Linux Iptables with following syntax.

Basic format of rule is: HOOK [match] TARGET

Filtering options:

-src_hit [!] <hit value> --hi <file name>

Matches source HIT of packet. HI can be given with --hi option and by defining path to a public key file as an argument. This causes sender signatures to be verified. The file name must contain either "_rsa_" or "_dsa_" to define whether RSA or DSA is used as algorithm.

-dst_hit [!] <hit>

Matches destination HIT of packet.

-type [!] <hip packet type>

Matches HIP packet type. Type is one of following: "I1", "R1", "I2", "R2", "CER", "UPDATE", "NOTIFY", "CLOSE", "CLOSE_ACK"

-i [!] <incoming interface>

Matches incoming interface. Argument contains name of the interface. Can not be used for rules in OUTPUT hook as packet has no incoming interface in that case.

-o [!] <outgoing interface>

Matches outgoing interface. Argument contains name of the interface. Can not be used for rules in INPUT hook as packet has no outgoing interface in that case.

-state [!] <state> --verify_responder --accept_mobile --decrypt_contents

Matches state of HIP association: "NEW" or "ESTABLISHED". ESP packets are also filtered as part of the connection. With "--verify_responder" option the firewall stores responder HI from R1 packet and uses it for verifying signatures in the packets. With --accept_mobile option, the firewall may establish state for existing connection when a mobile host enters the network protected by the firewall. Please see Chapter 9, Testing Handover to see how mobility events can be tested. When option --decrypt_contents is set firewall tries to decrypt ESP-packet contents. This can be done if session data has been delivered to firewall. See Chapter 23, Using Key Escrow for details. Currently decrypted packet contents can be viewed in firewall output.

If you get "No buffer space available" errors, please disable all of the firewall debug messages (./configure --disable-debug; make clean all). This can occur when moving large files and the firewall cannot serve with sufficient speed when it has to display debug messages.

Management interface: