| ▲ | fellerts 6 hours ago | |||||||
I think this package does exactly what you need: https://pkg.go.dev/github.com/google/gopacket/routing. Works on my machine (error handling left to the reader)
this prints my Ethernet interface as expected. It doesn't make any requests, it just figures out where to route a packet. I guess it interfaces with the OS routing table. | ||||||||
| ▲ | rvermeulen98 6 hours ago | parent [-] | |||||||
Thanks for sharing! This is definitely something I will look into, I am all in favor to simplify the current implementation of finding the "default" OS network interface. | ||||||||
| ||||||||