With iproute2 on Linux, gre/gretap interfaces are setup with ip link add
, which for GRE needs remote
and optionally local
attributes specifying the endpoints. However, I can't find any way to read back these attributes. ip link show
doesn't show them, and they don't seem to be represented anywhere in the data structures returned by the C function getifaddrs
(e.g. if I wanted to implement my own tool to get them). I'm working with an environment where there are a very large number of such interfaces, and I need to be able to find the one associated with a particular remote address. Is there any way to do that without storing the mapping somewhere out-of-band?
Home
/
user-228280
R.. GitHub STOP HELPING ICE's questions
For reasons that would require a lot of irrelevant context to explain, I'm handling GRE packets with a userspace process with a SOCK_RAW
/IPPROTO_GRE
socket. This is working fine, except that despite having a raw socket accepting the GRE packets, the kernel is generating ICMP protocol unreachable responses for each GRE packet it receives. Short of blocking these with a firewall rule, is there a way to prevent them? Some way to tell the system the packets received on the raw socket were accepted?