A simple TUN/TAP library written in native Go.

water

water is a native Go library for TUN/TAP interfaces.

water is designed to be simple and efficient. It

  • wraps almost only syscalls and uses only Go standard types;
  • exposes standard interfaces; plays well with standard packages like io, bufio, etc..
  • does not handle memory management (allocating/destructing slice). It's up to user to decide whether/how to reuse buffers.

water/waterutil has some useful functions to interpret MAC frame headers and IP packet headers. It also contains some constants such as protocol numbers and ethernet frame types.

See https://github.com/songgao/packets for functions for parsing various packets.

Supported Platforms

  • Linux
  • Windows (experimental; APIs might change)
  • macOS (point-to-point TUN only)

Installation

go get -u github.com/songgao/water
go get -u github.com/songgao/water/waterutil

Documentation

http://godoc.org/github.com/songgao/water

Example

TAP on Linux:

package main

import (
	"log"

	"github.com/songgao/packets/ethernet"
	"github.com/songgao/water"
)

func main() {
	config := water.Config{
		DeviceType: water.TAP,
	}
	config.Name = "O_O"

	ifce, err := water.New(config)
	if err != nil {
		log.Fatal(err)
	}
	var frame ethernet.Frame

	for {
		frame.Resize(1500)
		n, err := ifce.Read([]byte(frame))
		if err != nil {
			log.Fatal(err)
		}
		frame = frame[:n]
		log.Printf("Dst: %s\n", frame.Destination())
		log.Printf("Src: %s\n", frame.Source())
		log.Printf("Ethertype: % x\n", frame.Ethertype())
		log.Printf("Payload: % x\n", frame.Payload())
	}
}

This piece of code creates a TAP interface, and prints some header information for every frame. After pull up the main.go, you'll need to bring up the interface and assign an IP address. All of these need root permission.

sudo go run main.go

In a new terminal:

sudo ip addr add 10.1.0.10/24 dev O_O
sudo ip link set dev O_O up

Wait until the output main.go terminal, try sending some ICMP broadcast message:

ping -c1 -b 10.1.0.255

You'll see output containing the IPv4 ICMP frame:

2016/10/24 03:18:16 Dst: ff:ff:ff:ff:ff:ff
2016/10/24 03:18:16 Src: 72:3c:fc:29:1c:6f
2016/10/24 03:18:16 Ethertype: 08 00
2016/10/24 03:18:16 Payload: 45 00 00 54 00 00 40 00 40 01 25 9f 0a 01 00 0a 0a 01 00 ff 08 00 01 c1 08 49 00 01 78 7d 0d 58 00 00 00 00 a2 4c 07 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37

TUN on macOS

package main

import (
	"log"

	"github.com/songgao/water"
)

func main() {
	ifce, err := water.New(water.Config{
		DeviceType: water.TUN,
	})
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("Interface Name: %s\n", ifce.Name())

	packet := make([]byte, 2000)
	for {
		n, err := ifce.Read(packet)
		if err != nil {
			log.Fatal(err)
		}
		log.Printf("Packet Received: % x\n", packet[:n])
	}
}

Run it!

$ sudo go run main.go

This is a point-to-point only interface. Use ifconfig to see its attributes. You need to bring it up and assign IP addresses (apparently replace utun2 if needed):

$ sudo ifconfig utun2 10.1.0.10 10.1.0.20 up

Now send some ICMP packets to the interface:

$ ping 10.1.0.20

You'd see the ICMP packets printed out:

2017/03/20 21:17:30 Interface Name: utun2
2017/03/20 21:17:40 Packet Received: 45 00 00 54 e9 1d 00 00 40 01 7d 6c 0a 01 00 0a 0a 01 00 14 08 00 ee 04 21 15 00 00 58 d0 a9 64 00 08 fb a5 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37

Caveats

  1. Only Point-to-Point user TUN devices are supported. TAP devices are not supported natively by macOS.
  2. Custom interface names are not supported by macOS. Interface names are automatically generated serially, using the utun<#> naming convention.

TAP on Windows:

To use it with windows, you will need to install a tap driver, or OpenVPN client for windows.

It's compatible with the Linux code.

package main

import (
	"log"

	"github.com/songgao/packets/ethernet"
	"github.com/songgao/water"
)

func main() {
	ifce, err := water.New(water.Config{
		DeviceType: water.TAP,
	})
	if err != nil {
		log.Fatal(err)
	}
	var frame ethernet.Frame

	for {
		frame.Resize(1500)
		n, err := ifce.Read([]byte(frame))
		if err != nil {
			log.Fatal(err)
		}
		frame = frame[:n]
		log.Printf("Dst: %s\n", frame.Destination())
		log.Printf("Src: %s\n", frame.Source())
		log.Printf("Ethertype: % x\n", frame.Ethertype())
		log.Printf("Payload: % x\n", frame.Payload())
	}
}

Same as Linux version, but you don't need to bring up the device by hand, the only thing you need is to assign an IP address to it.

go run main.go

It will output a lot of lines because of some windows services and dhcp. You will need admin right to assign IP.

In a new cmd (admin right):

# Replace with your device name, it can be achieved by ifce.Name().
netsh interface ip set address name="Ehternet 2" source=static addr=10.1.0.10 mask=255.255.255.0 gateway=none

The main.go terminal should be silenced after IP assignment, try sending some ICMP broadcast message:

ping 10.1.0.255

You'll see output containing the IPv4 ICMP frame same as the Linux version.

Specifying interface name

If you are going to use multiple TAP devices on the Windows, there is a way to specify an interface name to select the exact device that you need:

	ifce, err := water.New(water.Config{
		DeviceType: water.TAP,
		PlatformSpecificParams: water.PlatformSpecificParams{
			ComponentID:   "tap0901",
			InterfaceName: "Ethernet 3",
			Network:       "192.168.1.10/24",
		},
	})

TODO

  • tuntaposx for TAP on Darwin

Alternatives

tuntap: https://code.google.com/p/tuntap/

Comments
  • Add windows support.

    Add windows support.

    To use it on windows, you need a tap driver https://github.com/OpenVPN/tap-windows6 or just install OpenVPN. https://github.com/OpenVPN/openvpn

    ~~~And don't forget to give it privileged right.~~~ privileged right is not required anymore.

  • Bug: write /dev/net/tun: invalid argument on Ubuntu 16.04.1

    Bug: write /dev/net/tun: invalid argument on Ubuntu 16.04.1

    Attempting to write the default tunnel will cause this error.

    Work-around: Update syscalls_linux.go, the function newTUN to not use the flag cIFF_NO_PI. It will work this way.

    That is, the line:

    name, err := createInterface(file.Fd(), ifName, cIFF_TUN|cIFF_NO_PI)
    

    will be replaced by:

    name, err := createInterface(file.Fd(), ifName, cIFF_TUN)
    

    I remember this situation back in the days I was playing with Linux TUN feature. And this also happened back then. This looks like a bug in the Kernel itself. But I guess, since it hasn't been addressed for years in the mainstream and people have got ways around it, it has been left as is.

    Thus, I'm guessing it should be addressed at the library level as well. I have this problem on Ubuntu 16.04.1, but I'm thinking it also happens on other systems.

  • flag.Parse() collects test files by mistake

    flag.Parse() collects test files by mistake

    When I wrote a source code as follows:

    package main
    
    import (
            "flag"
            "github.com/songgao/water"
    )
    
    func main() {
            flag.Parse()
    
            water.NewTUN("tun0")
    }
    

    and built and ran with -h option, a lot of unexpected options was listed:

    [email protected]:~/waterexample/src/main$ go build
    [email protected]:~/waterexample/src/main$ ls
    main  main.go
    [email protected]:~/waterexample/src/main$ ./main -h
    Usage of ./main:
      -test.bench string
            regular expression to select benchmarks to run
      -test.benchmem
            print memory allocations for benchmarks
      -test.benchtime duration
            approximate run time for each benchmark (default 1s)
      -test.blockprofile string
            write a goroutine blocking profile to the named file after execution
      -test.blockprofilerate int
            if >= 0, calls runtime.SetBlockProfileRate() (default 1)
      -test.count n
            run tests and benchmarks n times (default 1)
      -test.coverprofile string
            write a coverage profile to the named file after execution
      -test.cpu string
            comma-separated list of number of CPUs to use for each test
      -test.cpuprofile string
            write a cpu profile to the named file during execution
      -test.memprofile string
            write a memory profile to the named file after execution
      -test.memprofilerate int
            if >=0, sets runtime.MemProfileRate
      -test.outputdir string
            directory in which to write profiles
      -test.parallel int
            maximum test parallelism (default 2)
      -test.run string
            regular expression to select tests and examples to run
      -test.short
            run smaller test suite to save time
      -test.timeout duration
            if positive, sets an aggregate time limit for all tests
      -test.trace string
            write an execution trace to the named file after execution
      -test.v
            verbose: print additional output
    

    It probably seems that ipv4_test_linux.go and ipv4_test_other.go caused the situation. I tried to rename these tile names to:

    • ipv4_test_linux.go -> ipv4_linux_test.go
    • ipv4_test_other.go -> ipv4_other_test.go

    and built and ran again, the problem was solved.

    [email protected]:~/waterexample/src/main$ go build
    [email protected]:~/waterexample/src/main$ ./main -h
    Usage of ./main:
    [email protected]:~/waterexample/src/main$
    

    Would you please consider to rename those file names?

  • How to implement tun/tap in OSX?

    How to implement tun/tap in OSX?

    Hi~ I have seen the roadmap about water that will support for OSX, did you already have any idea to support it? I found a project tuntaposx, but I think that would be another way that cat support tuntap on OSX without install any software, just like Tunnelblick.

  • The windows example can't run

    The windows example can't run

    I use openvpn install the tap driver on my windows

    C:\Program Files\TAP-Windows\bin
    λ  .\tapinstall.exe hwids tap0901
    ROOT\NET\0000
        Name: TAP-Windows Adapter V9
        Hardware IDs:
            tap0901
    1 matching device(s) found.
    

    Then I copy the code and run the program

     go run .\main.go
    

    It always show me the error

    2018/03/30 19:09:41 Failed to find the tap device in registry with specified ComponentId(), TAP driver may be not installed
    exit status 1
    
  • Add TAP test (ipv4 broadcast)

    Add TAP test (ipv4 broadcast)

    I added some test to make sure the tap interface is working. @hsheth2 @sam-falvo Could you guys take a look when you have time? Thanks!

    Unfortunately Travis-CI doesn't seem to support /dev/net/tun :(

  • Windows: fix syscall.ERROR_MORE_DATA

    Windows: fix syscall.ERROR_MORE_DATA

    The syscall.ERROR_MORE_DATA code is not a true error condition on Windows and shouldn't be treated as such when performing reads/writes. This PR now correctly handles this condition, reading the rest of the available buffer before returning.

  • TAP support for Darwin using tuntaposx

    TAP support for Darwin using tuntaposx

    TAP mode output, using (mostly) the same code from the Linux example.

    Yifans-MacBook-Pro:cmd yifangu$ sudo ./cmd 
    2019/05/20 17:57:36 Dst: ff:ff:ff:ff:ff:ff
    2019/05/20 17:57:36 Src: 72:02:ae:90:f9:4e
    2019/05/20 17:57:36 Ethertype: 08 06
    2019/05/20 17:57:36 Payload: 00 01 08 00 06 04 00 01 72 02 ae 90 f9 4e c0 a8 08 08 00 00 00 00 00 00 c0 a8 08 08
    2019/05/20 17:57:36 Dst: ff:ff:ff:ff:ff:ff
    2019/05/20 17:57:36 Src: 72:02:ae:90:f9:4e
    2019/05/20 17:57:36 Ethertype: 08 06
    2019/05/20 17:57:36 Payload: 00 01 08 00 06 04 00 01 72 02 ae 90 f9 4e c0 a8 08 08 00 00 00 00 00 00 c0 a8 08 08
    2019/05/20 17:57:36 Dst: 01:00:5e:00:00:fb
    2019/05/20 17:57:36 Src: 72:02:ae:90:f9:4e
    2019/05/20 17:57:36 Ethertype: 08 00
    2019/05/20 17:57:36 Payload: 45 00 01 f1 f1 79 00 00 ff 11 1e d6 c0 a8 08 08 e0 00 00 fb 14 e9 14 e9 01 dd 42 39 00 00 00 00 00 1c 00 00 00 00 00 01 05 5f 72 61 6f 70 04 5f 74 63 70 05 6c 6f 63 61 6c 00 00 0c 80 01 08 5f 61 69 72 70 6c 61 79 c0 12 00 0c 80 01 08 5f 68 6f 6d 65 6b 69 74 c0 12 00 0c 80 01 08 5f 61 69 72 70 6f 72 74 c0 12 00 0c 80 01 07 5f 72 64 6c 69 6e 6b c0 12 00 0c 80 01 06 5f 75 73 63 61 6e c0 12 00 0c 80 01 07 5f 75 73 63 61 6e 73 c0 12 00 0c 80 01 07 5f 69 70 70 75 73 62 c0 12 00 0c 80 01 08 5f 73 63 61 6e 6e 65 72 c0 12 00 0c 80 01 04 5f 69 70 70 c0 12 00 0c 80 01 05 5f 69 70 70 73 c0 12 00 0c 80 01 08 5f 70 72 69 6e 74 65 72 c0 12 00 0c 80 01 0f 5f 70 64 6c 2d 64 61 74 61 73 74 72 65 61 6d c0 12 00 0c 80 01 04 5f 70 74 70 c0 12 00 0c 80 01 0d 5f 61 70 70 6c 65 2d 6d 6f 62 64 65 76 c0 12 00 0c 80 01 08 39 37 39 37 30 38 32 65 04 5f 73 75 62 0e 5f 61 70 70 6c 65 2d 6d 6f 62 64 65 76 32 c0 12 00 0c 80 01 0f 5f 61 70 70 6c 65 2d 70 61 69 72 61 62 6c 65 c0 12 00 0c 80 01 c0 fe 00 0c 80 01 05 5f 64 61 61 70 c0 12 00 0c 80 01 0d 5f 74 6f 75 63 68 2d 72 65 6d 6f 74 65 c0 12 00 0c 80 01 c0 22 00 0c 80 01 c0 0c 00 0c 80 01 0b 5f 67 6f 6f 67 6c 65 63 61 73 74 c0 12 00 0c 80 01 0f 5f 63 6f 6d 70 61 6e 69 6f 6e 2d 6c 69 6e 6b c0 12 00 0c 80 01 0b 5f 61 66 70 6f 76 65 72 74 63 70 c0 12 00 0c 80 01 04 5f 73 6d 62 c0 12 00 0c 80 01 04 5f 72 66 62 c0 12 00 0c 80 01 06 5f 61 64 69 73 6b c0 12 00 0c 80 01 00 00 29 05 a0 00 00 11 94 00 12 00 04 00 0e 00 f2 f4 0f 24 30 d3 cb 72 02 ae 90 f9 4e
    

    example configuration

    config := water.Config{
    	DeviceType: water.TAP,
    	PlatformSpecificParams: water.PlatformSpecificParams{
    		Driver: water.TunTapOSXDriver,
    		Name:   "tap3",
    	},
    }
    
  • I can't write data to win-tap

    I can't write data to win-tap

    here is my code:

    package main

    import ( "log" "github.com/songgao/packets/ethernet" "github.com/songgao/water" "fmt" )

    func main() { ifce, err := water.New(water.Config{ DeviceType: water.TAP, PlatformSpecificParams:water.PlatformSpecificParams{ ComponentID: "tap0901", Network: "192.168.1.10/24", }, }) if err != nil { log.Fatal(err) } var frame ethernet.Frame

    for {
    	frame.Resize(1500)
    	n, err := ifce.Read([]byte(frame))
    	if err != nil {
    		log.Fatal(err)
    	}
    	frame = frame[:n]
    	fmt.Printf("\nDst: %s\n", frame.Destination())
    	fmt.Printf("Src: %s\n", frame.Source())
    	fmt.Printf("Ethertype: % x\n", frame.Ethertype())
    	n, err =ifce.Write(frame)// it block here ,not returen anythin
    	if err != nil {
    		log.Fatal(err)
    	}
    }
    

    }

  • Can't write to tun

    Can't write to tun

    test code

    package main
    
    import (
    	"fmt"
    	"github.com/songgao/water"
    	"encoding/hex"
    	"os"
    	"time"
    )
    
    func main() {
    	ifce, err := water.New(water.Config{
    		DeviceType: water.TUN,
    	})
    
    	if err != nil {
    		fmt.Fprintln(os.Stderr, err)
    		os.Exit(1)
    	}
    
    	fmt.Fprintf(os.Stderr, "%v\n", ifce.Name())
    
    	defer ifce.Close()
    
    	for i := 1; i < 100; i++ {
    		data, _ := hex.DecodeString("0200000045000054289d000040013ded0a01000a0a0100140800787f9f45000059db76250003253408090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637")
    		ifce.Write(data)
    		time.Sleep(1 * time.Second)
    
    	}
    
    }
    
    

    Running on macos, and tunnel name is utun2, then I execute sudo ifconfig utun2 10.1.0.10 10.1.0.20 up
    data is an ICMP packet equivalent as ping 10.1.0.20 I captured at utun2 by wireshark, and get nothing, does my codes or my test get wrong?

  • fake IFF_NO_PI on macOS

    fake IFF_NO_PI on macOS

    @eliezedeck I'm pushing this as a PR so that you can review it if you get a chance. Please let me know if this looks good to you. Thanks!

    There doesn't seem to be a way to tell darwin kernel to drop the 4-byte packet information. I guess a better solution would be to use tuntaposx as mentioned in TODO.

    Resolves #18

  • Support for wintun.net

    Support for wintun.net

    First of all, thank you for this excellent module.

    Are there any plans for support the new L3 tunnel adapter made by wireguard ( https://www.wintun.net/ ) ? I wrote my own little module based on https://git.zx2c4.com/wireguard-go/tree/ but I feel like water would benefit greatly from adding support for wintun.

    Thanks!

  • intercept ping traffic

    intercept ping traffic

    Hi, I'm new to TUN/TAP but I have been programming in Go for a while. I couldn't find great tutorials online for general TUN/TAP information and not many examples here, but what I am trying to do is intercept PING messages (in and out) and control the response of them (increase the latency artificially) as an academic exercise in learning about virtual network interfaces.

    Would anyone be able to provide an example of receiving a ping message and responding to it with an artificial delay?

    My goal is to understand using TUN/TAP at both the layer 3 (ICMP) interception and then at layer 7 HTTP (i.e making a GET request to http://example.com over the TUN/TAP)

    I have looked around but I'm on a mac and the general internet information is very linux specific. Water seems like the way to go about this, but i struggled to find much in the way of examples. A very basic example doing the above would really give me a head start. Thanks!

  • capture all traffic and send to water tun device from mac

    capture all traffic and send to water tun device from mac

    Hi i checked the sample from the readme and im happy that it works as expected, would like to ask if there's a chance that i can use the tun device to capture all traffic made by the device and send it to tun ,

    I just want to create a flow like below

    device -> (www.google.com) -> water( tunX) -> (proxy :port) -> internet

  • failed to find the tap device in registry with specified compentid tap0901

    failed to find the tap device in registry with specified compentid tap0901

    on windows env, installed OpenVPN client. but TAP and TUN driver not connected.

    run program

    ifce, err := water.New(water.Config{
    		DeviceType: water.TUN,
    	})
    if err != nil {
    log.Fatal(err)
    }
    fmt.Printf(ifce.Name())
    

    something go wrong. and error log print

    failed to find the tap device in registry with specified compentid tap0901.

    pls help.

  • Change component ID in example for windows

    Change component ID in example for windows

    Running windows 10, I had to add the lines

    PlatformSpecificParams: water.PlatformSpecificParams{
    	ComponentID: "root\\tap0901",
    },
    

    in order to get it to work. I have added this to the readme for others to see. If this is somehow an issue with only my computer or installation and other users don't need to do this, please let me know, however I don't know how that would be the case.

An util to bypass clash-premium tun for commands

without-clash An util to bypass clash-premium tun for commands Requirement Kernel Features: cgroup2 ebpf && cgroup2 sock attach point iproute2 Install

Dec 19, 2022
grobotstxt is a native Go port of Google's robots.txt parser and matcher library.

grobotstxt grobotstxt is a native Go port of Google's robots.txt parser and matcher C++ library. Direct function-for-function conversion/port Preserve

Dec 27, 2022
zMemif is a native golang based library for memif to interworking with dpdk.

zMemif zMemif is a native golang based library for memif to interworking with dpdk. it can simply provide 20Mpps recv and 10Mpps xmit capability. The

Dec 27, 2022
A cloud native distributed streaming network telemetry.
A cloud native distributed streaming network telemetry.

Panoptes Streaming Panoptes Streaming is a cloud native distributed streaming network telemetry. It can be installed as a single binary or clustered n

Sep 27, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

Jan 4, 2023
The Cloud Native Application Proxy
The Cloud Native Application Proxy

Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your ex

Dec 30, 2022
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀

Golang SSH Client. Fast and easy golang ssh client module. Goph is a lightweight Go SSH client focusing on simplicity! Installation ❘ Features ❘ Usage

Dec 24, 2022
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io
MOSN is a cloud native proxy for edge or service mesh. https://mosn.io

中文 MOSN is a network proxy written in Golang. It can be used as a cloud-native network data plane, providing services with the following proxy functio

Dec 30, 2022
Cloud Native Tunnel
Cloud Native Tunnel

inlets is a Cloud Native Tunnel written in Go Expose your local endpoints to the Internet or within a remote network, without touching firewalls. Foll

Jan 4, 2022
A native Thrift package for Go

Thrift Package for Go API Documentation: http://godoc.org/github.com/samuel/go-thrift License 3-clause BSD. See LICENSE file. Overview Thrift is an ID

Nov 22, 2022
Native ZooKeeper client for Go. This project is no longer maintained. Please use https://github.com/go-zookeeper/zk instead.

Native Go Zookeeper Client Library License 3-clause BSD. See LICENSE file. This Repository is No Longer Maintained Please use https://github.com/go-zo

Dec 19, 2022
go implementation of fissions web-native file system

wnfs-go go language implementation of the fission web-native file system, using the typescript implementation as a reference. Development Status: Work

Oct 15, 2022
Package rsync contains a native Go rsync implementation.

gokrazy rsync Package rsync contains a native Go rsync implementation. ⚠ Beware: very fresh. Might eat your data. You have been warned! ⚠ The only com

Jan 2, 2023
Native macOS networking for QEMU using vmnet.framework and socket networking.

qemu-vmnet Native macOS networking for QEMU using vmnet.framework and socket networking. Getting started TODO -netdev socket,id=net0,udp=:1234,localad

Jan 5, 2023
Simple wget - Simple wget written as test for Scorum

simple_wget simple wget written as test for Scorum Task: Implement in Go (http:/

Jan 24, 2022
GO Simple Tunnel - a simple tunnel written in golang
GO Simple Tunnel - a simple tunnel written in golang

GO Simple Tunnel GO语言实现的安全隧道 English README !!!V3版本已经可用,欢迎抢先体验!!! 特性 多端口监听 可设置转发代理,支持多级转发(代理链) 支持标准HTTP/HTTPS/HTTP2/SOCKS4(A)/SOCKS5代理协议 Web代理支持探测防御 支

Jan 2, 2023
An SNMP library written in GoLang.

gosnmp GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IP

Jan 7, 2023
GoSNMP is an SNMP client library fully written in Go

GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv1, SNMPv2c or SNMPv3. Builds are tested against linux/amd64 and linux/386.

Jan 5, 2023
GoSNMP is an SNMP client library fully written in Go.

GoSNMP is an SNMP client library fully written in Go. It provides Get, GetNext, GetBulk, Walk, BulkWalk, Set and Traps. It supports IPv4 and IPv6, using SNMPv1, SNMPv2c or SNMPv3. Builds are tested against linux/amd64 and linux/386.

Oct 28, 2021