• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Package rtnetlink provides low-level access to the Linux rtnetlink API. MIT Licensed.

rtnetlink Linux Integration GoDoc Go Report Card

Package rtnetlink allows the kernel's routing tables to be read and altered. Network routes, IP addresses, Link parameters, Neighbor setups, Queueing disciplines, Traffic classes and Packet classifiers may all be controlled. It is based on netlink messages.

A convenient, high-level API wrapper is available using package rtnl.

The base rtnetlink library explicitly only exposes a limited low-level API to rtnetlink. It is not the intention (nor wish) to create an iproute2 replacement.

Debugging and netlink errors

Unfortunately the errors generated by the kernels netlink interface are not very great.

When in doubt about your message structure it can always be useful to look at the message send by iproute2 using strace -f -esendmsg /bin/ip or similar.

Another (and possibly even more flexible) way would be using nlmon and wireshark. nlmod is a special kernel module which allows you to capture all netlink (not just rtnetlink) traffic inside the kernel. Be aware that this might be overwhelming on a system with a lot of netlink traffic.

# modprobe nlmon
# ip link add type nlmon
# ip link set nlmon0 up

At this point use wireshark or tcpdump on the nlmon0 interface to view all netlink traffic.

Have a look at the examples for common uses of rtnetlink.

If you have any questions or you'd like some guidance, please join us on Gophers Slack in the #networking channel!

More Repositories

1

docker-gns3-server

Dockerfile for GNS3 server
Dockerfile
63
star
2

tlstun

A socks tunnel client and server using websockets over http and tls
Go
38
star
3

go-spice

SPICE proxy library, written in go
Go
34
star
4

go-artnet

This package attempts to implement the Art-Net 4 specification from (c) Artistic Licence Holding Ltd.
Go
31
star
5

berkeleydb

Berkeley DB bindings for go
Go
27
star
6

lldpd

lldpd written in golang
Go
23
star
7

sniqueue

Using nfqueue to accept or drop flows destined for SNI domainnames
Go
19
star
8

btlocker

A session locker using Bluetooth proximity (build in golang)
Go
13
star
9

pwscheme

Golang packages defining different password schemes
Go
8
star
10

ldapserv

Very simple Ldap server with multiple backend stores
Go
4
star
11

public_doh_servers

Various lists for public DOH servers
Python
3
star
12

gopalm

Easy network device scripting using go
Go
3
star
13

agocontrol-openwrt

Openwrt Packages for AgoControl
Makefile
3
star
14

talos-airgap

Collection of scripts to create a fully airgapped install of Talos
Shell
3
star
15

ssh-scheme-handler

Very simple Gnome-shell ssh url handler
Go
2
star
16

homealone

Yet another home automation system
Go
2
star
17

tunrouter

Go
2
star
18

hodos

Multi ISP policy routing with monitoring
Go
2
star
19

franz-recipe-plek

Franz recipe for Plek
JavaScript
1
star
20

px2sx

PX2SX is a conversion utility that takes a PIX or ASA configuration file as input, and produces a set of output files containing the equivalent Junos configurations for the SRX platform.
Perl
1
star
21

ESP8266-MQTT-JSON-SK6812RGBW-HomeAssistant

ESP MQTT Digital LEDs for Home Assistant's MQTT JSON Light Component. Supports flash, fade, transitions, effects, and OTA uploading!
C
1
star