Can someone please explain the difference between linux ip tunnel and ip link command when it comes to configuring tunnels (such as GRE, IPIP, or VXLAN)?
I can see that I can configure a GRE tunnel, for example, in two ways:
- ip link add name gre1 type gre …
- ip tunnel add gre1 mode gre …
Is there any difference between the two when it comes to the Linux resources created, performance etc.? Is one of the ways old fashined?
Cheers.
Best Answer
Both iproute2's commands interact with the same kernel, they don't implement anything except this communication only, effectively meaning you should expect no difference in terms of performance.
As can be seen from a relevant commit
ip link
uses more fresh kernel interface —rtnl_link
, compared toip tunnel
: "……"