User Tools

Site Tools


Installing and configuring hnet

Hnet runs on OpenWrt Barrier Breaker and the latest trunk versions. If you are using an older version, you will need to upgrade it.

Installing a prebuild snapshot

OpenWrt offers regularly built snapshots which are the easiest way of testing hnet. However please note that these OpenWrt snapshots are development versions and might or might not have some bugs. To use this approach download an appropriate image and flash it onto your router. Make sure that router is connected to the internet.

To install hnet now do:

opkg update && opkg install hnet-full

and follow the steps at the bottom of this page to configure and start it. hnet-full will install hnetd (the HNCP implementation), ohybridproxy (an mDNS/DNS hybrid-proxy) and babels (babel source-routing implementation). At your discretion you can also install hnetd alone or together with one of the other 2 packages.

Building from source

Please refer to the build instructions.

Configuring and starting hnet

Once prebuilt or customized images are built and hnet is installed it needs to be configured and started.

Hnet integrates seamlessly into OpenWrt's network management and can be enabled or disabled on a per-interface basis. To run hnet on an interface open the network configuration file

vi /etc/config/network

Add a configuration section for each interface you want to run hnet on.

config interface 'homenet1'
        option ifname 'eth0'
        option proto 'hnet'

config interface 'homenet2'
        option ifname 'eth1'
        option proto 'hnet'

IMPORTANT: Remove or comment out other config sections running DHCP or DHCPv6 clients on the interfaces your run hnet on. Additional static configuration section may be kept for debugging purposes.

WARNING: Do NOT set the proto of either the “lan”, “wan” or “wan6” interface to hnet directly. Always rename your interfaces to a different name, e.g. homenet0 or homenet1.

and then reload the network configuration to apply your new settings.

/etc/init.d/network reload

Note: Depending on how you installed the software it might be necessary to manually enable and start mdnsd in order to use hybrid-proxying:

/etc/init.d/mdnsd enable && /etc/init.d/mdnsd start

Configuration Options

Hnet offers a set of configuration options.

Prefix Manual Configuration

Options prefix and link_id can be used to specify custom behavior regarding assigned prefix selection. Such options must be included in hnet interface's configuration section. Here is an example.

config interface 'homenet1'
        option ifname 'eth0'
        option proto 'hnet'
        prefix 2001:dead:beaf:1111::/64
        link_id 4/6

prefix is used to specify a particular prefix to be used whenever it is compatible with some available delegated prefix. For instance, if the ISP gave you 2001:dead:beaf::/56, hnet will consider the prefix. If your prefix is 2001:dead:f00d::/56, it will be ignored. For this reason, it is possible to specify multiple prefix options.

link_id is more flexible. If the option is set to ID/MASK (ID in hexadecimal format and MASK in decimal format), the ID will be used to generate the prefix assigned to that link whenever the delegated prefix offers MASK available bits. In the example, if the delegated prefix is 2001:dead:beaf::/56, there are 8 bits available (8 >= 6), so the link prefix will be 2001:dead:beaf:4::/64. If the prefix is 2001:dead:f00d::/56, it would be 2001:dead:beaf:4::/64. Although, if the prefix is 2001:dead:beaf:ff::/60, the link_id would not be used because only 4 bits are available. It also works for IPv4: If 10/8 is used, the link prefix will be 10.0.4/24.

These configuration options are suggestions made to Hnet. They use high priority assignments and are therefore likely to be applied. But if another router disagrees, configuration entries may not be applied.

Address Manual Configuration

A configuration option similar to link_id can be used to control address selection: iface_id.

config interface 'homenet1'
        option ifname 'eth0'
        option proto 'hnet'
        option iface_id '::1/8@ ::aaaa:bbbb/32'

The syntax of such option is “V6ADDRESS/MASK[@filter-prefix]”. Only the MASK last bits are considered. If the prefix assigned to the link doesn't offer MASK available bits, or if a filter prefix is specified and the assigned prefix is not included in it, the entry is ignored. Such configuration option is applied to IPv4 as well, but the address must still be specified as IPv6 address. In the example, if the assigned prefix is 2001:f00d::/64, the address will be 2001:f00d::aaaa:bbbb. If the address is 10.0.10/24, the first rule will apply, and the address will be

As previously, such entries are suggestions made to HNCP. If some other router already uses the desired address, an entry may be ignored.

Other Configuration Options

  • disable_pa is a boolean that can be used to disable prefix and address assignment algorithm on an internal interface.
  • adhoc is a boolean that can be used to switch prefix-assignment to adhoc mode, which consists in ignoring other on-link assignments. When enabled, the router will always create its own prefix assignments for the link and serve as DHCP/RA server.
  • ip6_plen specifies the prefix length for IPv6 prefix assignments. For instance, if set to 90, IPv6 assignments will be of length 90 instead of 64.
installation/hnet-openwrt.txt · Last modified: 2016/09/05 16:15 (external edit)