ndppd

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2025 License: BSD-3-Clause Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ndppd - Neighbor Discovery Protocol Proxy Daemon

ndppd is a lightweight and efficient daemon for proxying IPv6 Neighbor Discovery Protocol (NDP) packets on Linux. It listens for Neighbor Solicitation (NS) messages on a given interface and can either provide a static reply or forward the request to another interface based on a flexible ruleset.

This project is a Go implementation of the original C++ ndppd found at https://github.com/DanielAdolfsson/ndppd.

This is particularly useful in complex network environments, such as those with Proxmox or other virtualization platforms, where you need to bridge NDP messages between a host and its virtual machines or containers.

Features

  • Rule-Based Proxying: Forward or reply to NDP requests based on a simple configuration file.
  • Static Replies: Respond to NS requests for specific prefixes with the host's own MAC address.
  • Interface Forwarding: Forward NS requests that match a rule to a different network interface.
  • Automatic Forwarding: (Linux-only) Automatically find the correct interface to forward to by reading the system's IPv6 route table.
  • Daemonization: Runs as a background process.
  • High Performance: Built in Go with raw sockets for high-speed packet handling.

Configuration

ndppd is controlled by a configuration file, typically located at /etc/ndppd.conf. The file consists of one or more proxy blocks, each defining a listening interface and a set of rules.

Example ndppd.conf
# Proxy NDP packets on the eth0 interface
proxy eth0 {
    # Set the router flag on Neighbor Advertisements.Default is yes.
    router yes

    # When enabled, 
    # outgoing Neighbor Solicitations (NS) from a link-local source 
    # address will have their source address rewritten to the global 
    # address prefix from the matching rule. It is useful in some PVE environments.
    # Default is no.
    rewrite_source no


    # Rule for a static prefix. ndppd will reply to any NS request
    # for an address within this prefix using its own MAC address.
    rule 2001:db8:1::/48 {
        static
    }

    # Rule for forwarding. ndppd will forward any NS request
    # for an address within this prefix to the eth1 interface.
    rule 2001:db8:2::/48 {
        iface eth1
    }

    # Rule for automatic forwarding. ndppd will look up the correct
    # interface in the kernel route table and forward the packet.
    rule 2001:db8:3::/48 {
        auto
    }
}
Proxy Options
  • router [yes|no]: (Default: yes) Whether to set the "is-router" flag in Neighbor Advertisement replies.
  • ttl <milliseconds>: (Default: 30000) Not currently implemented.
  • timeout <milliseconds>: (Default: 500) Not currently implemented.
  • rewrite_source [yes|no]: (Default: no) When enabled, outgoing Neighbor Solicitations (NS) from a link-local source address will have their source address rewritten to the global address prefix from the matching rule.It is useful in some PVE environments.
Rule Types

Each rule block defines a prefix and an action.

  • static: Responds to NS requests with a Neighbor Advertisement (NA) from the host interface.
  • iface <interface>: Forwards the NS packet to the specified <interface>.
  • auto: Looks up the destination IP in /proc/net/ipv6_route and forwards the packet to the appropriate interface.

Building

This is a standard Go project. Ensure you have a recent version of Go installed.

go build

This will produce a binary named ndppd in the current directory.

Usage

ndppd requires root privileges to create raw sockets.

# Run in the foreground with a local config file
sudo ./ndppd -c ndppd.conf

# Run as a daemon using the default config path
sudo ./ndppd -d
Command-Line Flags
  • -c <path>: Path to the configuration file (default: /etc/ndppd.conf).
  • -d: Run as a daemon (background process).
  • -p <path>: Path to write a PID file (e.g., /var/run/ndppd.pid).
  • -v <level>: Verbose logging level.

Dependencies

Platform

This tool is designed specifically for Linux due to its reliance on AF_PACKET raw sockets and the /proc/net/ipv6_route file for the auto rule functionality. It will not run on other operating systems like Windows or macOS.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址