netlink icon indicating copy to clipboard operation
netlink copied to clipboard

What will be the equivalent command of: ip tuntap add tap0 mode tap?

Open santosh opened this issue 3 years ago • 1 comments

I am trying to configure a tap device on my host. I am compelled to use Golang for it. How can I run a new tap device?

If I were using command line, I would run this:

ip tuntap add tap0 mode tap

santosh avatar Aug 08 '22 12:08 santosh

device := &netlink.Tuntap{
		Mode: netlink.TUNTAP_MODE_TAP,
		LinkAttrs: netlink.LinkAttrs{
			Name: 'deviceName',
		},
	}

sudo required

pujianto avatar Dec 14 '22 05:12 pujianto