Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IPv6 GRE Tun and Tap #317

Merged
merged 1 commit into from
Jan 19, 2018
Merged

Support IPv6 GRE Tun and Tap #317

merged 1 commit into from
Jan 19, 2018

Conversation

aboch
Copy link
Collaborator

@aboch aboch commented Jan 19, 2018

Fixes #316

Also the changes allow to re-enable TestLinkAddDelGretapFlowBased

@aboch
Copy link
Collaborator Author

aboch commented Jan 19, 2018

ping @KireinaHoro Please give it a try too.

Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
@KireinaHoro
Copy link

The link-add part works now. I'm trying to find a way to add an address to the link and bring it up though...

@KireinaHoro
Copy link

Seems like it's working fine. I've tested with the following:

package main

import (
    "github.com/aboch/netlink"
    "log"
    "net"
    "fmt"
)

func main() {
    la := netlink.NewLinkAttrs()
    la.Name = "foobar"

    l, err := netlink.LinkByName(la.Name)
    if err == nil {
        log.Fatalf("Link with name \"%s\" already exists", la.Name)
    }
    myGretun := &netlink.Gretun{LinkAttrs: la}
    myGretun.Remote = net.ParseIP("2001:da8::1")
    myGretun.Local = net.ParseIP("2001:da8::2")
    err = netlink.LinkAdd(myGretun)
    if err != nil {
        log.Fatalf("Could not add %s: %v", la.Name, err)
    }
    l = myGretun
    addr, err := netlink.ParseAddr("172.16.0.1/32")
    if err != nil {
        netlink.LinkDel(myGretun)
        log.Fatalf("Failed to parse address: %v", err)
    }
    netlink.AddrAdd(l, addr)
    netlink.LinkSetUp(l)
    fmt.Printf("Information about the created link: %v", l)
}

@aboch
Copy link
Collaborator Author

aboch commented Jan 19, 2018

Thanks @KireinaHoro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants