---------------------------------------------------------------------- HOWTO use LIVSIX Router Advertisement (RA) Functions Tim Leinmueller leinmuel@nal.motlabs.com ---------------------------------------------------------------------- This HOWTO describes the configuration and usage of the RA functionality of LIVSIX. In contrast to other Open Source IPv6 stacks (namely the KAME IPv6 stack and the Linux IPv6 stack) LIVSIX implements this functionality within the kernel space and not as a user level daemon. Introduction ------------ The LIVSIX source code contains two #defines (see $livsix/include/sfk/router.h), which specify the maximum number of supported interfaces (MAX_INTERFACES) and the maximum number of supported prefixes per interface (MAX_PREFIXES). The MAX_INTERFACES constant is also used for default interface determination. By default, all router functionalities (this includes sending RAs) are disabled. To change this, you can modify the corresponding variable by the usage of LIVSIX's sysctl interface. Moreover using this interface, you can modify the contents of the RAs, and their periodicity. For a detailed specification of the router advertisement related LIVSIX sysctl interface have a look at the "LIVSIX sysctl interface" section. In case you just want to discover its functionality, you might start directly with the "First steps / Examples" section, but it is recommended to read the other section at first. LIVSIX sysctl interface ----------------------- LIVSIX's behavior is controlled through a set of entries in the sysctl structure. After having launched LIVSIX, they are located in "proc/sys/net/livsix/". In this section we will explain the entries related to RAs. "/proc/sys/net/livsix" entry values description isrouter 0/1 disable/enable router functionality "/proc/sys/net/livsix/conf" entry description default/ default values for an interface, if an interface gets "up" (at the moment, used only at startup, so modifying values, won't change anything. ethX/ this directory exists for every interface ethX (X = 0...?), which was "up" at the startup of LIVSIX. "/proc/sys/net/livsix/conf/ethX" entry values description ra_curhop_limit 0-255 Cur Hop Limit field ra_def_lifetime 0-65535 Router Lifetime field ra_managed 0/1 Managed flag 0/1 ra_maxra_interval 4-1800 The maximum time allowed between sending unsolicited multicast RAs from the interface. ra_minra_interval 3-1800 The minimum time time allowed between sending unsolicited multicast RAs from the interface. ra_mtu 0-(32bit) The MTU to be placed in the MTU option (entered in decimal, 0 means MTU option is not send with the RA). ra_otherconfig 0/1 Other Config flag 0/1 ra_prefix_XX/ Configuration of the prefix option to be send with the RAs. The directories are always there, even if you don't use them. (XX = 00...MAX_PREFIXES). ra_reachable_time 0-(32bit) Reachable Time field (values are entered decimal!) ra_retrans_timer 0-(32bit) Retrans Timer field (decimal!) ra_send_ras 0/1 Do not/do send RAs on this interface. NOTE: The maximum value for ra_min_ra_interval is always inferior or equal to the current ra_maxra_interval, as well as the minimum value for ra_maxra_interval is always superior or equal to the current value of ra_min_ra_interval. Wrong values will be ignored. The time between two unsolicited RAs is randomly distributed in the interval [ra_min_ra_interval,ra_maxra_interval]. "/proc/sys/net/livsix/conf/ethX/ra_prefix_XX" entry values description ra_pfl_autonomous 0/1 Autonomous flag 0/1 ra_pfl_onlink 0/1 Onlink flag 0/1 ra_pfl_preferred_lifetime 0-(32bit) Prefered Lifetime field (decimal) ra_pfl_prefix IPv6addr The prefix. A prefix that is NOT a valid IPv6 address will erase this entry (if present in the prefix-list for this interface). (hexadecimal!) ra_pfl_prefixlen 0-127 Prefix Length field ra_pfl_valid_lifetime 0-(32bit) Valid Lifetime field (decimal) For a detailed explanation of the RA fields, take a look at the corresponding rfc (rfc 2461 - Neighbor Discovery for IP Version 6 (IPv6)). There you will also find the default values for the fields. First steps / Examples ---------------------- Start LIVSIX as usual. To start advertising a prefix: echo $PREFIX > \ /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefix echo $PREFIXLENGTH \ > /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefixlen echo 1 > /proc/sys/net/livsix/conf/ethX/ra_send_ras echo 1 > /proc/sys/net/livsix/isrouter NOTE: these are only the minimum options that have to be set to advertise a VALID prefix on a link (omitting the prefix length will send a prefix option with a 0 in the prefix length field) EXAMPLE (send on eth0): echo 2002:c3d4:6ffd:1:: > \ /proc/sys/net/livsix/conf/eth0/ra_prefix_00/ra_pfl_prefix echo 64 > /proc/sys/net/livsix/conf/eth0/ra_prefix_00/ra_pfl_prefixlen echo 1 > /proc/sys/net/livsix/conf/eth0/ra_send_ras echo 1 > /proc/sys/net/livsix/isrouter Add another prefix (on the same link): echo $OTHERPREFIX > \ /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefix echo $PREFIXLENGTH \ > /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefixlen (ethX should be the same as above :), ra_prefix_XX should be different) EXAMPLE: echo 2002:c3d4:6ffd:2:: > \ /proc/sys/net/livsix/conf/eth0/ra_prefix_02/ra_pfl_prefix echo 64 > /proc/sys/net/livsix/conf/eth0/ra_prefix_02/ra_pfl_prefixlen Modify a prefix: echo $NEWPREFIX > \ /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefix EXAMPLE: echo 2002:c3d4:6ffd:3:: > \ /proc/sys/net/livsix/conf/eth0/ra_prefix_02/ra_pfl_prefix Stop advertising a prefix: echo $ > \ /proc/sys/net/livsix/conf/ethX/ra_prefix_XX/ra_pfl_prefix NOTE: The all the options for this prefix will be deleted, even if this is NOT reflected to the sysctl entries. This means, if you first delete a prefix and then add a prefix to the same table, the new entry will use default values! EXAMPLE: echo x > /proc/sys/net/livsix/conf/eth0/ra_prefix_00/ra_pfl_prefix Stop sending RAs on a special link, and send a last RA with lifetime 0: echo 0 > /proc/sys/net/livsix/conf/ethX/ra_send_ras EXAMPLE: echo 0 > /proc/sys/net/livsix/conf/eth0/ra_send_ras Stop being router (implies stop sending RAs on all interfaces, at the moment): EXAMPLE: echo 0 > /proc/sys/net/livsix/isrouter NOTE: It is a good idea, to stop adverting prefixes some seconds before, since when doing a echo 0 > /proc/sys/net/livsix/conf/ethX/ra_send_ras a last router advertisement is sent, containing a zero in the Router Lifetime field, which will cause other nodes to remove this router from their default router list. Final Words ----------- For comments, suggestions, questions and bug reports, please post on the LIVSIX mailing list or contact the author.