Skip to content

How to Configure the Hub

On the hub, wgpathd reads the wg_mesh peer table and publishes the spokes' IPv6 endpoints on its wg_hub address. It steers nothing.

Prerequisites


1. Write the configuration

Replace the contents of /etc/config/wgpathd with:

config wgpathd 'main'
    option enabled    '1'
    option role       'hub'
    option read_iface 'wg_mesh'
    option serve_addr '10.10.0.1'
    option serve_port '7780'
  • read_iface is the interface whose peer endpoints are published: the mesh, where the spokes' IPv6 endpoints appear.
  • serve_addr is the hub's own address on wg_hub. Spokes reach it through the tunnel that stays up when the mesh is down.
  • serve_port is the TCP port of the list, the one the hub's firewall rule accepts from the zone of wg_hub.

Every option is described in UCI configuration.

2. Check the configuration

service wgpathd check
ok    config: hub, reads wg_mesh, serves 10.10.0.1:7780
ok    wg_mesh: up, 2 peers
ok    firewall: TCP port 7780 (peer list) from wg_hub (zone vpn): accepted

Fix every FAIL line before you go on. A warn firewall: line means the spokes cannot fetch the list yet; it comes with the rule to add. Each line is explained in Service commands.

3. Start the service

service wgpathd start
service wgpathd status
running
role: hub
published peers:
  SpokeAme  [2001:db8:a::1]:51820   handshake 12s ago
  SpokeBme  [2001:db8:b::20]:51820  handshake 7s ago

The log has a started role=hub line. If the first line is not running, or wgpathd: cannot read status follows it, look at logread -e wgpathd | tail -n 5 and find the code in Log messages. A common one is startup failed: PUBLISHER_LISTEN_FAILED (...: bind(): Address not available): serve_addr is not an address of this host, or wg_hub is not up.

4. Check what is published

Each spoke should be listed under published peers with a direct IPv6 endpoint. From a spoke, fetch the same data over wg_hub:

uclient-fetch -qO- http://10.10.0.1:7780/peers

A spoke missing from the list has no IPv6 endpoint in the hub's wg_mesh table. Check that spoke's wg_mesh peer for the hub has an IPv6 endpoint and persistent_keepalive.